Microsoft DevOps Engineer Expert AZ-400 Practice Question
You operate a mission-critical Azure App Service web app that uses a production slot and a staging slot named "green". A multi-stage Azure Pipelines YAML pipeline already builds and deploys the new version to the green slot. Compliance rules state that:
traffic must be shifted to the new version without any measurable downtime,
an automated health-check endpoint (/health) must be called before live traffic is routed,
if the health check fails, the swap must be cancelled automatically.
You need to add a job to the pipeline that performs the slot swap while meeting the compliance rules. Which pipeline task and configuration should you use?
Add an AzureAppServiceManage task, set its action to Swap Slots, and enable the Swap with preview option.
Add an AzureCLI@2 task that runs az webapp deployment slot swap --slot green --target-slot production.
Add an AzureTrafficManager task that gradually shifts 100% of traffic from the green slot to the production slot.
Add an AzureAppServiceDeploy task configured for the production slot and set the deployToSlotOrASE input to true.
The AzureAppServiceManage task's 'Swap Slots' action includes a 'Swap with preview' option. When this option is enabled, the task first applies the production slot's configuration to the staging slot and warms up the application. It then automatically calls the health check endpoint. If the health check is successful, it completes the swap by redirecting production traffic. If the health check fails, the task automatically cancels the swap, reverting the staging slot's configuration. This process ensures zero downtime and meets the compliance requirements for an automated health check and rollback. The standard 'Azure App Service deploy' task does not include this integrated swap logic. Using the Azure CLI would require custom scripting for the health check and rollback, which is less efficient than the built-in task functionality.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the 'Swap Slots' feature in Azure App Service?
Open an interactive chat with Bash
What does the 'Swap with preview' option do?
Open an interactive chat with Bash
How does the AzureAppServiceManage task handle health checks?
Open an interactive chat with Bash
What does the 'Swap Slots' action in AzureAppServiceManage do?
Open an interactive chat with Bash
What is the difference between 'Swap Slots' and traffic management in Azure App Service?
Open an interactive chat with Bash
How does the health check endpoint improve slot swapping in Azure pipelines?
Open an interactive chat with Bash
Microsoft DevOps Engineer Expert AZ-400
Design and implement build and release pipelines
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .