capabilities.work

Preview and Swap a Slot Into Production

A 3-step recipe with Microsoft Azure Functions. We can help you get access.

Recipe · 3 steps

Preview and Swap a Slot Into Production

Preview slot differences, swap the slot, and confirm the app is running.

  1. Compute the configuration differences between the source slot and the target slot so the caller can review what the swap will change.
  2. Swap the source slot into the target slot. ARM returns 202 when the swap is accepted as a long-running operation.
  3. Read the function app and confirm it reports a Running state after the swap. Use this step in a retry loop until the swap operation completes.
What you'll need to have ready
  • subscriptionId: The Azure subscription identifier (GUID).
  • resourceGroupName: The resource group that contains the function app.
  • name: The name of the function app.
  • slot: The source slot to swap from (e.g. "staging").
  • targetSlot: The target slot to swap into (e.g. "production").
  • preserveVnet: Whether to preserve the VNet configuration through the swap.
  • apiVersion: The ARM api-version to use for all requests.
For your developer

Arazzo workflow microsoft-azure-functions:swap-slot-to-production, 3 operations: WebApps_ListSlotDifferencesSlot → WebApps_SwapSlotSlot → WebApps_Get. Specs on APIs.io.