Skip to content

Commit be09e05

Browse files
Merge pull request #258979 from ggailey777/upgrade-all-langs
[Functions] Expand worker update article to all languages
2 parents 195b7c1 + a418661 commit be09e05

14 files changed

+412
-162
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9622,6 +9622,11 @@
96229622
"redirect_url": "/azure/azure-functions/functions-reference-python?pivots=python-mode-decorators#triggers-and-inputs",
96239623
"redirect_document_id": false
96249624
},
9625+
{
9626+
"source_path_from_root": "/articles/azure-functions/update-java-versions.md",
9627+
"redirect_url": "/azure/azure-functions/update-language-versions",
9628+
"redirect_document_id": false
9629+
},
96259630
{
96269631
"source_path_from_root": "/articles/azure-government/documentation-government-k8.md",
96279632
"redirect_url": "/azure/azure-government",

articles/azure-functions/TOC.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,8 +568,9 @@
568568
items:
569569
- name: Migrate to model v4.x
570570
href: functions-node-upgrade-v4.md
571-
- name: Update Java versions
572-
href: update-java-versions.md
571+
- name: Update language versions
572+
href: update-language-versions.md
573+
displayName: upgrade, migrate, language stack
573574
- name: Monitor
574575
items:
575576
- name: Monitor function apps with Azure Monitor

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

Lines changed: 83 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@ ms.date: 03/02/2022
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. Function apps running under the Apps Service plan may have multiple slots, while under the Consumption plan only one slot is allowed.
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. Function apps running in a [Consumption plan](./consumption-plan.md) have a single extra slot for staging. You can obtain more staging slots by running your app in a [Premium plan](./functions-premium-plan.md) or [Dedicated (App Service) plan](./dedicated-plan.md). For more information, see [Service limits](./functions-scale.md#service-limits).
1010

1111
The following reflect how functions are affected by swapping slots:
1212

13-
- Traffic redirection is seamless; no requests are dropped because of a swap. This seamless behavior is a result of the next function triggers being routed to the swapped slot.
14-
- Currently executing function are terminated during the swap. Please review [Improve the performance and reliability of Azure Functions](performance-reliability.md#write-functions-to-be-stateless) to learn how to write stateless and defensive functions.
13+
- 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.
14+
- 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).
1515

1616
## Why use slots?
1717

18-
There are a number of advantages to using deployment slots. The following scenarios describe common uses for slots:
18+
There are many advantages to using deployment slots, including:
1919

2020
- **Different environments for different purposes**: Using different slots gives you the opportunity to differentiate app instances before swapping to production or a staging slot.
2121
- **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.
2222
- **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.
23-
- **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. This is the recommended way to upgrade between Functions runtime versions while maintaining the highest availability. To learn more, see [Minimum downtime upgrade](migrate-version-3-version-4.md#minimum-downtime-upgrade).
23+
- **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 upgrade between Functions runtime versions while maintaining the highest availability. To learn more, see [Minimum downtime upgrade](migrate-version-3-version-4.md#minimum-downtime-upgrade).
2424

2525
## Swap operations
2626

27-
During a swap, one slot is considered the source and the other 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:
27+
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:
2828

2929
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:
3030
- [Slot-specific](#manage-settings) app settings and connection strings (if applicable)
@@ -33,9 +33,9 @@ During a swap, one slot is considered the source and the other the target. The s
3333

3434
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.
3535

36-
1. **Update routing:** If all instances on the source slot are warmed up successfully, the two slots complete the swap by switching routing rules. After this step, the target slot (for example, the production slot) has the app that's previously warmed up in the source slot.
36+
1. **Update routing:** If all instances on the source slot are warmed up successfully, the two slots complete the swap by switching routing rules. After this step, the target slot (for example, the production slot) has the app that was previously warmed up in the source slot.
3737

38-
1. **Repeat operation:** Now that the source slot has the pre-swap app previously in the target slot, complete the same operation by applying all settings and restarting the instances for the source slot.
38+
1. **Repeat operation:** Now that the source slot has the preswap app previously in the target slot, complete the same operation by applying all settings and restarting the instances for the source slot.
3939

4040
Keep in mind the following points:
4141

@@ -53,7 +53,7 @@ Some configuration settings are slot-specific. The following lists detail which
5353

5454
- Publishing endpoints
5555
- Custom domain names
56-
- Non-public certificates and TLS/SSL settings
56+
- Nonpublic certificates and TLS/SSL settings
5757
- Scale settings
5858
- IP restrictions
5959
- Always On
@@ -73,15 +73,15 @@ Some configuration settings are slot-specific. The following lists detail which
7373
- Service endpoints *
7474
- Azure Content Delivery Network *
7575

76-
Features marked with an asterisk (*) are planned to be unswapped.
76+
Features marked with an asterisk (*) don't get swapped, by design.
7777

7878
> [!NOTE]
7979
> 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.
8080
>
8181
8282
### Create a deployment setting
8383

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

8686
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.
8787

@@ -114,9 +114,35 @@ All slots scale to the same number of workers as the production slot.
114114
- For Consumption plans, the slot scales as the function app scales.
115115
- For App Service plans, the app scales to a fixed number of workers. Slots run on the same number of workers as the app plan.
116116

117+
## View slots
118+
119+
You can view information about existing slots using either the [Azure CLI](/cli/azure) or through the [Azure portal](https://portal.azure.com).
120+
121+
### [Azure portal](#tab/azure-portal)
122+
123+
Use these steps to create a new slot in the portal:
124+
125+
1. Navigate to your function app.
126+
127+
1. Select **Deployment slots** and the existing slots are shown.
128+
129+
### [Azure CLI](#tab/azure-cli)
130+
131+
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:
132+
133+
```azurecli
134+
az functionapp deployment slot list --name "<APP_NAME>" --resource-group "<RESOURCE_GROUP>"
135+
```
136+
137+
---
138+
117139
## Add a slot
118140

119-
You can add a slot via the [CLI](/cli/azure/functionapp/deployment/slot#az-functionapp-deployment-slot-create) or through the portal. The following steps demonstrate how to create a new slot in the portal:
141+
You can add a slot using either the [Azure CLI](/cli/azure) or through the [Azure portal](https://portal.azure.com).
142+
143+
### [Azure portal](#tab/azure-portal)
144+
145+
Use these steps to create a slot in the portal:
120146

121147
1. Navigate to your function app.
122148

@@ -128,11 +154,30 @@ You can add a slot via the [CLI](/cli/azure/functionapp/deployment/slot#az-funct
128154

129155
:::image type="content" source="./media/functions-deployment-slots/functions-deployment-slots-add-name.png" alt-text="Name the Azure Functions deployment slot." border="true":::
130156

157+
### [Azure CLI](#tab/azure-cli)
158+
159+
Run the [az functionapp deployment slot create](/cli/azure/functionapp/deployment/slot#az-functionapp-deployment-slot-create) command to create a slot named `staging` in your function app:
160+
161+
```azurecli
162+
az functionapp deployment slot create --name "<APP_NAME>" --resource-group "<RESOURCE_GROUP>" --slot staging
163+
```
164+
165+
---
166+
167+
## Access slot resources
168+
169+
You access resources (HTTP triggers and administrator endpoints) in a staging slot in the same way as the production slot. However, instead of the function app host name you use the slot-specific host name in the request URL, along with any slot-specific keys. Because staging slots are live apps, you must [secure your functions](./security-concepts.md) in a staging slot as you would in the production slot.
170+
131171
## Swap slots
132172

133-
You can swap slots via the [CLI](/cli/azure/functionapp/deployment/slot#az-functionapp-deployment-slot-swap) or through the portal. The following steps demonstrate how to swap slots in the portal:
173+
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).
174+
175+
### [Azure portal](#tab/azure-portal)
176+
177+
Use these steps to swap a staging slot into production:
134178

135179
1. Navigate to the function app.
180+
136181
1. Select **Deployment slots**, and then select **Swap**.
137182

138183
:::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":::
@@ -141,15 +186,28 @@ You can swap slots via the [CLI](/cli/azure/functionapp/deployment/slot#az-funct
141186

142187
:::image type="content" source="./media/functions-deployment-slots/azure-functions-deployment-slots-swap-config.png" alt-text="Swap the deployment slot." border="true":::
143188

144-
The operation may take a moment while the swap operation is executing.
189+
The swap operation can take a few seconds.
190+
191+
### [Azure CLI](#tab/azure-cli)
192+
193+
Run this [az functionapp deployment slot swap](/cli/azure/functionapp/deployment/slot#az-functionapp-deployment-slot-swap) command to swap between a slot named `staging` and the production slot in your function app:
194+
195+
```azurecli
196+
az functionapp deployment slot swap --name "<APP_NAME>" --resource-group "<RESOURCE_GROUP>" --slot staging --target-slot production
197+
```
198+
---
145199

146200
## Roll back a swap
147201

148-
If a swap results in an error or you simply want to "undo" a swap, you can roll back to the initial state. To return to the pre-swapped state, do another swap to reverse the swap.
202+
If a swap results in an error or you simply want to "undo" a swap, you can roll back to the initial state. To return to the preswapped state, do another swap to reverse the swap.
149203

150204
## Remove a slot
151205

152-
You can remove a slot via the [CLI](/cli/azure/functionapp/deployment/slot#az-functionapp-deployment-slot-delete) or through the portal. The following steps demonstrate how to remove a slot in the portal:
206+
You can remove a slot using either the [Azure CLI](/cli/azure) or through the [Azure portal](https://portal.azure.com).
207+
208+
### [Azure portal](#tab/azure-portal)
209+
210+
Use these steps to remove a slot from your app in the portal:
153211

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

@@ -163,19 +221,19 @@ You can remove a slot via the [CLI](/cli/azure/functionapp/deployment/slot#az-fu
163221

164222
:::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":::
165223

166-
1. Close the delete confirmation pane.
224+
1. Close the confirmation pane.
167225

168226
:::image type="content" source="./media/functions-deployment-slots/functions-deployment-slot-deleted.png" alt-text="Deployment slot delete confirmation." border="true":::
169227

170-
## Automate slot management
228+
### [Azure CLI](#tab/azure-cli)
229+
230+
Run the [az functionapp deployment slot delete](/cli/azure/functionapp/deployment/slot#az-functionapp-deployment-slot-delete) command to remove a slot named `staging` from your function app:
171231

172-
Using the [Azure CLI](/cli/azure/functionapp/deployment/slot), you can automate the following actions for a slot:
232+
```azurecli
233+
az functionapp deployment slot delete --name "<APP_NAME>" --resource-group "<RESOURCE_GROUP>" --slot staging
234+
```
173235

174-
- [create](/cli/azure/functionapp/deployment/slot#az-functionapp-deployment-slot-create)
175-
- [delete](/cli/azure/functionapp/deployment/slot#az-functionapp-deployment-slot-delete)
176-
- [list](/cli/azure/functionapp/deployment/slot#az-functionapp-deployment-slot-list)
177-
- [swap](/cli/azure/functionapp/deployment/slot#az-functionapp-deployment-slot-swap)
178-
- [auto-swap](/cli/azure/functionapp/deployment/slot#az-functionapp-deployment-slot-auto-swap)
236+
---
179237

180238
## Change App Service plan
181239

@@ -202,7 +260,7 @@ Use the following steps to change a slot's App Service plan:
202260

203261
Azure Functions deployment slots have the following considerations:
204262

205-
- The number of slots available to an app depends on the plan. The Consumption plan is only allowed one deployment slot. Additional slots are available for apps running under other plans. For details, see [Service limits](functions-scale.md#service-limits).
263+
- The number of slots available to an app depends on the plan. The Consumption plan is only allowed one deployment slot. More slots are available for apps running under other plans. For details, see [Service limits](functions-scale.md#service-limits).
206264
- Swapping a slot resets keys for apps that have an `AzureWebJobsSecretStorageType` app setting equal to `files`.
207265
- When slots are enabled, your function app is set to read-only mode in the portal.
208266
- Use function app names shorter than 32 characters. Names longer than 32 characters are at risk of causing [host ID collisions](storage-considerations.md#host-id-considerations).

0 commit comments

Comments
 (0)