Skip to content

Fix database and container creation on serverless accounts - #222

Open
Mike Krüger (mkrueger) wants to merge 7 commits into
mainfrom
dev/mkrueger/serverless-create-throughput
Open

Mike Krüger (mkrueger) wants to merge 7 commits into
mainfrom
dev/mkrueger/serverless-create-throughput

Conversation

@mkrueger

@mkrueger Mike Krüger (mkrueger) commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Omit throughput from serverless ARM creation requests; reject explicit RU/scale settings with an actionable error.
  • On data-plane connections, retry without throughput only when the service reports a serverless throughput rejection, preserving provisioned-account defaults.
  • Cover database/container creation, ARM payloads, aliases, regression behavior, and an opt-in live serverless smoke test; update help and docs.

Fixes #218

@github-code-quality

github-code-quality Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Code Coverage Overview

Languages: C#

C# / code-coverage/dotnet

The overall line coverage in commit 0311a6b in the dev/mkrueger/serverl... branch is 64%. The line coverage in commit c614f52 in the main branch is 63%.

Show a line coverage summary of the most impacted files.
File main c614f52 dev/mkrueger/serverl... 0311a6b +/-
D:\a\CosmosDBSh...ughputErrors.cs 100% 100% 0%
D:\a\CosmosDBSh...osmosCommand.cs 37% 39% +2%
D:\a\CosmosDBSh...sourceFacade.cs 15% 27% +12%
D:\a\CosmosDBSh...ceOperations.cs 3% 16% +13%
D:\a\CosmosDBSh...urceProvider.cs 33% 62% +29%
D:\a\CosmosDBSh...ainerCommand.cs 35% 85% +50%
D:\a\CosmosDBSh...reateCommand.cs 26% 78% +52%
D:\a\CosmosDBSh...akeDbCommand.cs 38% 92% +54%
D:\a\CosmosDBSh...onThroughput.cs 0% 100% +100%
D:\a\CosmosDBSh...tedException.cs 0% 100% +100%

Updated September 27, 2026 19:14 UTC

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

One or more issues must be addressed before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Fixes serverless database/container creation by omitting throughput when unspecified and rejecting explicit throughput settings, while preserving provisioned-account defaults.

Changes:

  • Added serverless detection and ARM payload handling.
  • Added data-plane retry logic and actionable errors.
  • Updated tests, documentation, localization, and smoke-test guidance.
File Description
README.md Updated as part of this pull request.
l10n/​CosmosDBShell.json Updated as part of this pull request.
docs/​mcp.md Updated as part of this pull request.
docs/​commands.md Updated as part of this pull request.
CosmosDBShell/​lang/​en.ftl Updated as part of this pull request.
CosmosDBShell/​Azure.Data.Cosmos.Shell.Core/​ServerlessThroughputNotSupportedException.cs Updated as part of this pull request.
CosmosDBShell/​Azure.Data.Cosmos.Shell.Core/​DataPlaneCosmosResourceOperations.cs Updated as part of this pull request.
CosmosDBShell/​Azure.Data.Cosmos.Shell.Core/​CreationThroughput.cs Updated as part of this pull request.
CosmosDBShell/​Azure.Data.Cosmos.Shell.Core/​CosmosArmResourceProvider.cs Updated as part of this pull request.
CosmosDBShell/​Azure.Data.Cosmos.Shell.Commands/​MakeDbCommand.cs Updated as part of this pull request.
CosmosDBShell/​Azure.Data.Cosmos.Shell.Commands/​MakeContainerCommand.cs Updated as part of this pull request.
CosmosDBShell.Tests/​Integration/​ServerlessCreationSmokeTests.cs Updated as part of this pull request.
CosmosDBShell.Tests/​CommandTests/​ServerlessCreationThroughputTests.cs Updated as part of this pull request.
CONTRIBUTING.md Updated as part of this pull request.
CHANGELOG.md Updated as part of this pull request.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread CosmosDBShell/Azure.Data.Cosmos.Shell.Core/DataPlaneCosmosResourceOperations.cs Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 27, 2026 07:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Address the three unresolved moderate findings covering option handling, error classification, and smoke-test cleanup.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
Resolved since last review (1)

Comment thread CosmosDBShell/Azure.Data.Cosmos.Shell.Core/ThroughputErrors.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

One or more issues must be addressed before approval.

Review effort: Lite
Findings: 1 Medium severity · 1 Low severity

Open (2)
Resolved since last review (1)

Comment thread CosmosDBShell/lang/en.ftl
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 27, 2026 15:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

An unresolved issue allows whitespace-only --scale input to bypass explicit-option rejection; the smoke-test assertion is also overly broad.

Review effort: Lite
Findings: None

Resolved since last review (2)

…tion

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 27, 2026 19:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

One or more issues must be addressed before approval.

Review effort: Lite
Findings: None

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The implementation consistently covers both creation paths with focused regression and payload tests.

Review effort: Balanced
Findings: None

@mkrueger

Copy link
Copy Markdown
Collaborator Author

Copilot resolve the merge conflicts in this pull request

…ss-create-throughput

Co-authored-by: mkrueger <341098+mkrueger@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 28, 2026 12:23

Copilot AI commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Copilot resolve the merge conflicts in this pull request

Merged the latest main into this branch. Git's ort strategy resolved everything automatically — no conflict markers were produced, including in the shared files (CosmosDBShell/lang/en.ftl, l10n/CosmosDBShell.json, docs/commands.md, README.md, CHANGELOG.md).

Verified after the merge:

  • dotnet build CosmosDBShell/CosmosDBShell.csproj — succeeded, 0 warnings/errors
  • dotnet test CosmosDBShell.Tests/CosmosDBShell.Tests.csproj --filter "Category!=Emulator" — 3181 passed, 0 failed (1 skipped: the opt-in live serverless smoke test)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The command documentation incorrectly claims data-plane explicit-throughput failures occur without sending a rejected request.

Review effort: Balanced
Findings: 1 Low severity

Open (1)

Comment thread docs/commands.md
--ru Max RU/s (default: 1000)
```

On provisioned accounts, omitting both options creates shared autoscale throughput with a maximum of 1000 RU/s. On serverless accounts, omit both options: the database is created without throughput settings, and supplying `--scale` or `--ru` fails with an explanation instead of sending a request the service rejects.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Serverless database/container creation fails because omitted throughput options default to autoscale 1000 RU/s

4 participants