Skip to content

Commit b55535e

Browse files
Merge pull request #299439 from TimShererWithAquent/us424061-15
Freshness Edit: Azure Functions (15 of several)
2 parents fd15a69 + 3d9b58a commit b55535e

File tree

3 files changed

+31
-31
lines changed

3 files changed

+31
-31
lines changed

articles/azure-functions/functions-deployment-slots.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
---
22
title: Azure Functions deployment slots
3-
description: Learn to create and use deployment slots with Azure Functions
3+
description: Learn to create and use deployment slots with Azure Functions by using the Azure portal or with Azure CLI.
44
ms.topic: conceptual
5-
ms.date: 02/27/2024
5+
ms.date: 05/07/2025
66
---
77
# Azure Functions deployment slots
88

9-
Azure Functions deployment slots allow your function app to run different instances called _slots_. Slots are different environments exposed via a publicly available endpoint. One app instance is always mapped to the production slot, and you can swap instances assigned to a slot on demand.
9+
Azure Functions deployment slots allow your function app to run different instances called *slots*. Slots are different environments exposed by using a publicly available endpoint. One app instance is always mapped to the production slot, and you can swap instances assigned to a slot on demand.
1010

1111
The number of available slots depends on your specific hosting option:
1212

1313
| Hosting option | Slots (including production) |
14-
| ---- | ---- |
14+
| ---- | ---- |
1515
| [Consumption plan](consumption-plan.md) | 2 |
1616
| [Flex Consumption plan](flex-consumption-plan.md) | Not currently supported |
1717
| [Premium plan](functions-premium-plan.md) | 3 |
1818
| [Dedicated (App Service) plan](dedicated-plan.md) | [1-20](../azure-resource-manager/management/azure-subscription-service-limits.md#azure-app-service-limits) |
1919
| [Container Apps](functions-container-apps-hosting.md) | Uses [Revisions](../container-apps/revisions.md) |
2020

21-
22-
The following reflect how functions are affected by swapping slots:
21+
The following descriptions reflect how functions are affected by swapping slots:
2322

2423
- Traffic redirection is seamless; no requests are dropped because of a swap. This seamless behavior occurs because the next function trigger is routed to the swapped slot.
2524
- Currently executing function are terminated during the swap. To learn how to write stateless and defensive functions, see [Improve the performance and reliability of Azure Functions](performance-reliability.md#write-functions-to-be-stateless).
@@ -31,16 +30,17 @@ There are many advantages to using deployment slots, including:
3130
- **Different environments for different purposes**: Using different slots gives you the opportunity to differentiate app instances before swapping to production or a staging slot.
3231
- **Prewarming**: Deploying to a slot instead of directly to production allows the app to warm up before going live. Additionally, using slots reduces latency for HTTP-triggered workloads. Instances are warmed up before deployment, which reduces the cold start for newly deployed functions.
3332
- **Easy fallbacks**: After a swap with production, the slot with a previously staged app now has the previous production app. If the changes swapped into the production slot aren't as you expect, you can immediately reverse the swap to get your "last known good instance" back.
34-
- **Minimize restarts**: Changing app settings in a production slot requires a restart of the running app. You can instead change settings in a staging slot and swap the settings change into production with a prewarmed instance. Slots are the recommended way to migrate between Functions runtime versions while maintaining the highest availability. To learn more, see [Minimum downtime update](migrate-version-3-version-4.md#minimum-downtime-update).
33+
- **Minimize restarts**: Changing app settings in a production slot requires a restart of the running app. You can instead change settings in a staging slot and swap the settings change into production with a prewarmed instance. Slots are the recommended way to migrate between Functions runtime versions while maintaining the highest availability. To learn more, see [Minimum downtime update](migrate-version-3-version-4.md#minimum-downtime-update).
3534

3635
## Swap operations
3736

3837
During a swap, one slot is considered the source and the other is the target. The source slot has the instance of the application that is applied to the target slot. The following steps ensure the target slot doesn't experience downtime during a swap:
3938

4039
1. **Apply settings:** Settings from the target slot are applied to all instances of the source slot. For example, the production settings are applied to the staging instance. The applied settings include the following categories:
41-
- [Slot-specific](#manage-settings) app settings and connection strings (if applicable)
42-
- [Continuous deployment](../app-service/deploy-continuous-deployment.md) settings (if enabled)
43-
- [App Service authentication](../app-service/overview-authentication-authorization.md) settings (if enabled)
40+
41+
- [Slot-specific](#manage-settings) app settings and connection strings (if applicable)
42+
- [Continuous deployment](../app-service/deploy-continuous-deployment.md) settings (if enabled)
43+
- [App Service authentication](../app-service/overview-authentication-authorization.md) settings (if enabled)
4444

4545
1. **Wait for restarts and availability:** The swap waits for every instance in the source slot to complete its restart and to be available for requests. If any instance fails to restart, the swap operation reverts all changes to the source slot and stops the operation.
4646

@@ -56,7 +56,7 @@ Keep in mind the following points:
5656

5757
- Settings related to event sources and bindings must be configured as [deployment slot settings](#manage-settings) *before you start a swap*. Marking them as "sticky" ahead of time ensures events and outputs are directed to the proper instance.
5858

59-
- When you create a new staging slot, all existing settings from the production slot are created in the new slot, regardless of the *stickiness* of the setting.
59+
- When you create a new staging slot, all existing settings from the production slot are created in the new slot, regardless of the *stickiness* of the setting.
6060

6161
## Manage settings
6262

@@ -89,32 +89,32 @@ Some configuration settings are slot-specific. The following lists detail which
8989
Features marked with an asterisk (*) don't get swapped, by design.
9090

9191
> [!NOTE]
92-
> Certain app settings that apply to unswapped settings are also not swapped. For example, since diagnostic settings are not swapped, related app settings like `WEBSITE_HTTPLOGGING_RETENTION_DAYS` and `DIAGNOSTICS_AZUREBLOBRETENTIONDAYS` are also not swapped, even if they don't show up as slot settings.
92+
> Certain app settings that apply to unswapped settings are also not swapped. For example, since diagnostic settings aren't swapped, related app settings like `WEBSITE_HTTPLOGGING_RETENTION_DAYS` and `DIAGNOSTICS_AZUREBLOBRETENTIONDAYS` are also not swapped, even if they don't show up as slot settings.
9393
>
9494
9595
### Create a deployment setting
9696

97-
You can mark settings as a deployment setting, which makes it _sticky_. A sticky setting doesn't swap with the app instance.
97+
You can mark settings as a deployment setting, which makes it *sticky*. A sticky setting doesn't swap with the app instance.
9898

9999
If you create a deployment setting in one slot, make sure to create the same setting with a unique value in any other slot that is involved in a swap. This way, while a setting's value doesn't change, the setting names remain consistent among slots. This name consistency ensures your code doesn't try to access a setting that is defined in one slot but not another.
100100

101101
Use the following steps to create a deployment setting:
102102

103103
1. Navigate to **Deployment slots** in the function app, and then select the slot name.
104104

105-
:::image type="content" source="./media/functions-deployment-slots/functions-navigate-slots.png" alt-text="Find slots in the Azure portal." border="true":::
105+
:::image type="content" source="./media/functions-deployment-slots/functions-navigate-slots.png" alt-text="Screenshot shows the deployments slots in the Azure portal." border="true":::
106106

107107
1. Select **Configuration**, and then select the setting name you want to stick with the current slot.
108108

109-
:::image type="content" source="./media/functions-deployment-slots/functions-configure-deployment-slot.png" alt-text="Configure the application setting for a slot in the Azure portal." border="true":::
109+
:::image type="content" source="./media/functions-deployment-slots/functions-configure-deployment-slot.png" alt-text="Screenshot shows where to configure the application setting for a slot in the Azure portal." border="true":::
110110

111111
1. Select **Deployment slot setting**, and then select **OK**.
112112

113-
:::image type="content" source="./media/functions-deployment-slots/functions-deployment-slot-setting.png" alt-text="Configure the deployment slot setting." border="true":::
113+
:::image type="content" source="./media/functions-deployment-slots/functions-deployment-slot-setting.png" alt-text="Screenshot shows where to configure the deployment slot setting." border="true":::
114114

115115
1. Once setting section disappears, select **Save** to keep the changes
116116

117-
:::image type="content" source="./media/functions-deployment-slots/functions-save-deployment-slot-setting.png" alt-text="Save the deployment slot setting." border="true":::
117+
:::image type="content" source="./media/functions-deployment-slots/functions-save-deployment-slot-setting.png" alt-text="Screenshot shows how to save the deployment slot setting." border="true":::
118118

119119
## Deployment
120120

@@ -137,8 +137,8 @@ Use these steps to create a new slot in the portal:
137137

138138
1. Navigate to your function app.
139139

140-
1. Select **Deployment slots** and the existing slots are shown.
141-
140+
1. Select **Deployment slots** and the existing slots are shown.
141+
142142
### [Azure CLI](#tab/azure-cli)
143143

144144
Run this [az functionapp deployment slot list](/cli/azure/functionapp/deployment/slot#az-functionapp-deployment-slot-list) command to list the existing slots in your function app:
@@ -161,11 +161,11 @@ Use these steps to create a slot in the portal:
161161

162162
1. Select **Deployment slots**, and then select **+ Add Slot**.
163163

164-
:::image type="content" source="./media/functions-deployment-slots/functions-deployment-slots-add.png" alt-text="Add Azure Functions deployment slot." border="true":::
164+
:::image type="content" source="./media/functions-deployment-slots/functions-deployment-slots-add.png" alt-text="Screenshot shows adding an Azure Functions deployment slot." border="true":::
165165

166166
1. Type the name of the slot and select **Add**.
167167

168-
:::image type="content" source="./media/functions-deployment-slots/functions-deployment-slots-add-name.png" alt-text="Name the Azure Functions deployment slot." border="true":::
168+
:::image type="content" source="./media/functions-deployment-slots/functions-deployment-slots-add-name.png" alt-text="Screenshot shows naming the Azure Functions deployment slot." border="true":::
169169

170170
### [Azure CLI](#tab/azure-cli)
171171

@@ -183,7 +183,7 @@ You access resources (HTTP triggers and administrator endpoints) in a staging sl
183183

184184
## Swap slots
185185

186-
You can swap slots in an out of production using either the [Azure CLI](/cli/azure) or through the [Azure portal](https://portal.azure.com).
186+
You can swap slots in an out of production using either the [Azure CLI](/cli/azure) or through the [Azure portal](https://portal.azure.com).
187187

188188
### [Azure portal](#tab/azure-portal)
189189

@@ -195,9 +195,9 @@ Use these steps to swap a staging slot into production:
195195

196196
:::image type="content" source="./media/functions-deployment-slots/functions-swap-deployment-slot.png" alt-text="Screenshot that shows the 'Deployment slot' page with the 'Add Slot' action selected." border="true":::
197197

198-
1. Verify the configuration settings for your swap and select **Swap**
198+
1. Verify the configuration settings for your swap and select **Swap**.
199199

200-
:::image type="content" source="./media/functions-deployment-slots/azure-functions-deployment-slots-swap-config.png" alt-text="Swap the deployment slot." border="true":::
200+
:::image type="content" source="./media/functions-deployment-slots/azure-functions-deployment-slots-swap-config.png" alt-text="Screenshot showing swapping the deployment slot." border="true":::
201201

202202
The swap operation can take a few seconds.
203203

@@ -207,7 +207,7 @@ Run this [az functionapp deployment slot swap](/cli/azure/functionapp/deployment
207207

208208
```azurecli
209209
az functionapp deployment slot swap --name "<APP_NAME>" --resource-group "<RESOURCE_GROUP>" --slot staging --target-slot production
210-
```
210+
```
211211
---
212212

213213
## Roll back a swap
@@ -216,27 +216,27 @@ If a swap results in an error or you simply want to "undo" a swap, you can roll
216216

217217
## Remove a slot
218218

219-
You can remove a slot using either the [Azure CLI](/cli/azure) or through the [Azure portal](https://portal.azure.com).
219+
You can remove a slot using either the [Azure CLI](/cli/azure) or through the [Azure portal](https://portal.azure.com).
220220

221221
### [Azure portal](#tab/azure-portal)
222222

223223
Use these steps to remove a slot from your app in the portal:
224224

225225
1. Navigate to **Deployment slots** in the function app, and then select the slot name.
226226

227-
:::image type="content" source="./media/functions-deployment-slots/functions-navigate-slots.png" alt-text="Find slots in the Azure portal." border="true":::
227+
:::image type="content" source="./media/functions-deployment-slots/functions-navigate-slots.png" alt-text="Screenshot show the page where you find slots in the Azure portal." border="true":::
228228

229229
1. Select **Delete**.
230230

231231
:::image type="content" source="./media/functions-deployment-slots/functions-delete-deployment-slot.png" alt-text="Screenshot that shows the 'Overview' page with the 'Delete' action selected." border="true":::
232232

233233
1. Type the name of the deployment slot you want to delete, and then select **Delete**.
234234

235-
:::image type="content" source="./media/functions-deployment-slots/functions-delete-deployment-slot-details.png" alt-text="Delete the deployment slot in the Azure portal." border="true":::
235+
:::image type="content" source="./media/functions-deployment-slots/functions-delete-deployment-slot-details.png" alt-text="Screenshot shows deleting the deployment slot in the Azure portal." border="true":::
236236

237237
1. Close the confirmation pane.
238238

239-
:::image type="content" source="./media/functions-deployment-slots/functions-deployment-slot-deleted.png" alt-text="Deployment slot delete confirmation." border="true":::
239+
:::image type="content" source="./media/functions-deployment-slots/functions-deployment-slot-deleted.png" alt-text="Screenshot shows the deployment slot deletion confirmation." border="true":::
240240

241241
### [Azure CLI](#tab/azure-cli)
242242

@@ -259,13 +259,13 @@ Use the following steps to change a slot's App Service plan:
259259

260260
1. Navigate to **Deployment slots** in the function app, and then select the slot name.
261261

262-
:::image type="content" source="./media/functions-deployment-slots/functions-navigate-slots.png" alt-text="Find slots in the Azure portal." border="true":::
262+
:::image type="content" source="./media/functions-deployment-slots/functions-navigate-slots.png" alt-text="Screenshot shows the slots in the Azure portal." border="true":::
263263

264264
1. Under **App Service plan**, select **Change App Service plan**.
265265

266266
1. Select the plan you want to upgrade to, or create a new plan.
267267

268-
:::image type="content" source="./media/functions-deployment-slots/azure-functions-deployment-slots-change-app-service-apply.png" alt-text="Change the App Service plan in the Azure portal." border="true":::
268+
:::image type="content" source="./media/functions-deployment-slots/azure-functions-deployment-slots-change-app-service-apply.png" alt-text="Screenshot shows where to change the App Service plan in the Azure portal." border="true":::
269269

270270
1. Select **OK**.
271271

Loading
-1.34 KB
Loading

0 commit comments

Comments
 (0)