Designing and Implementing Microsoft DevOps Solutions: AZ-400 Exam | Rolling Upgrades for Azure Web App

Implementing Rolling Upgrades for Azure Web App

Question

SIMULATION -

You need to ensure that an Azure web app named az400-9940427-main supports rolling upgrades. The solution must ensure that only 10 percent of users who connect to az400-9940427-main use update versions of the app.

The solution must minimize administrative effort.

To complete this task, sign in to the Microsoft Azure portal.

Explanations

See explanation below.

Set up staging environments in Azure App Service

1. Open Microsoft Azure Portal

2. Log into your Azure account, select your app's resource page, in the left pane, select Deployment slots > Add Slot.

3. In the Add a slot dialog box, give the slot a name, and select whether to clone an app configuration from another deployment slot. Select Add to continue.

4. After the slot is added, select Close to close the dialog box. The new slot is now shown on the Deployment slots page. By default, Traffic % is set to 0 for the new slot, with all customer traffic routed to the production slot.

5. Select the new deployment slot to open that slot's resource page.

6. Change TRAFFIC % to 10

https://docs.microsoft.com/en-us/azure/app-service/deploy-staging-slots

To enable rolling upgrades for an Azure Web App, we can use Deployment Slots, which allow us to deploy and test changes to the app without affecting the production environment. Deployment Slots enable us to swap a new version of the app into production by swapping the contents of the staging slot with the production slot.

Here are the steps to configure rolling upgrades with deployment slots:

  1. Create a deployment slot:

Navigate to the Azure Portal and open the web app that needs to support rolling upgrades (az400-9940427-main). Select the "Deployment Slots" option from the left-hand menu, and click the "Add Slot" button to create a new slot. Give the slot a name (e.g. "staging") and configure any necessary settings.

  1. Deploy a new version of the app to the staging slot:

Deploy a new version of the app to the staging slot by deploying the updated code to the new slot, using tools like Azure DevOps or GitHub Actions.

  1. Test the new version of the app:

Once the new version of the app is deployed to the staging slot, test it to make sure it is working as expected.

  1. Swap the staging slot with the production slot:

Once the new version of the app is tested and ready to go, swap the staging slot with the production slot. This will bring the new version of the app into production, while the previous version of the app will be moved to the staging slot.

  1. Configure traffic routing:

Configure traffic routing to ensure that only 10 percent of users who connect to az400-9940427-main use updated versions of the app. To do this, we can use Azure Traffic Manager, which can be configured to route traffic based on percentage-based traffic routing rules.

To set up Traffic Manager, create a new Traffic Manager profile and add the web app as an endpoint. Then, configure traffic routing rules to route traffic to the staging slot based on the desired percentage. For example, we can set a traffic routing rule to route 10 percent of traffic to the staging slot, and the remaining 90 percent to the production slot.

By using deployment slots and Traffic Manager, we can ensure that rolling upgrades are supported for the web app, while minimizing administrative effort.