-
Notifications
You must be signed in to change notification settings - Fork 198
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
Aspire: Use bicep for container app deployment #4286
Aspire: Use bicep for container app deployment #4286
Conversation
The plan for Aspire 9 is to support customization of the container app for services by leveraging the CDK to generate the bicep IaC for a given container app. To prepare for that new world, we'd like `azd infra synth` to start writing bicep and to modify our deployment strategy for container apps to be based on ARM deployments instead of directly PUTing a copy of the resource to the RP. This change starts to work through that.
f9ce84d
to
b7439bd
Compare
This adds rudimentary support for deploying the `.bicep` version of the IaC for a container app as generated by `azd infra synth`. In the case where both a `.yaml` and `.bicep` version of the IaC for a container app exist, the container `.yaml` version is prefered. When neither the `.yaml` or `.bicep` version of the IaC exist on disk, `azd` will continue to generate and deploy the `.yaml` flavored version of the container app IaC.
This change moves using bicep instead of yaml for container apps for aspire projects behind the alpha flag `aspire.useBicepForContainerApps`. To enable this, run `azd config set alpha.aspire.useBicepForContainerApps on`. Also adds support for using bicep when `infra synth` had not yet been run.
…bicep-for-container-deployment
e20da6e
to
125ffbd
Compare
…-use-bicep-for-container-deployment
…-use-bicep-for-container-deployment
The main change on the aspire side is in with experimental public APIs to customize this and turn it on. It changes all container and project resources to project.v1 and container.v1 to support this new nested deployment field. |
…-use-bicep-for-container-deployment
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.
Overall looks good -- didn't look too detailed but I'm really happy to see this change land.
cli/azd/pkg/apphost/testdata/TestAspireContainerGeneration-main.bicep.snap
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.
Thanks for the updates while I was gone, @vhvb1989! I took a look over the changes and went ahead and cleaned some stuff up (mostly removing some of the stuff related to this being behind an alpha flag when I first added it and then no longer needed bicep templates).
Had a few questions about some of the changes but nothing blocking. The one thing I do wonder is if some of the bind mount changes end up changing physical resource names and if so if we want to disallow them, but this looks good.
The .bicepparms
file generation is a really smart idea. I wish I had thought of that instead of that weird @metadata
thing I was thinking.
…ttps://github.com/ellismg/azure-dev into ellismg/aspire-use-bicep-for-container-deployment
…-use-bicep-for-container-deployment
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash:
pwsh:
WindowsPowerShell install
MSI install
Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
The plan for Aspire 9 is to support customization of the container app for services by leveraging the CDK to generate the bicep IaC for a given container app.
To prepare for that new world, we'd like
azd infra synth
to start writing bicep and to modify our deployment strategy for container apps to be based on ARM deployments instead of directly PUTing a copy of the resource to the RP.This change starts to work through that.
This is presently guarded behind an alpha flag, so you'll need to run:
In order to enable this work. When that is turned on,
azd
will generate bicep templates instead of yaml durninginfra synth
and also look for bicep files instead of yaml files when doing a deployment.Note - this is a work in progress and complex Aspire features may not be supported yet - but this does work with aspire-starter template. The secure outputs/secrets work is still pretty rough and likely doesn't work, but I'm exploring that next.
fix: #4396