Question

Difficulty: MediumCreate and Configure Azure Functions

You are deploying updates to an Azure Function App (V4 runtime) running on an Elastic Premium hosting plan. The function app connects to an Azure SQL Database.

You must implement a deployment process that meets the following requirements:
- Updates must be tested in a staging environment before being routed to production.
- Zero downtime must occur during the deployment transition.
- The staging and production environments must use different database connection strings.
- Database connection strings must not be swapped when the update goes live.

You need to configure the deployment slots and perform the deployment.

Which sequence of actions should you perform? To answer, move all actions from the list of actions to the answer area and arrange them in the correct order.

  1. 1Create a deployment slot named staging under the Function App.
  2. 2Define the database connection string application setting in both slots and configure it as a deployment slot setting.
  3. 3Deploy the updated function code to the staging slot.
  4. 4Verify the function behavior and warm up the instance in the staging slot.
  5. 5Swap the staging slot with the production slot.

Answer

First, create a deployment slot named staging under the Function App. Second, define the database connection string application setting in both slots and configure it as a deployment slot setting. Third, deploy the updated function code to the staging slot. Fourth, verify the function behavior and warm up the instance in the staging slot. Finally, swap the staging slot with the production slot.
The correct sequence begins with creating the staging deployment slot, then marking the connection string setting as a deployment slot setting (sticky) to prevent it from swapping. Next, the updated function code is deployed to the staging slot and verified/warmed up. Finally, the staging slot is swapped with production, achieving a zero-downtime release with slot-specific database connections intact.

Step-by-Step Solution

1
Create the staging deployment slot.
An isolated staging slot environment is established under the Function App.
This establishes the target environment for the staging deployments and configurations.
2
Configure the connection string setting as a deployment slot setting.
The setting is marked as 'sticky' to the slot.
Marking it as a deployment slot setting ensures the database connection strings are not swapped when slot swap occurs, keeping each slot connected to its correct database.
3
Deploy the updated function code to the staging slot.
The staging slot runs the new version of the function.
Deploying to the staging slot first prevents immediate exposure of unverified code to production users.
4
Verify behavior and warm up the function.
The staging instances are initialized and verified.
Warming up the instances prevents cold-start latency when traffic is switched, and verification ensures the code functions correctly under staging settings.
5
Swap the staging slot with the production slot.
Production traffic is routed to the new code, while the database connection strings remain in their respective slots.
Swapping the slots updates the production environment with zero downtime.

Key Concept

Azure Functions deployment slots configuration and swap process
Rate this question