How can I Update My GitHub Workflow for Deploying to Test and Production with AZD?

0
3
Asked By CreativeWhimsy42 On

I'm currently using a modified AZD pipeline-generated GitHub workflow to deploy to our Azure test environment, and it's working great. I've set up two environments locally with `azd env new` (aspire-test and aspire-prod) and can deploy to them using `azd deploy`. However, I'm having trouble updating my workflow to handle deployments to production as well. It seems to depend on the AZD_INITIAL_ENVIRONMENT_CONFIG set up by `azd pipeline config`, which only works with the environment that was selected when the pipeline config was last run. I thought the Aspire deployment was ready for CI/CD, but it feels pretty limited since it only supports deployment to one environment. Any advice on how to get this working for both environments?

3 Answers

Answered By BlueSkyCoder On

I encountered the same problem regarding AZURE_ENV_NAME. The issue is that `azd provision` pulls its values from `secrets.AZD_INITIAL_ENVIRONMENT_CONFIG`, and if those values were set up for a particular environment, deployment to a different one fails. How do you usually work around that?

Answered By DevOpsGuru99 On

I manage this by using environments in GitHub Actions. Just change the environment name when deploying, and you should be able to handle dev, test, and prod easily. For AZD, ensure that you are properly changing the variables you pass into it.

Answered By TechWizKid77 On

Honestly, it sounds more like AZD has some limitations when it comes to CI/CD rather than Aspire being the issue. What I usually do is forgo AZD for the provisioning and infrastructure tasks and use `dotnet publish` instead. It might feel like reinventing the wheel, but you'll have more control over your setup that way.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.