Serverless database/container creation fails because omitted throughput options default to autoscale 1000 RU/s
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 55/100
Hướng nghiên cứu
The issue is in CosmosArmResourceProvider.cs and DataPlaneCosmosResourceOperations.cs where throughput defaults are set. Start by examining the CreateUpdateConfig and CreateThroughputProperties methods. Look for where serverless account detection can be added to omit throughput. Run the existing tests in MakeContainerCommandTests and MakeDbCommandTests to understand the current behavior, then write a test for serverless creation.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Creating a container on a serverless Azure Cosmos DB for NoSQL account fails because CosmosDBShell supplies provisioned throughput even when the user omits --scale and --ru.
Both the Azure Resource Manager (ARM) and data-plane creation paths default to autoscale with a maximum of 1,000 RU/s. Serverless accounts must not receive provisioned-throughput settings. Database creation uses the same defaulting logic and is affected as well.
A user reported this while creating a container on a real serverless account. Local source inspection confirms the request-construction defect. This investigation did not reproduce the operation against the live account, and the exact original service error and installed shell version were not captured. The account hostname is intentionally omitted.
Affected commands
mkconandcreate container/create cmkdbandcreate database/create db- CLI and MCP invocations that use these command implementations
- Both ARM-backed creation (normally Entra ID connections) and data-plane-backed creation (keys, emulator, static-token connections)
Reproduction steps
Prerequisite: connect to a serverless Azure Cosmos DB for NoSQL account using an identity authorized to create the relevant resource. For Entra ID resource management, ensure ARM context and the appropriate management-plane permissions are available.
For container creation, use an existing database so database creation does not mask the problem:
cd /ExistingDatabase
mkcon ServerlessRepro /pk
Equivalent entry points include:
create container ServerlessRepro /pk
mkcon ServerlessRepro /pk --database ExistingDatabase
For database creation, navigate to the account root:
cd /
mkdb ServerlessReproDb
Or use create database ServerlessReproDb.
These examples are reproduction instructions derived from the code, not a transcript of a new live-account test.
Expected behavior
With no throughput options, database and container creation should work on a serverless account without sending manual or autoscale throughput settings.
If a user explicitly supplies incompatible throughput options for a serverless account, the shell should explain the incompatibility clearly rather than silently ignoring those options or exposing an avoidable low-level service error.
Actual behavior and root cause
Source revision inspected: 8db03d07d47ca8e5aa1ae7c5f2a400536d18912d.
ARM path
CosmosArmResourceProvider.CreateUpdateConfig computes maxRu ?? 1000. Unless scale is manual or m, it returns AutoscaleMaxThroughput = ru.
Both CreateDatabaseAsync and CreateContainerAsync put this result into the create request's Options, without checking serverless capability.
Data-plane path
DataPlaneCosmosResourceOperations.CreateThroughputProperties similarly defaults to ThroughputProperties.CreateAutoscaleThroughput(1000).
The result is passed to CreateDatabaseIfNotExistsAsync and CreateContainerIfNotExistsAsync, rather than omitting throughput.
No supported omission workaround
Omitting both options still produces autoscale throughput. --scale=none or --scale=serverless is not a workaround: values other than manual/m currently fall through to autoscale. Setting RU/s to zero would still specify throughput rather than omit it.
The MakeDbCommand.CreateThroughputProperties helper also duplicates the defaulting behavior; its existing tests do not verify the backend request construction.
Existing coverage and validation
ThroughputErrorsTestschecks recognition of serverless error messages, not creation behavior.MakeContainerCommandTestschecks partition keys and unique keys, not throughput omission.MakeDbCommandTestsasserts the existing default and contains no serverless creation case.- Integration CI runs offline and emulator suites, not a live serverless-account suite.
Local validation on macOS using .NET SDK 10.0.401: app and test project builds succeeded; all 46 tests selected from MakeContainerCommandTests, MakeDbCommandTests, CreateCommandTests, ThroughputErrorsTests, and CosmosArmResourceProviderTests passed. This demonstrates the coverage gap, not successful serverless creation.
Proposed direction and acceptance criteria
- Make the creation-throughput decision account-aware, omitting throughput on serverless accounts when no throughput options were supplied.
- Support both ARM and data-plane connections; do not require ARM-only permissions for key-based connections merely to decide throughput behavior.
- Give an actionable error for explicitly supplied throughput options on serverless accounts; do not silently discard user intent.
- Preserve existing provisioned-account behavior unless a separate, intentional behavior change is agreed. Include shared-throughput databases in regression coverage.
- Verify actual ARM request payloads omit both manual and autoscale throughput fields on serverless, and actual data-plane SDK calls receive no throughput.
- Cover database and container creation, command aliases, omitted options, explicit manual/autoscale options, and provisioned-account regressions. Preserve partition-key, unique-key, and indexing-policy behavior.
- Do not swallow authentication, authorization, cancellation, or unrelated service failures during capability detection.
- Add an opt-in live serverless smoke test with explicit account configuration, isolated resource names, and cleanup; emulator-only testing cannot establish serverless compatibility.
- Update help/localization, README, and relevant command/MCP documentation with the supported behavior.
Related issues and documentation
Searches across open and closed issues for serverless, throughput, mkcon, and "create container" did not find an issue for this creation defect.
Related but distinct closed reports:
- #138:
settingsfails when reading offers on serverless. - #136 and #137: Scale settings issue reports for unsupported offers operations.
- #29: Graceful handling of expected settings/throughput errors.
Those reports concern inspecting or modifying settings on existing resources, rather than specifying throughput while creating resources.
Official reference: Azure Cosmos DB serverless.
- Ngôn ngữ chính
- C#
- Star
- 3
- Fork
- 7
- Merge trung bình
- 1 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 19
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Azure/CosmosDBShell
-
Valid vector, ranking, and DISTINCT queries fail when reading unsupported continuation tokens Đang mởbug P1
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Azure/CosmosDBShell#219 ·
-
automation P1
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
Azure/CosmosDBShell#178 · 1 bình luận ·
-
automation P1
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Azure/CosmosDBShell#175 · 1 bình luận ·
-
agentic enhancement P1
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Azure/CosmosDBShell#159 · 2 bình luận ·
-
agentic enhancement P0
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Azure/CosmosDBShell#153 · 1 bình luận ·
Tất cả issue của Azure/CosmosDBShell
Issue tương tự
-
bug frontend good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
NavigationViewItemAutomationPeer implements IInvokeProvider but never advertises the Invoke pattern Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
unoplatform/uno#24629 ·
-
agentic-workflows Needs: Triage :mag: State: In-PR
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
CS0162 "Unreachable code detected" warning from a MSBuildTemp .tmp file in every game project Đang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
Type: enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
apache/arrow-adbc#4809 ·