Skip to content
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

[Breaking change]: Aspire.Hosting.Azure.CosmosDB obsolete method and default managed identity support #2428

Open
2 of 3 tasks
sebastienros opened this issue Jan 16, 2025 · 0 comments · May be fixed by #2566
Open
2 of 3 tasks
Assignees
Labels
⛓️‍💥 breaking-change Issues or PRs tracking breaking changes. doc-idea Indicates issues that are suggestions for new topics [org][type][category] in-pr okr-freshness OKR: Freshness of content Pri1 High priority, do before Pri2 and Pri3 🗺️ reQUEST Triggers an issue to be imported into Quest.

Comments

@sebastienros
Copy link
Member

Description

Applies to 9.1

1- AddDatabase() is being obsoleted and replaced by WithDatabase(). Calling it will call WithDatabase().
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 (or DefaultTokenCredential if not is configured). To return to the previous behavior the WithAccessKeyAuthentication() can be used:

var cosmosdb = builder
  .AddAzureCosmosDB("cache")
  .WithAccessKeyAuthentication();

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

  • Binary incompatible: Existing binaries might encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
  • Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code might require source changes to compile successfully.
  • Behavioral change: Existing binaries might behave differently at run time.

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 of AddDatabase().
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!>!

@sebastienros sebastienros added doc-idea Indicates issues that are suggestions for new topics [org][type][category] Pri1 High priority, do before Pri2 and Pri3 ⛓️‍💥 breaking-change Issues or PRs tracking breaking changes. labels Jan 16, 2025
@dotnetrepoman dotnetrepoman bot added the ⌚ Not Triaged Not triaged label Jan 16, 2025
@IEvangelist IEvangelist added 🗺️ reQUEST Triggers an issue to be imported into Quest. okr-freshness OKR: Freshness of content and removed ⌚ Not Triaged Not triaged labels Feb 13, 2025
@dotnetrepoman dotnetrepoman bot added 🗺️ mapQUEST Only used as a way to mark an issue as updated. RepoMan should instantly remove it. and removed 🗺️ mapQUEST Only used as a way to mark an issue as updated. RepoMan should instantly remove it. labels Feb 13, 2025
@IEvangelist IEvangelist moved this from 🔖 Ready to 👀 In review in dotnet/docs February 2025 sprint project Feb 13, 2025
@dotnetrepoman dotnetrepoman bot added 🗺️ mapQUEST Only used as a way to mark an issue as updated. RepoMan should instantly remove it. and removed 🗺️ mapQUEST Only used as a way to mark an issue as updated. RepoMan should instantly remove it. labels Feb 13, 2025
@IEvangelist IEvangelist linked a pull request Feb 13, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⛓️‍💥 breaking-change Issues or PRs tracking breaking changes. doc-idea Indicates issues that are suggestions for new topics [org][type][category] in-pr okr-freshness OKR: Freshness of content Pri1 High priority, do before Pri2 and Pri3 🗺️ reQUEST Triggers an issue to be imported into Quest.
Projects
Status: 👀 In review
Development

Successfully merging a pull request may close this issue.

2 participants