|
| 1 | +--- |
| 2 | +title: Enable deployment slots for zero downtime deployment |
| 3 | +description: Set up deployment slots to enable zero downtime deployment for Standard workflows in Azure Logic Apps. |
| 4 | +services: logic-apps |
| 5 | +ms.suite: integration |
| 6 | +ms.reviewer: estfan, wsilveira, azla |
| 7 | +ms.topic: how-to |
| 8 | +ms.date: 04/26/2024 |
| 9 | + |
| 10 | +#Customer intent: As a logic app developer, I want to set up deployment slots on my logic app resource so that I can deploy with zero downtime. |
| 11 | +--- |
| 12 | + |
| 13 | +# Set up deployment slots to enable zero downtime deployment in Azure Logic Apps (preview) |
| 14 | + |
| 15 | +[!INCLUDE [logic-apps-sku-standard](../../includes/logic-apps-sku-standard.md)] |
| 16 | + |
| 17 | +> [!NOTE] |
| 18 | +> This capability is in preview and is subject to the |
| 19 | +> [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/). |
| 20 | +
|
| 21 | +To deploy mission-critical logic apps that are always available and responsive, even during updates or maintenance, you can enable zero downtime deployment by creating and using deployment slots. Zero downtime means that when you deploy new versions of your app, end users shouldn't experience disruption or downtime. Deployment slots are isolated nonproduction environments that host different versions of your app and provide the following benefits: |
| 22 | + |
| 23 | +- Swap a deployment slot with your production slot without interruption. That way, you can update your logic app and workflows without affecting availability or performance. |
| 24 | + |
| 25 | +- Test and validate any changes in a deployment slot before you apply those changes to the production slot. |
| 26 | + |
| 27 | +- Roll back to a previous version, if anything goes wrong with your deployment. |
| 28 | + |
| 29 | +- Reduce the risk of negative performance when you must exceed the [recommended number of workflows per logic app](create-single-tenant-workflows-azure-portal.md#best-practices-and-recommendations). |
| 30 | + |
| 31 | +With deployment slots, you can achieve continuous delivery and improve your applications' quality and reliability. For more information about deployment slots in Azure and because Standard logic app workflows are based on Azure Functions extensibility, see [Azure Functions deployment slots](../azure-functions/functions-deployment-slots.md). |
| 32 | + |
| 33 | +:::image type="content" source="media/set-up-deployment-slots/overview.png" alt-text="Screenshot shows Azure portal, Standard logic app resource, and deployment slots page." lightbox="media/set-up-deployment-slots/overview.png"::: |
| 34 | + |
| 35 | +### Known issues and limitations |
| 36 | + |
| 37 | +- Nonproduction slots are created in read-only mode. |
| 38 | + |
| 39 | +- The nonproduction slots dispatcher is turned off, which means that workflows can only run when they're in the production slot. |
| 40 | + |
| 41 | +- Traffic distribution is disabled for deployment slots in Standard logic apps. |
| 42 | + |
| 43 | +- Deployment slots for Standard logic apps don't support the following scenarios: |
| 44 | + |
| 45 | + - Blue-green deployment |
| 46 | + - Product verification testing before slot swapping |
| 47 | + - A/B testing |
| 48 | + |
| 49 | +## Prerequisites |
| 50 | + |
| 51 | +- An Azure account and subscription. If you don't have a subscription, [sign up for a free Azure account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F). |
| 52 | + |
| 53 | +- To work in Visual Studio Code with the Azure Logic Apps (Standard) extension, you'll need to meet the prerequisites described in [Create Standard workflows with Visual Studio Code](create-single-tenant-workflows-visual-studio-code.md#prerequisites). You'll also need a Standard logic app project that you want to publish to Azure. |
| 54 | + |
| 55 | +- [Azure Logic Apps Standard Contributor role permissions](logic-apps-securing-a-logic-app.md?tabs=azure-portal#standard-workflows) |
| 56 | + |
| 57 | +- An existing Standard logic app resource in Azure where you want to create your deployment slot and deploy your changes. You can create an empty Standard logic app resource without any workflows. For more information, see [Create example Standard workflow in single-tenant Azure Logic Apps](create-single-tenant-workflows-azure-portal.md). |
| 58 | + |
| 59 | +## Create a deployment slot |
| 60 | + |
| 61 | +The following options are available for you to create a deployment slot: |
| 62 | + |
| 63 | +### [Portal](#tab/portal) |
| 64 | + |
| 65 | +1. In [Azure portal](https://portal.azure.com), open your Standard logic app resource where you want to create a deployment slot. |
| 66 | + |
| 67 | +1. On the resource menu, under **Deployment**, select **Deployment slots (Preview)**. |
| 68 | + |
| 69 | +1. On the toolbar, select **Add**. |
| 70 | + |
| 71 | +1. In the **Add Slot** pane, provide a name, which must be unique and uses only lowercase alphanumeric characters or hyphens (**-**), for your deployment slot. |
| 72 | + |
| 73 | + > [!NOTE] |
| 74 | + > |
| 75 | + > After creation, your deployment slot name uses the following format: <*logic-app-name-deployment-slot-name*>. |
| 76 | +
|
| 77 | +1. When you're done, select **Add**. |
| 78 | + |
| 79 | +### [Visual Studio Code](#tab/visual-studio-code) |
| 80 | + |
| 81 | +1. In Visual Studio Code, open the Standard logic app project that you want to deploy. |
| 82 | + |
| 83 | +1. Open the command palette. (Keyboard: Ctrl + Shift + P) |
| 84 | + |
| 85 | +1. From the command list, select **Azure Logic Apps: Create Slot**, and follow the prompts to provide the required information: |
| 86 | + |
| 87 | + 1. Enter and select the name for your Azure subscription. |
| 88 | + |
| 89 | + 1. Enter and select the name for your existing Standard logic app in Azure. |
| 90 | + |
| 91 | + 1. Enter a name, which must be unique and uses only lowercase alphanumeric characters or hyphens (**-**), for your deployment slot. |
| 92 | + |
| 93 | +### [Azure CLI](#tab/azure-cli) |
| 94 | + |
| 95 | +Run the following Azure CLI command: |
| 96 | + |
| 97 | +`az functionapp deployment slot create --name {logic-app-name} --resource-group {resource-group-name} --slot {slot-name}` |
| 98 | + |
| 99 | +To enable a system-assigned managed identity on your Standard logic app deployment slot, run the following Azure CLI command: |
| 100 | + |
| 101 | +`az functionapp identity assign --name {logic-app-name} --resource-group {resource-group-name} --slot {slot-name}` |
| 102 | + |
| 103 | +--- |
| 104 | + |
| 105 | +## Confirm deployment slot creation |
| 106 | + |
| 107 | +After you create the deployment slot, confirm that the slot exists on your deployed logic app resource. |
| 108 | + |
| 109 | +1. In the [Azure portal](https://portal.azure.com), open your Standard logic app resource. |
| 110 | + |
| 111 | +1. On the resource menu, under **Deployment**, select **Deployment slots (Preview)**. |
| 112 | + |
| 113 | +1. On the **Deployment slots** page, under **Deployment Slots (Preview)**, find and select your new deployment slot. |
| 114 | + |
| 115 | + > [!NOTE] |
| 116 | + > |
| 117 | + > After creation, your deployment slot name uses the following format: <*logic-app-name-deployment-slot-name*>. |
| 118 | +
|
| 119 | +## Deploy logic app changes to a deployment slot |
| 120 | + |
| 121 | +The following options are available for you to deploy logic app changes in a deployment slot: |
| 122 | + |
| 123 | +### [Portal](#tab/portal) |
| 124 | + |
| 125 | +Unavailable at this time. Please follow the steps for Visual Studio Code or Azure CLI to deploy your changes. |
| 126 | + |
| 127 | +### [Visual Studio Code](#tab/visual-studio-code) |
| 128 | + |
| 129 | +1. In Visual Studio Code, open the Standard logic app project that you want to deploy. |
| 130 | + |
| 131 | +1. Open the command palette. (Keyboard: Ctrl + Shift + P) |
| 132 | + |
| 133 | +1. From the command list, select **Azure Logic Apps: Deploy to Slot**, and follow the prompts to provide the required information: |
| 134 | + |
| 135 | + 1. Enter and select the name for your Azure subscription. |
| 136 | + |
| 137 | + 1. Enter and select the name for your existing Standard logic app in Azure. |
| 138 | + |
| 139 | + 1. Select the name for your deployment slot. |
| 140 | + |
| 141 | +1. In the message box that appears, confirm that you want to deploy the current code in your project to the selected slot by selecting **Deploy**. This action overwrites any existing content in the selected slot. |
| 142 | + |
| 143 | +1. After deployment completes, you can update any settings, if necessary, by selecting **Upload settings** in the message box that appears. |
| 144 | + |
| 145 | +### [Azure CLI](#tab/azure-cli) |
| 146 | + |
| 147 | +Run the following Azure CLI command: |
| 148 | + |
| 149 | +`az logicapp deployment source config-zip --name {logic-app-name} --resource-group {resource-group-name} --slot {slot-name} --src {deployment-package-local-path}` |
| 150 | + |
| 151 | +--- |
| 152 | + |
| 153 | +## Confirm deployment for your changes |
| 154 | + |
| 155 | +After you deploy your changes, confirm that the changes appear in your deployed logic app resource. |
| 156 | + |
| 157 | +1. In the [Azure portal](https://portal.azure.com), open your Standard logic app resource. |
| 158 | + |
| 159 | +1. On the resource menu, under **Deployment**, select **Deployment slots (Preview)**. |
| 160 | + |
| 161 | +1. On the **Deployment slots** page, under **Deployment Slots (Preview)**, find and select your deployment slot. |
| 162 | + |
| 163 | +1. On the resource menu, select **Overview**. On the **Notifications** tab, check whether any deployment issues exist, for example, errors that might happen during app startup or around slot swapping: |
| 164 | + |
| 165 | + :::image type="content" source="media/set-up-deployment-slots/deployment-slot-notifications.png" alt-text="Screenshot shows Azure portal, logic app deployment slot resource with Overview page, and selected Notifications tab." lightbox="media/set-up-deployment-slots/deployment-slot-notifications.png"::: |
| 166 | + |
| 167 | +1. To verify the changes in your workflow, under **Workflows**, select **Workflows**, and then select a workflow, which appears in read-only view. |
| 168 | + |
| 169 | +## Swap a deployment slot with the production slot |
| 170 | + |
| 171 | +The following options are available for you to swap a deployment slot with the current production slot: |
| 172 | + |
| 173 | +### [Portal](#tab/portal) |
| 174 | + |
| 175 | +1. In [Azure portal](https://portal.azure.com), open your Standard logic app resource where you want to swap slots. |
| 176 | + |
| 177 | +1. On the resource menu, under **Deployment**, select **Deployment slots (Preview)**. |
| 178 | + |
| 179 | +1. On the toolbar, select **Swap**. |
| 180 | + |
| 181 | +1. On the **Swap** pane, under **Source**, select the deployment slot that you want to activate. |
| 182 | + |
| 183 | +1. Under **Target**, select the production slot that you want to replace with the deployment slot. |
| 184 | + |
| 185 | + > [!NOTE] |
| 186 | + > |
| 187 | + > **Perform swap with preview** works only with logic apps that enabled deployment slot settings. |
| 188 | +
|
| 189 | +1. Under **Config Changes**, review the configuration changes for the source and target slots. |
| 190 | + |
| 191 | +1. When you're ready, select **Start Swap**. |
| 192 | + |
| 193 | +1. Wait for the operation to successfully complete. |
| 194 | + |
| 195 | +### [Visual Studio Code](#tab/visual-studio-code) |
| 196 | + |
| 197 | +1. In Visual Studio Code, open your Standard logic app project. |
| 198 | + |
| 199 | +1. Open the command palette. (Keyboard: Ctrl + Shift + P) |
| 200 | + |
| 201 | +1. From the command list, select **Azure Logic Apps: Swap Slot**, and follow the prompts to provide the required information: |
| 202 | + |
| 203 | + 1. Enter and select the name for your Azure subscription. |
| 204 | + |
| 205 | + 1. Enter and select the name for your existing Standard logic app in Azure. |
| 206 | + |
| 207 | + 1. Select the deployment slot that you want to make as the active slot. |
| 208 | + |
| 209 | + 1. Select the production slot that you want to swap with the deployment slot. |
| 210 | + |
| 211 | + 1. Wait for the operation to successfully complete. |
| 212 | + |
| 213 | +### [Azure CLI](#tab/azure-cli) |
| 214 | + |
| 215 | +Run the following Azure CLI command: |
| 216 | + |
| 217 | +`az functionapp deployment slot swap --name {logic-app-name} --resource-group {resource-group-name} --slot {slot-name} --target-slot production` |
| 218 | + |
| 219 | +--- |
| 220 | + |
| 221 | +## Confirm success for your slot swap |
| 222 | + |
| 223 | +After you swap slots, verify that the changes from your deployment slot now appear in the production slot. |
| 224 | + |
| 225 | +1. In the [Azure portal](https://portal.azure.com), open your Standard logic app resource. |
| 226 | + |
| 227 | +1. On the resource menu, under **Workflows**, select **Workflows**, and then select a workflow to review the changes. |
| 228 | + |
| 229 | +## Delete a deployment slot |
| 230 | + |
| 231 | +The following options are available for you to delete a deployment slot from your Standard logic app resource. |
| 232 | + |
| 233 | +### [Portal](#tab/portal) |
| 234 | + |
| 235 | +1. In the [Azure portal](https://portal.azure.com), open your Standard logic app resource. |
| 236 | + |
| 237 | +1. On the resource menu, under **Deployment**, select **Deployment slots (Preview)**. |
| 238 | + |
| 239 | +1. On the **Deployment slots** page, under **Deployment Slots (Preview)**, select the deployment slot that you want to delete. |
| 240 | + |
| 241 | +1. On the deployment slot resource menu, select **Overview**. |
| 242 | + |
| 243 | +1. On the **Overview** toolbar, select **Delete**. |
| 244 | + |
| 245 | +1. Confirm deletion by entering the deployment slot name, and then select **Delete**. |
| 246 | + |
| 247 | + :::image type="content" source="media/set-up-deployment-slots/delete-deployment-slot.png" alt-text="Screenshot shows Azure portal, deployment slot resource with Overview page opened, and delete confirmation pane with deployment slot name to delete." lightbox="media/set-up-deployment-slots/delete-deployment-slot.png"::: |
| 248 | + |
| 249 | +### [Visual Studio Code](#tab/visual-studio-code) |
| 250 | + |
| 251 | +1. In Visual Studio Code, open your Standard logic app project. |
| 252 | + |
| 253 | +1. Open the command palette. (Keyboard: Ctrl + Shift + P) |
| 254 | + |
| 255 | +1. From the command list, select **Azure Logic Apps: Delete Slot**, and follow the prompts to provide the required information: |
| 256 | + |
| 257 | + 1. Enter and select the name for your Azure subscription. |
| 258 | + |
| 259 | + 1. Enter and select the name for your existing Standard logic app in Azure. |
| 260 | + |
| 261 | + 1. Select the deployment slot that you want to delete. |
| 262 | + |
| 263 | +1. In the message box that appears, confirm that you want to delete selected deployment slot by selecting **Delete**. |
| 264 | + |
| 265 | +### [Azure CLI](#tab/azure-cli) |
| 266 | + |
| 267 | +Run the following Azure CLI command: |
| 268 | + |
| 269 | +`az functionapp deployment slot delete --name {logic-app-name} --resource-group {resource-group-name} --slot {slot-name} --target-slot production` |
| 270 | + |
| 271 | +--- |
| 272 | + |
| 273 | +## Confirm deployment slot deletion |
| 274 | + |
| 275 | +After you delete a deployment slot, verify that the slot no longer exists on your deployed Standard logic app resource. |
| 276 | + |
| 277 | +1. In the [Azure portal](https://portal.azure.com), open your Standard logic app resource. |
| 278 | + |
| 279 | +1. On the resource menu, under **Deployment**, select **Deployment slots (Preview)**. |
| 280 | + |
| 281 | +1. On the **Deployment slots** page, under **Deployment Slots (Preview)**, confirm that the deployment slot no longer exists. |
| 282 | + |
| 283 | +## Related content |
| 284 | + |
| 285 | +- [Deployment best practices](../app-service/deploy-best-practices.md) |
| 286 | +- [Azure Functions deployment slots](../azure-functions/functions-deployment-slots.md) |
0 commit comments