Skip to content

Unclear how to create custom bicep resources which generate secrets #8750

@onionhammer

Description

@onionhammer

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

With the changes to custom bicep resources utilizing a single keyvault in 9.2, it's become less clear to me how to create bicep resources which have secret output.

Looking at #2587 (comment) I see it seems like this may be the way to go, so I created this repository:

https://github.com/onionhammer/repro-aspire-issue/blob/master/repro-aspire-issue.AppHost/Program.cs

With this repro, it runs and works once, but subsequent runs fail, unless you clear out the deployments section of your secrets.json and restart your apphost.

I may be going about this all wrong, but the docs aren't updated so forgive me :)

Expected Behavior

There should be a straightforward/documented way to create and retrieve secrets generated in bicep

Steps To Reproduce

  1. Clone https://github.com/onionhammer/repro-aspire-issue/
  2. Add your subscription to the apphost path; cd into the directory and use dotnet user-secrets set "Azure:SubscriptionId" "your-subscription-id"
  3. Run the apphost with dotnet run - should work the first time
  4. Stop the app host, then run it again
  5. This time you'll see it will not be able to resolve the Translator API key

Exceptions (if any)

No response

.NET Version info

.NET SDK:
Version: 9.0.202
Commit: 3a53853c30
Workload version: 9.0.200-manifests.5c4e24dc
MSBuild version: 17.13.13+1c2026462

Anything else?

No response

Metadata

Metadata

Assignees

Labels

area-integrationsIssues pertaining to Aspire Integrations packagesazureIssues associated specifically with scenarios tied to using Azure‼️regression-from-last-releaseThis used to work in an earlier version of Aspire and we broke it!

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions