-
Notifications
You must be signed in to change notification settings - Fork 285
[Issue] azd deploy automatically deploys to a deployment slot instead of the main app when AZD_DEPLOY_{service}_SLOT_NAME is not set #7365
Description
- Make sure you've installed the latest version using instructions
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_NAMEenvironment 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.