Revert "feat: Add AZD_DEPLOY_{SERVICE}_IGNORE_SLOTS env var to bypass slot deployment (#7530)"#7577
Conversation
… slot deployment (Azure#7530)" This reverts commit 12b5af3.
There was a problem hiding this comment.
Pull request overview
Reverts PR #7530, removing the AZD_DEPLOY_{SERVICE}_IGNORE_SLOTS override and restoring the prior App Service slot-targeting behavior while the team aligns on a more deterministic deployment model.
Changes:
- Removed the ignore-slots env var parsing/override path from App Service deployment target selection.
- Deleted the associated unit tests for
IGNORE_SLOTS. - Removed the documentation section that described App Service slot deployment env vars.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
cli/azd/pkg/project/service_target_appservice.go |
Removes IGNORE_SLOTS override logic and the helper used to build its env var name. |
cli/azd/pkg/project/service_target_appservice_test.go |
Drops tests that covered IGNORE_SLOTS (and, currently, most coverage of slot-targeting behavior). |
cli/azd/docs/environment-variables.md |
Removes the “App Service Slot Deployments” env var documentation section. |
Comments suppressed due to low confidence (1)
cli/azd/docs/environment-variables.md:58
- This PR removes the documentation for
AZD_DEPLOY_{SERVICE}_SLOT_NAME, butservice_target_appservice.gostill reads this env var to auto-select a slot when multiple slots exist. Sincecli/azd/docs/environment-variables.mdis intended to be the single source of truth for env vars thatazdreads, theSLOT_NAMEentry should remain documented (even ifIGNORE_SLOTSis reverted).
| `AZD_BUILDER_IMAGE` | The builder docker image used to perform Dockerfile-less builds. |
| `AZD_DEPLOY_TIMEOUT` | Timeout for deployment operations, parsed as an integer number of seconds (for example, `1200`). Defaults to `1200` seconds (20 minutes). |
## Extension Variables
These variables are set and consumed by azd extension hosts (for example, IDE/editor integrations)
and the azd extension framework. They are not intended to be configured as general CLI settings.
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Summary
Reverts #7530 which introduced the
AZD_DEPLOY_{SERVICE}_IGNORE_SLOTSenvironment variable for bypassing App Service slot deployment. The feature was merged before the architectural concerns raised during review could be fully resolved. This revert restores the prior state while the team aligns on the right approach.Why revert?
PR #7530 added
IGNORE_SLOTSas a third configuration layer on top of the existing deployment-history heuristic andSLOT_NAMEenv var. Review feedback raised several architectural concerns:An
IGNOREenv var is a workaround, not a solution:IGNORE_SLOTSdoesn't add new capability — it tells the tool to disregard infrastructure state it already knows about. This pattern doesn't scale: as new edge cases surface, each one requires another override env var, expanding the configuration surface and making the system harder to reason about. The underlying issue (implicit routing) should be addressed directly.The routing heuristic is non-deterministic: Slot targeting currently relies on Azure-side deployment history that any tool can create — not just azd. Adding override layers on top increases the number of interacting configurations users must understand, rather than simplifying the model.
CI deployments need explicit targeting: In
--no-promptmode, if slots exist but noSLOT_NAMEis specified, the deploy should fail with a clear error listing available targets. This makes every CI deployment deterministic and eliminates "deployed to the wrong target" issues.Infrastructure should be the source of truth: Deployment slots are deliberate infrastructure decisions (Standard tier+, explicit creation). When a user no longer wants slot-based deployments, the correct path is updating their infrastructure — not adding an env var to bypass what the infrastructure declares.
A simpler alternative exists: Require explicit targeting when slots are present (interactive prompt or
SLOT_NAMEin CI). This is a single, well-understood interface that eliminates the need for both the deployment-history heuristic andIGNORE_SLOTS, and scales cleanly.The team needs to align on the right architectural approach before shipping this feature. A follow-up discussion will determine the path forward.
Changes
cli/azd/pkg/project/service_target_appservice.go— RemovedignoreSlotsEnvVarNameForService()helper and early-return check indetermineDeploymentTargetscli/azd/pkg/project/service_target_appservice_test.go— Removed 12 table-driven tests covering ignore-slots env var combinationscli/azd/docs/environment-variables.md— Removed "App Service Slot Deployments" subsection documentingAZD_DEPLOY_{SERVICE}_IGNORE_SLOTSandAZD_DEPLOY_{SERVICE}_SLOT_NAMEIssue References
Reverts #7530
Related to #7365
Testing
go build ./...— passesgo test ./pkg/project/... -run "AppService"— passesgolangci-lint run ./pkg/project/...— 0 issuescspell— 0 issues