Use a deployment slot and swap it into production

Azure Portal, Hands On20 minutesCosts moneySteps checked 25 October 2026By Cloud Hands On

In this task you'll use deployment slots and swap.

A deployment slot is a second copy of your app with its own address, such as app-practice-staging. You deploy the new version there, test it, then swap it with production. The swap is quick, and if something's wrong you swap back.

Settings can follow the code or stay with the slot. Tick Deployment slot setting for values that must never move, such as the production database address.

Example. Ironbridge Payments deploys every release to a staging slot first. Testers check it at the staging address, and the team swaps it into production at 6 am, when traffic is lowest.

Costs money. Deployment slots need a Premium tier (or the older Standard tier, now listed as Legacy). Premium v3 P0V3 costs about 0.087 USD an hour (roughly 7p, or £50 a month) while it exists. Try it for under an hour, then scale back to Free or delete the resource group.

Before you start

You need: Website Contributor or Contributor. Time: 20 minutes.

Where to look

  1. App Services
  2. app-practice
  3. Deployment
  4. Deployment slots

Steps

  1. Open the app and select Deployment slots. On Free or Basic you'll see that slots need a higher tier. To follow along without paying, read the rest of the steps.
  2. To try it, select Scale up (under App Service plan) and move to Premium v3 P0V3 (or Standard S1, listed under Legacy).From this moment the plan costs money every hour.
  3. Back in Deployment slots, select + Add slot, name it staging, and select Add.
  4. Deploy a changed page to the slot from Cloud Shell:Change index.html, zip it again, and run the deploy and startup commands from the deploy task, adding --slot staging to each.
  5. Open the staging address and the production address side by side: they show different versions.
  6. Select Swap, check that the source is staging and the target is production, then Start Swap. Refresh both addresses: the versions have changed places.
  7. Swap back if you like, then delete the slot and scale the plan back to Free F1.

Commands

# Move the plan to Premium v3 P0V3 (costs money from now)
az appservice plan update --resource-group rg-portal-practice --name asp-practice --sku P0V3

# Create a staging slot
az webapp deployment slot create --resource-group rg-portal-practice --name <app name> --slot staging

# Swap staging into production
az webapp deployment slot swap --resource-group rg-portal-practice --name <app name> --slot staging --target-slot production

# Clean up
az webapp deployment slot delete --resource-group rg-portal-practice --name <app name> --slot staging
az appservice plan update --resource-group rg-portal-practice --name asp-practice --sku F1

Watch out for

Cost
Premium and Standard cost money every hour, and each slot uses the plan's resources. Scale back to Free (after deleting slots) or delete the resource group as soon as you've finished.
Security
Slots are public by default. Protect a staging slot with authentication or access restrictions if it holds unreleased work.
Common mistakes
Forgetting to tick Deployment slot setting, so a test database setting is swapped into production. Testing the wrong address. Leaving the plan on a paid tier afterwards.

Clean up

  1. app-practice
  2. Deployment slots

Delete the staging slot, then scale the plan back to Free F1 or delete the resource group. Free can't keep slots, so delete them first.

Words to know

Deployment slot
A live copy of an app with its own address, used for testing and swapping.
Swap
Exchanging the contents of two slots, so the tested version becomes production.
Slot setting
A setting that stays with its slot during a swap instead of moving with the code.

Tick off each step and track your progress in the guide.

Open this task in Azure Portal, Hands On

Keep going