-
Notifications
You must be signed in to change notification settings - Fork 480
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
Add Cosmos database resource. #1583
Conversation
Can you update the provisioner as well? |
src/Aspire.Hosting.Azure/AzureCosmosDBCloudApplicationBuilderExtensions.cs
Show resolved
Hide resolved
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.
This is essentially exactly what I had in one of the iterations of my PR ;)
Yeah at the time I didn't quite realize just how painful it is to create a database when using managed identity with the data plane SDK. |
Note that I think in the long term we're going to loosen that up and support it in the data plane SDK, but that's probably a next semester work item. |
Provisioner updated. |
src/Aspire.Hosting.Azure.Provisioning/Provisioners/AzureCosmosDBProvisioner.cs
Show resolved
Hide resolved
|
||
await foreach (var existingDatabase in existingDatabases) | ||
{ | ||
if (!resource.Databases.Any(d => d.Name == existingDatabase.Data.Name)) |
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.
You could do a single pass over the set of databases but I'm not concerned about performance 😄
This PR adds support for
AddDatabase(...)
on Cosmos database resources.Microsoft Reviewers: Open in CodeFlow
Usage:
The manifest will look like this:
The expectation is that a deployment tool that supports these resource types would create the database as well.