[Breaking change]: Aspire.Hosting.Azure.CosmosDB obsolete method and default managed identity support #2428
Labels
⛓️💥 breaking-change
Issues or PRs tracking breaking changes.
doc-idea
Indicates issues that are suggestions for new topics [org][type][category]
Pri1
High priority, do before Pri2 and Pri3
⌚ Not Triaged
Not triaged
Description
Applies to 9.1
1-
AddDatabase()
is being obsoleted and replaced byWithDatabase()
. Calling it will callWithDatabase()
.2- By default
AddAzureCosmosDB()
is now using Managed Identity during provisioning instead of creating a Key Vault instance with a random access key. The default connection string passed to the client integration will be secrets-free and use a provided token crediential (orDefaultTokenCredential
if not is configured). To return to the previous behavior theWithAccessKeyAuthentication()
can be used:Corresponding PR: dotnet/aspire#7092
Version
Other (please put exact version in description textbox)
Previous behavior
n/a
New behavior
n/a
Type of breaking change
Reason for change
1- Follow new API pattern when an existing resource is returned instead of a new resource. (Add vs With)
2- Security
Recommended action
1- Use
WithDatabase()
instead ofAddDatabase()
.2- Update applications to use token credentials instead of secrets in connection strings.
Affected APIs
static Aspire.Hosting.AzureCosmosExtensions.AddDatabase(this Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.AzureCosmosDBResource!>! builder, string! name) -> Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.AzureCosmosDBResource!>!
The text was updated successfully, but these errors were encountered: