0
0
Azurecloud~30 mins

Deployment slots for staging in Azure - Mini Project: Build & Apply

Choose your learning style9 modes available
Deployment Slots for Staging
📖 Scenario: You work for a company that wants to deploy a web app on Azure. They want to test new versions safely before making them live. To do this, they use deployment slots. A deployment slot is like a separate space where you can deploy your app version and test it without affecting the live app.In this project, you will create an Azure App Service with a production slot and add a staging slot for testing.
🎯 Goal: Create an Azure App Service resource with a production slot and add a deployment slot named staging. Configure the staging slot with the same settings as production.
📋 What You'll Learn
Create an Azure App Service resource named exactly myAppService.
Add a deployment slot named exactly staging to myAppService.
Configure the staging slot with the same app service plan as myAppService.
Ensure the deployment slot is ready for deployment testing.
💡 Why This Matters
🌍 Real World
Deployment slots let developers test new app versions safely before making them live, reducing downtime and errors.
💼 Career
Understanding deployment slots is essential for cloud engineers and DevOps professionals managing Azure App Services.
Progress0 / 4 steps
1
Create the Azure App Service resource
Write an Azure Resource Manager (ARM) template snippet to create an Microsoft.Web/sites resource named myAppService with a basic app service plan myAppServicePlan. Include the kind property set to app and set the location to eastus.
Azure
Need a hint?

Use the Microsoft.Web/sites resource type with name set to myAppService. Set kind to app and location to eastus. Use serverFarmId property to link the app service plan.

2
Add a deployment slot configuration
Add a new resource of type Microsoft.Web/sites/slots named staging under the myAppService resource. Set its location to eastus and link it to the same app service plan myAppServicePlan.
Azure
Need a hint?

Use the resource type Microsoft.Web/sites/slots with the name format myAppService/staging. Set the location and serverFarmId same as the main app.

3
Configure the staging slot settings
Add a siteConfig property to the staging slot resource. Set alwaysOn to true inside siteConfig to keep the slot always running.
Azure
Need a hint?

Inside the properties of the staging slot, add siteConfig with "alwaysOn": true to keep the slot active.

4
Complete the ARM template with both resources
Wrap both the myAppService and staging slot resources inside a JSON array named resources in the ARM template. This completes the deployment template for the app service with a staging slot.
Azure
Need a hint?

Put both resource objects inside a resources array to form a valid ARM template structure.