Question

Difficulty: MediumConfigure Azure App Services

You have an Azure App Service web app named WebApp1 that is hosted on a Standard (S1) App Service plan. WebApp1 has a production slot and a deployment slot named Staging. You need to configure the deployment slots to meet the following requirements:
- The database connection string must always point to the production database for the production slot, and to the staging database for the Staging slot, even after a slot swap is performed.
- A subset of users must be automatically routed to the Staging slot without requiring manual URL changes or custom cookies.

Which two configuration actions should you perform? (Select two.)

  1. Select the Deployment slot setting option for the database connection string in both slots.Answer
  2. In the Deployment slots blade of the web app, set the Traffic % value of the Staging slot to a non-zero percentage.Answer
  3. C
    Configure the database connection string as a standard App Setting without selecting the Deployment slot setting option.
  4. D
    Upgrade the App Service plan to the Premium (P1v3) tier to enable slot traffic routing.
  5. E
    Create a custom path-based routing rule in an Azure Application Gateway to distribute traffic between the slots.

Answer

To meet the requirements, you must select the Deployment slot setting option for the database connection string in both slots, and set the Traffic % value of the Staging slot to a non-zero percentage in the Deployment slots blade of the web app.
Selecting the Deployment slot setting option ensures that the connection string remains with its respective slot and does not swap during a deployment slot swap. Setting the Traffic % value of the Staging slot to a non-zero percentage utilizes the native App Service routing capability to automatically distribute a percentage of production traffic to the Staging slot.

Step-by-Step Solution

1
Open the configuration settings for the database connection string in both the production and Staging slots.
The connection string configuration settings are displayed.
This allows you to modify the behavior of the connection string during slot swaps.
2
Select the Deployment slot setting checkbox for the connection string in both slots.
The connection string becomes 'sticky' to its respective slot.
This prevents the connection string from being swapped, ensuring each slot maintains its connection to its target database.
3
Navigate to the Deployment slots blade of the web app and set the Traffic % column for the Staging slot to the desired percentage.
Azure automatically routes the specified percentage of user requests to the Staging slot.
This implements the 'testing in production' feature to automatically distribute user traffic without manual client changes.

Key Concept

Azure App Service deployment slot settings (sticky settings) and slot traffic routing
Estimated Time:1m 30s
Rate this question