Skip to content

Bug: settings command fails on serverless account (offers API 400) #138

Description

@sajeetharan

Describe the bug

Running the settings command against a container in a serverless Azure Cosmos DB for NoSQL account fails.
The command path attempts to access /offers, which is unsupported for serverless accounts, and surfaces a raw SDK BadRequest exception.

Impact

  • Users cannot use settings successfully on serverless accounts.
  • Error appears as a low-level SDK failure instead of a clear capability message.

Steps to reproduce

  1. Connect CosmosDBShell to a serverless Azure Cosmos DB for NoSQL account.
  2. Navigate to a container, e.g. productcatalog/products.
  3. Run settings.

Expected behavior

  • settings should succeed for supported operations.
  • Any serverless-unsupported settings should be hidden/disabled or clearly reported as unsupported.
  • User-facing message should explain that offer/throughput operations are not available on serverless accounts.

Actual behavior

The command fails with:

Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 9329a313-8bba-4a0f-b41a-6735d839429a;
Reason: {"code":"BadRequest","message":"Reading or replacing offers is not supported for serverless accounts.\\r\\nActivityId: 9329a313-8bba-4a0f-b41a-6735d839429a, Microsoft.Azure.Documents.Common/2.14.0"}
RequestUri: https://ai-vercel-cosmosdb-westus2.documents.azure.com/offers;
RequestMethod: POST;
SDK: Windows/10.0.26100 cosmos-netstandard-sdk/3.42.2;

Environment

  • OS: Windows 10.0.26100
  • Account type: Serverless Azure Cosmos DB for NoSQL
  • Cosmos SDK user-agent observed: cosmos-netstandard-sdk/3.42.2

Suggested fix

  • Detect serverless capability before entering offer/throughput settings flows.
  • Do not call /offers for serverless accounts.
  • Return actionable UX text: Throughput/offer settings are not supported for serverless accounts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions