Skip to content

Conversation

@davidfowl
Copy link
Member

@davidfowl davidfowl commented Mar 19, 2025

Description

  • This is a replacement for the magic secret outputs implementation. Resources that support keys push those keys into an explicitly defined per resource key vault and now into any key vault that is provided. The IKeyVaultSecretReference is a new primitive reference type that can is understood natively by compute environments like ACA and the azure preparer.

Fixes #8134

Checklist

@github-actions github-actions bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Mar 19, 2025
- This is a replacement for the magic secret outputs implementation. Resources that support keys push those keys into an explicitly defined per resoure key vault and now into any keyvault that is provided. The IKeyVaultSecretReference is a new primitive reference type that can is understood natively by compute environments like ACA and the azure preparer.
@davidfowl davidfowl force-pushed the davidfowl/no-secret-outputs branch from 94ceb65 to b66df54 Compare March 22, 2025 06:40
@davidfowl davidfowl marked this pull request as ready for review March 22, 2025 09:08
{
"type": "azure.bicep.v0",
"connectionString": "{postgres-data.secretOutputs.connectionString}",
"connectionString": "{postgres-data-kv.secrets.postgres-data--connectionString}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a change queued up on the azd side to process .secrets instead of secret outputs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@mitchdenny mitchdenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good - a few minor questions/comments.

I think it's worth going through all the playgrounds and regenerating the manifest publisher output, so we have a new baseline for comparison. The outputs of that command all make sense.

Comment on lines +95 to 97
SetKnownParameterValue(r, AzureBicepResource.KnownParameters.PrincipalId, _ => environment.ContainerRegistryManagedIdentityId);
SetKnownParameterValue(r, AzureBicepResource.KnownParameters.PrincipalType, _ => "ServicePrincipal");
SetKnownParameterValue(r, AzureBicepResource.KnownParameters.PrincipalName, _ => environment.PrincipalName);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels wrong that we still have PrincipalName on the environment. Shouldn't it be ContainerRegistryManagedIdentityPrincipalName?

Copy link
Member

@eerhardt eerhardt Mar 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I almost half wonder if we should no longer support these "KnownParameters" for PrincipalId, Type, and Name in ACA. Our Azure resources will never use them (or at least, if they do it is a mistake that needs to be fixed).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate change. Not in this PR, it's too big already 😄 . I agree.

@eerhardt
Copy link
Member

image
We should open a breaking change issue in our docs for this.

Refactor Azure Key Vault integration to use a secret resolver function for runtime secret resolution
@davidfowl davidfowl merged commit 5fd2b10 into main Mar 25, 2025
163 checks passed
@davidfowl davidfowl deleted the davidfowl/no-secret-outputs branch March 25, 2025 07:15
@davidfowl davidfowl added area-integrations Issues pertaining to Aspire Integrations packages azure Issues associated specifically with scenarios tied to using Azure and removed area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication labels Mar 25, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Apr 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-integrations Issues pertaining to Aspire Integrations packages azure Issues associated specifically with scenarios tied to using Azure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate BicepSecretOutput and build a first class AzureKeyVaultSecretReference

4 participants