Output from azd version
azd version 1.23.13 (commit a1ccaff)
Describe the bug
Based on the Microsoft DevBlogs about deployment slots with AZD, a user can set the environment variable AZD_DEPLOY_{service}_SLOT_NAME to target a specific deployment slot when running azd deploy.
This also implies that by omitting this environment variable, azd will deploy directly to the main app. However, when running azd deploy subsequently by omitting this environment variable, azd always deploys the service to the last deployed deployment slot and not the main app. This prevents us to have two pipelines, one deploying to the main app and another to the deployment slot.
To Reproduce
- Set the
AZD_DEPLOY_{service}_SLOT_NAME environment variable
- run
azd deploy service_name --no-prompt
- Remove
AZD_DEPLOY_{service}_SLOT_NAME
- run
azd deploy service_name --no-prompt
In the deployment logs, nothing is deployed to the main app and both deployments target the deployment slot.
Expected behavior
When AZD_DEPLOY_{service}_SLOT_NAME is not set, azd deploy targets the main app.
Additional context
I can see from this PR #6627 that the selection is done based on deployment history. I don't know about others but the last thing I would like from azd is to silently select a deployment slot for me based on an unknow criteria not explained anywhere. Especially not in a pipeline environment.
production is a reserved word in deployment slots too. So the simplest solution would be to always deploy to the main app when AZD_DEPLOY_{service}_SLOT_NAME is set to production.
Output from
azd versionazd version 1.23.13 (commit a1ccaff)
Describe the bug
Based on the Microsoft DevBlogs about deployment slots with AZD, a user can set the environment variable
AZD_DEPLOY_{service}_SLOT_NAMEto target a specific deployment slot when runningazd deploy.This also implies that by omitting this environment variable, azd will deploy directly to the main app. However, when running
azd deploysubsequently by omitting this environment variable, azd always deploys the service to the last deployed deployment slot and not the main app. This prevents us to have two pipelines, one deploying to the main app and another to the deployment slot.To Reproduce
AZD_DEPLOY_{service}_SLOT_NAMEenvironment variableazd deploy service_name --no-promptAZD_DEPLOY_{service}_SLOT_NAMEazd deploy service_name --no-promptIn the deployment logs, nothing is deployed to the main app and both deployments target the deployment slot.
Expected behavior
When
AZD_DEPLOY_{service}_SLOT_NAMEis not set,azd deploytargets the main app.Additional context
I can see from this PR #6627 that the selection is done based on deployment history. I don't know about others but the last thing I would like from azd is to silently select a deployment slot for me based on an unknow criteria not explained anywhere. Especially not in a pipeline environment.
productionis a reserved word in deployment slots too. So the simplest solution would be to always deploy to the main app whenAZD_DEPLOY_{service}_SLOT_NAMEis set toproduction.