Azure App Service Manage task
Use this task in a build or release pipeline to start, stop, restart, slot swap, Swap with Preview, install site extensions, or enable continuous monitoring for an Azure App Service.
# Azure App Service manage # Start, stop, restart, slot swap, slot delete, install site extensions or enable continuous monitoring for an Azure App Service - task: AzureAppServiceManage@0 inputs: azureSubscription: #action: 'Swap Slots' # Optional. Options: swap Slots, start Azure App Service, stop Azure App Service, restart Azure App Service, delete Slot, install Extensions, enable Continuous Monitoring, start All Continuous Webjobs, stop All Continuous Webjobs webAppName: #specifySlotOrASE: false # Optional #resourceGroupName: # Required when action == Swap Slots || Action == Delete Slot || SpecifySlot == True #sourceSlot: # Required when action == Swap Slots #swapWithProduction: true # Optional #targetSlot: # Required when action == Swap Slots && SwapWithProduction == False #preserveVnet: false # Optional #slot: 'production' # Required when action == Delete Slot || SpecifySlot == True #extensionsList: # Required when action == Install Extensions #outputVariable: # Optional #appInsightsResourceGroupName: # Required when action == Enable Continuous Monitoring #applicationInsightsResourceName: # Required when action == Enable Continuous Monitoring #applicationInsightsWebTestName: # Optional
|Azure subscription||(Required) Select the Azure Resource Manager subscription|
|Action||(Optional) Action to be performed on the App Service. You can Start, Stop, Restart, Slot swap, Start Swap with Preview, Complete Swap with preview, Cancel Swap with preview, Install site extensions or enable Continuous Monitoring for an Azure App Service|
|App Service name||(Required) Enter or select the name of an existing Azure App Service|
|Specify Slot or App Service Environment||(Optional) undefined|
|Resource group||(Required) Enter or Select the Azure Resource Group that contains the Azure App Service specified above|
|Source Slot||(Required) The swap action directs destination slot's traffic to the source slot|
|Swap with Production||(Optional) Select the option to swap the traffic of source slot with production. If this option is not selected, then you will have to provide source and target slot names.|
|Target Slot||(Required) The swap action directs destination slot's traffic to the source slot|
|Preserve Vnet||(Optional) Preserve the Virtual network settings|
|Install Extensions||(Required) Site Extensions run on Microsoft Azure App Service. You can install set of tools as site extension and better manage your Azure App Service. The App Service will be restarted to make sure latest changes take effect.|
|Output variable||(Optional) Provide the variable name for the local installation path for the selected extension.|
This field is now deprecated and would be removed. Use LocalPathsForInstalledExtensions variable from Output Variables section in subsequent tasks.
|Resource Group name for Application Insights||(Required) Enter or Select resource group where your application insights resource is available|
|Application Insights resource name||(Required) Select Application Insights resource where continuous monitoring data will be recorded. |
If your application insights resource is not listed here and you want to create a new resource, click on [+New] button. Once the resource is created on Azure Portal, come back here and click on refresh button.
What happens during a swap
When you swap two slots (usually from a staging slot into the production slot), make sure that the production slot is always the target slot. This way, the swap operation doesn't affect your production app. Also at any point of the swap (or swap with preview) operation, all work of initializing the swapped apps happens on the source slot. The target slot remains online while the source slot is being prepared and warmed up, regardless of where the swap succeeds or fails. Please refer to Set up staging environments in Azure App Service for more details.
This task is open source on GitHub. Feedback and contributions are welcome.