Add App Service deployment slot routing based on deployment history#6627
Merged
Add App Service deployment slot routing based on deployment history#6627
Conversation
Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
… and fix file handle cleanup Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix app service deployment logic with custom resolver
Add App Service deployment slot routing based on deployment history
Jan 28, 2026
vhvb1989
reviewed
Jan 28, 2026
Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
weikanglim
reviewed
Jan 29, 2026
weikanglim
reviewed
Jan 29, 2026
weikanglim
reviewed
Jan 29, 2026
…sion-based retry delay Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
vhvb1989
reviewed
Jan 29, 2026
…meters instead Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
Member
|
/azp run azure-dev - cli |
|
Azure Pipelines successfully started running 1 pipeline(s). |
weikanglim
reviewed
Jan 30, 2026
Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
weikanglim
approved these changes
Jan 30, 2026
Contributor
weikanglim
left a comment
There was a problem hiding this comment.
Looks good, @vhvb1989! I appreciate the effort towards landing this cleanly and in a thoughtful manner. Kudos on making the e2e test readable and demonstrating the overall feature here.
Member
|
/check-enforcer evaluate |
This was referenced Feb 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
App Service Deployment Slots Support - Phase 1 Foundation
This PR implements the foundational support for Azure App Service deployment slots as outlined in issue #6526. It focuses on intelligent deployment routing based on deployment history and available slots.
🎯 What This PR Does
Adds automatic slot detection and smart deployment logic to
azd deployfor App Service targets:📝 Changes Made
Core API Methods (
cli/azd/pkg/azapi/webapp.go)HasAppServiceDeployments()- Checks deployment history via Azure Web Apps APIGetAppServiceSlots()- Retrieves available deployment slotsDeployAppServiceSlotZip()- Deploys zip package to specific slotService Target Updates (
cli/azd/pkg/project/service_target_appservice.go)appServiceTargetto includeconsolefor user interactionDeploy()to support multi-target deploymentdetermineDeploymentTargets()with intelligent routing logicAZD_DEPLOY_{SERVICE}_SLOT_NAMEenvironment variable to skip promptsTest Coverage
cli/azd/pkg/azapi/webapp_slots_test.go):HasAppServiceDeployments(with/without deployments)GetAppServiceSlots(with/without slots)DeployAppServiceSlotZip(success/not found scenarios)cli/azd/test/functional/deploy_test.go):Test_CLI_Deploy_SlotDeployment- End-to-end test of slot deployment workflowserviceHealthProberstruct with session-aware retry delayscleanupRgfunction for resource cleanup✅ Quality Assurance
🔐 Security
📚 Documentation
Added detailed documentation explaining the deployment strategy:
🚀 What's Next (Future Phases)
This PR implements Phase 1 foundation. Future enhancements:
--to,--traffic,--status)🔗 Related Issue
Closes #6526 (Phase 1)
Original prompt
let's use this to fix #6526. Create a PR with the current changes and the context of this conversation.
[Chronological Review: The conversation began with the user requesting the flow path for running `azd deploy` for a host of `appservice`, specifically looking for a command that calls a manager to invoke the app service implementation with `zipdeploy`. The user then inquired about the logic behind `GetServiceTarget` and how resources are identified for deployment. Following this, the user asked about which `serviceTarget` has a custom resolver and how it operates. The user then shifted focus to updating the app service to utilize a custom resolver, requesting the implementation details for this change. The conversation evolved to discuss deploying app service to slots, with specific conditions for deployment based on previous deployments and slot availability. The user clarified the deployment logic, emphasizing that if there are no previous deployments, the app should be deployed to both the main web app and any slots. The user also requested to create a PR to fix a specific GitHub issue without modifying the `/extension` folder.]Do not make changes to /extension folder
[Intent Mapping:
[Technical Inventory:
azd deploy: Command for deploying applications.GetServiceTarget: Function for identifying deployment resources.[Code Archaeology:
Deploy(): The main function to be modified for app service deployment logic.[Progress Assessment:
Deploy()method and PR creation are pending.][Context Validation: All necessary context for continuing the implementation of the
Deploy()method and creating the PR is captured.][Recent Commands Analysis:
/extensionfolder.1. Conversation Overview: - Primary Objectives: - "find the flow path for running azd deploy for a host=appservice." - "What's the logic behind GetServiceTarget?" - "Can we update appservice to use a custom resolver as well?" - "let's use this to fix https://github.com//issues/6526." - Session Context: The conversation flowed from understanding deployment commands to discussing the logic behind deployment strategies and ultimately deciding on modifications to the `Deploy()` method for app service. - User Intent Evolution: The user shifted from exploring custom resolvers to directly modifying the deployment logic based on deployment history and slot availability.- Technical Foundation:
- Custom resolver: A feature to allow custom logic in deployment processes.
- App service slots: Deployment targets that allow for staging and testing.
- Codebase Status:
- Purpose: Main function for deploying the app service.
- Current State: Logic to be modified to handle deployment based on previous deployments and slot availability.
- Key Code Segments: N...
azd: Azure Developer CLI for deploying applications.GetServiceTarget: Function for determining the target service for deployment.Deploy():Created from VS Code.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.