-
Notifications
You must be signed in to change notification settings - Fork 647
CosmosDB: Add the 'EnableServerless' capability to accounts #9692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for Azure Cosmos DB accounts to be created in serverless mode by introducing a new constant and updating the account configuration with the corresponding capability.
- Added a new constant in CosmosConstants for the serverless capability.
- Updated the AzureCosmosDBExtensions to include the "EnableServerless" capability when configuring Cosmos DB accounts.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/Shared/Cosmos/CosmosConstants.cs | Added a constant for the "EnableServerless" capability. |
src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBExtensions.cs | Configured Cosmos DB accounts to include the serverless capability. |
@davidfowl - care to take a look? Note this changes it unconditionally for all accounts. If we want to expose configuration I'll need some suggestions on what the right pattern is to do that. |
...mosDBExtensionsTests.AddAzureCosmosDBViaPublishMode_NoAccessKeyAuthentication.verified.bicep
Outdated
Show resolved
Hide resolved
Other note: I didn't actually run through provisioning with this. Would be great if someone could test a scenario known to work with Cosmos DB (or point me to one). |
@sebastienros should we add a WithDefaultSku like we did with sql ? |
@davidfowl @sebastienros - please take another look. |
The one question I have is around subscription limitations with the serverless capability. Is it one per sub or something crazy like that? |
@davidfowl - We don't have subscription limits with the serverless capability. We do have a free account tier that is one per sub, but that is different than this. |
Do you want me to merge, or do you want to? |
I was giving @sebastienros a chance to look but I will merge. |
Description
Change Azure Cosmos DB accounts to be created with the "EnableServerless" capability. This is the recommended path for dev/test type scenarios, since it scales to zero when idle. See https://learn.microsoft.com/en-us/azure/cosmos-db/serverless for more details about it.
Fixes #8854
Checklist
<remarks />
and<code />
elements on your triple slash comments?doc-idea
templatebreaking-change
templatediagnostic
template