-
Notifications
You must be signed in to change notification settings - Fork 695
Davidfowl/fix emulators #8406
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
Davidfowl/fix emulators #8406
Conversation
- Pass the IKeyVaultSecretReference to the SecretResolver - Don't add the default keyvault when using the emulator.
… support for CosmosDB and other resources
…t if the Azure resource is emulated or container in run mode.
@davidfowl - I think this is ready for review. |
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 fixes the issue where a KeyVault resource is added in scenarios when the resource is either running as a container (for Redis and Postgres) or as an emulator (for CosmosDB). The changes update both test coverage and resource provisioning logic to conditionally remove the KeyVault resource based on the runtime mode and authentication type.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
tests/Aspire.Hosting.Azure.Tests/AzureRedisExtensionsTests.cs | Added test to verify that KeyVault is not included when running Redis as a container. |
tests/Aspire.Hosting.Azure.Tests/AzurePostgresExtensionsTests.cs | Added test to verify that KeyVault is not included when running Postgres as a container. |
tests/Aspire.Hosting.Azure.Tests/AzureCosmosDBExtensionsTests.cs | Updated tests to validate KeyVault behavior for CosmosDB in both access key and emulator scenarios. |
tests/Aspire.Hosting.Azure.Tests/AzureBicepResourceTests.cs | Added tests and updated secret resolver usage to support the new signature. |
src/Aspire.Hosting.Azure/Provisioning/Provisioners/BicepProvisioner.cs | Modified the secret resolver lambda to use IKeyVaultSecretReference. |
src/Aspire.Hosting.Azure/IKeyVaultResource.cs | Updated the interface signature for SecretResolver to accept IKeyVaultSecretReference. |
src/Aspire.Hosting.Azure.Redis/AzureRedisExtensions.cs | Added an event subscription to remove the KeyVault when running in container mode. |
src/Aspire.Hosting.Azure.PostgreSQL/AzurePostgresExtensions.cs | Added an analogous event subscription for Postgres to remove the KeyVault when appropriate. |
src/Aspire.Hosting.Azure.KeyVault/AzureKeyVaultSecretReference.cs | Changed the secret resolver invocation to pass the secret reference instead of just the secret name. |
src/Aspire.Hosting.Azure.KeyVault/AzureKeyVaultResource.cs | Updated the internal handling of SecretResolver to reflect the new delegate signature. |
src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBResource.cs | Altered the connection string generation to bypass secret references when running as an emulator. |
src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBExtensions.cs | Updated event subscription to remove the KeyVault resource when the resource is in emulator mode. |
/backport to release/9.2 |
Started backporting to release/9.2: https://github.com/dotnet/aspire/actions/runs/14223464886 |
Description
Don't add the keyvault if the resource is a container.
Fixes #8364