Skip to content

Latest commit

 

History

History
459 lines (357 loc) · 21.7 KB

azure-app-service-manage-v0.md

File metadata and controls

459 lines (357 loc) · 21.7 KB
title description ms.date monikerRange
AzureAppServiceManage@0 - Azure App Service manage v0 task
Start, stop, restart, slot swap, slot delete, install site extensions or enable continuous monitoring for an Azure App Service.
06/11/2024
<=azure-pipelines

AzureAppServiceManage@0 - Azure App Service manage v0 task

:::moniker range=">=azure-pipelines-2020"

Start, stop, restart, slot swap, slot delete, install site extensions, or enable continuous monitoring for an Azure App Service.

:::moniker-end

:::moniker range="<=azure-pipelines-2019.1"

Start, stop, restart, slot swap, install site extensions, or enable continuous monitoring for an Azure App Service.

:::moniker-end

Syntax

:::moniker range=">=azure-pipelines-2020"

# Azure App Service manage v0
# Start, stop, restart, slot swap, slot delete, install site extensions or enable continuous monitoring for an Azure App Service.
- task: AzureAppServiceManage@0
  inputs:
    azureSubscription: # string. Alias: ConnectedServiceName. Required. Azure subscription. 
    #Action: 'Swap Slots' # 'Swap Slots' | 'Start Azure App Service' | 'Stop Azure App Service' | 'Restart Azure App Service' | 'Start Swap With Preview' | 'Complete Swap' | 'Cancel Swap' | 'Delete Slot' | 'Install Extensions' | 'Enable Continuous Monitoring' | 'Start all continuous webjobs' | 'Stop all continuous webjobs'. Action. Default: Swap Slots.
    WebAppName: # string. Required. App Service name. 
    #SpecifySlotOrASE: false # boolean. Alias: SpecifySlot. Optional. Use when Action != Swap Slots && Action != Delete Slot && Action != Start Swap With Preview && Action != Complete Swap && Action != Cancel Swap. Specify Slot or App Service Environment. Default: false.
    #ResourceGroupName: # string. Required when Action = Swap Slots || Action = Delete Slot || SpecifySlot = true || Action = Start Swap With Preview || Action = Complete Swap || Action = Cancel Swap. Resource group. 
    #SourceSlot: # string. Required when Action = Swap Slots || Action = Start Swap With Preview  || Action = Complete Swap. Source Slot. 
    #SwapWithProduction: true # boolean. Optional. Use when Action = Swap Slots || Action = Start Swap With Preview  || Action = Complete Swap. Swap with Production. Default: true.
    #TargetSlot: # string. Required when SwapWithProduction = false. Target Slot. 
    #PreserveVnet: false # boolean. Optional. Use when Action = Swap Slots || Action = Start Swap With Preview || Action = Complete Swap. Preserve Vnet. Default: false.
    #Slot: 'production' # string. Required when Action = Delete Slot || Action = Cancel Swap || SpecifySlot = true. Slot. Default: production.
    #ExtensionsList: # string. Required when Action = Install Extensions. Install Extensions. 
    #OutputVariable: # string. Optional. Use when Action = Install Extensions. Output variable. 
    #AppInsightsResourceGroupName: # string. Required when Action == Enable Continuous Monitoring. Resource Group name for Application Insights. 
    #ApplicationInsightsResourceName: # string. Required when Action == Enable Continuous Monitoring. Application Insights resource name. 
  # Advanced Settings
    #ApplicationInsightsWebTestName: # string. Optional. Use when Action == Enable Continuous Monitoring. Application Insights web test name.

:::moniker-end

:::moniker range="=azure-pipelines-2019.1"

# Azure App Service manage v0
# Start, stop, restart, slot swap, install site extensions or enable continuous monitoring for an Azure App Service.
- task: AzureAppServiceManage@0
  inputs:
    azureSubscription: # string. Alias: ConnectedServiceName. Required. Azure subscription. 
    #Action: 'Swap Slots' # 'Swap Slots' | 'Start Azure App Service' | 'Stop Azure App Service' | 'Restart Azure App Service' | 'Install Extensions' | 'Enable Continuous Monitoring' | 'Start all continuous webjobs' | 'Stop all continuous webjobs'. Action. Default: Swap Slots.
    WebAppName: # string. Required. App Service name. 
    #SpecifySlotOrASE: false # boolean. Alias: SpecifySlot. Optional. Use when Action != Swap Slots. Specify Slot or App Service Environment. Default: false.
    #ResourceGroupName: # string. Required when Action = Swap Slots || SpecifySlot = true. Resource group. 
    #SourceSlot: # string. Required when Action = Swap Slots. Source Slot. 
    #SwapWithProduction: true # boolean. Optional. Use when Action = Swap Slots. Swap with Production. Default: true.
    #TargetSlot: # string. Required when Action = Swap Slots && SwapWithProduction = false. Target Slot. 
    #PreserveVnet: false # boolean. Optional. Use when Action = Swap Slots. Preserve Vnet. Default: false.
    #Slot: 'production' # string. Required when Action != Swap Slots && SpecifySlot = true. Slot. Default: production.
    #ExtensionsList: # string. Required when Action = Install Extensions. Install Extensions. 
    #OutputVariable: # string. Optional. Use when Action = Install Extensions. Output variable. 
    #AppInsightsResourceGroupName: # string. Required when Action == Enable Continuous Monitoring. Resource Group name for Application Insights. 
    #ApplicationInsightsResourceName: # string. Required when Action == Enable Continuous Monitoring. Application Insights resource name. 
  # Advanced Settings
    #ApplicationInsightsWebTestName: # string. Optional. Use when Action == Enable Continuous Monitoring. Application Insights web test name.

:::moniker-end

:::moniker range="=azure-pipelines-2019"

# Azure App Service Manage v0
# Start, Stop, Restart, Slot swap, Install site extensions or Enable Continuous Monitoring for an Azure App Service.
- task: AzureAppServiceManage@0
  inputs:
    azureSubscription: # string. Alias: ConnectedServiceName. Required. Azure subscription. 
    #Action: 'Swap Slots' # 'Swap Slots' | 'Start Azure App Service' | 'Stop Azure App Service' | 'Restart Azure App Service' | 'Install Extensions' | 'Enable Continuous Monitoring' | 'Start all continuous webjobs' | 'Stop all continuous webjobs'. Action. Default: Swap Slots.
    WebAppName: # string. Required. App Service name. 
    #SpecifySlotOrASE: false # boolean. Alias: SpecifySlot. Optional. Use when Action != Swap Slots. Specify Slot or App Service Environment. Default: false.
    #ResourceGroupName: # string. Required when Action = Swap Slots || SpecifySlot = true. Resource group. 
    #SourceSlot: # string. Required when Action = Swap Slots. Source Slot. 
    #SwapWithProduction: true # boolean. Optional. Use when Action = Swap Slots. Swap with Production. Default: true.
    #TargetSlot: # string. Required when Action = Swap Slots && SwapWithProduction = false. Target Slot. 
    #PreserveVnet: false # boolean. Optional. Use when Action = Swap Slots. Preserve Vnet. Default: false.
    #Slot: 'production' # string. Required when Action != Swap Slots && SpecifySlot = true. Slot. Default: production.
    #ExtensionsList: # string. Required when Action = Install Extensions. Install Extensions. 
    #OutputVariable: # string. Optional. Use when Action = Install Extensions. Output variable. 
    #AppInsightsResourceGroupName: # string. Required when Action == Enable Continuous Monitoring. Resource Group name for Application Insights. 
    #ApplicationInsightsResourceName: # string. Required when Action == Enable Continuous Monitoring. Application Insights resource name. 
  # Advanced Settings
    #ApplicationInsightsWebTestName: # string. Optional. Use when Action == Enable Continuous Monitoring. Application Insights web test name.

:::moniker-end

Inputs

:::moniker range="<=azure-pipelines"

azureSubscription - Azure subscription
Input alias: ConnectedServiceName. string. Required.

Selects the Azure Resource Manager subscription.


:::moniker-end

:::moniker range=">=azure-pipelines-2020"

Action - Action
string. Allowed values: Swap Slots, Start Azure App Service (Start App Service), Stop Azure App Service (Stop App Service), Restart Azure App Service (Restart App Service), Start Swap With Preview, Complete Swap (Complete Swap With Preview), Cancel Swap (Cancel Swap With Preview), Delete Slot, Install Extensions, Enable Continuous Monitoring, Start all continuous webjobs, Stop all continuous webjobs. Default value: Swap Slots.

Optional. Defines the action to perform on the App Service. You can start, stop, restart, slot swap, start swap with a preview, complete swap with a preview, cancel swap with a preview, install site extensions, or enable continuous monitoring for an Azure App Service.


:::moniker-end

:::moniker range="<=azure-pipelines-2019.1"

Action - Action
string. Allowed values: Swap Slots, Start Azure App Service (Start App Service), Stop Azure App Service (Stop App Service), Restart Azure App Service (Restart App Service), Install Extensions, Enable Continuous Monitoring, Start all continuous webjobs, Stop all continuous webjobs. Default value: Swap Slots.

Optional. Defines the action to perform on the App Service. You can start, stop, restart, slot swap, start swap with a preview, complete swap with a preview, cancel swap with a preview, install site extensions, or enable continuous monitoring for an Azure App Service.


:::moniker-end

:::moniker range="<=azure-pipelines"

WebAppName - App Service name
string. Required.

Enters or selects the name of an existing Azure App Service.


:::moniker-end

:::moniker range=">=azure-pipelines-2020"

SpecifySlotOrASE - Specify Slot or App Service Environment
Input alias: SpecifySlot. boolean. Optional. Use when Action != Swap Slots && Action != Delete Slot && Action != Start Swap With Preview && Action != Complete Swap && Action != Cancel Swap. Default value: false.


:::moniker-end

:::moniker range=">=azure-pipelines-2019 <=azure-pipelines-2019.1"

SpecifySlotOrASE - Specify Slot or App Service Environment
Input alias: SpecifySlot. boolean. Optional. Use when Action != Swap Slots. Default value: false.


:::moniker-end

:::moniker range=">=azure-pipelines-2020"

ResourceGroupName - Resource group
string. Required when Action = Swap Slots || Action = Delete Slot || SpecifySlot = true || Action = Start Swap With Preview || Action = Complete Swap || Action = Cancel Swap.

Enters or selects the Azure Resource Group that contains the Azure App Service specified above.


:::moniker-end

:::moniker range="<=azure-pipelines-2019.1"

ResourceGroupName - Resource group
string. Required when Action = Swap Slots || SpecifySlot = true.

Enters or selects the Azure Resource Group that contains the Azure App Service specified above.


:::moniker-end

:::moniker range=">=azure-pipelines-2020"

SourceSlot - Source Slot
string. Required when Action = Swap Slots || Action = Start Swap With Preview || Action = Complete Swap.

Used as source slot when action == Swap Slots. The swap action directs destination slot's traffic to the source slot.


:::moniker-end

:::moniker range="<=azure-pipelines-2019.1"

SourceSlot - Source Slot
string. Required when Action = Swap Slots.

Used as the source slot when action == Swap Slots. The swap action directs destination slot's traffic to the source slot.


:::moniker-end

:::moniker range=">=azure-pipelines-2020"

SwapWithProduction - Swap with Production
boolean. Optional. Use when Action = Swap Slots || Action = Start Swap With Preview || Action = Complete Swap. Default value: true.

Swaps the traffic of the source slot with production. If you don't select this option, then you need to provide the source and target slot names.


:::moniker-end

:::moniker range="<=azure-pipelines-2019.1"

SwapWithProduction - Swap with Production
boolean. Optional. Use when Action = Swap Slots. Default value: true.

Swaps the traffic of the source slot with production. If you don't select this option, then you need to provide the source and target slot names.


:::moniker-end

:::moniker range=">=azure-pipelines-2020"

TargetSlot - Target Slot
string. Required when SwapWithProduction = false.

Use as the destination slot when action == Swap Slots. The swap action directs the destination slot's traffic to the source slot.


:::moniker-end

:::moniker range="<=azure-pipelines-2019.1"

TargetSlot - Target Slot
string. Required when Action = Swap Slots && SwapWithProduction = false.

Use as the destination slot when action == Swap Slots. The swap action directs the destination slot's traffic to the source slot.


:::moniker-end

:::moniker range=">=azure-pipelines-2020"

PreserveVnet - Preserve Vnet
boolean. Optional. Use when Action = Swap Slots || Action = Start Swap With Preview || Action = Complete Swap. Default value: false.

Preserves the virtual network settings.


:::moniker-end

:::moniker range="<=azure-pipelines-2019.1"

PreserveVnet - Preserve Vnet
boolean. Optional. Use when Action = Swap Slots. Default value: false.

Preserves the virtual network settings.


:::moniker-end

:::moniker range=">=azure-pipelines-2020"

Slot - Slot
string. Required when Action = Delete Slot || Action = Cancel Swap || SpecifySlot = true. Default value: production.


:::moniker-end

:::moniker range=">=azure-pipelines-2019 <=azure-pipelines-2019.1"

Slot - Slot
string. Required when Action != Swap Slots && SpecifySlot = true. Default value: production.


:::moniker-end

:::moniker range=">=azure-pipelines-2019"

ExtensionsList - Install Extensions
string. Required when Action = Install Extensions.

Site extensions run on Microsoft Azure App Service. You can install a set of tools as a site extension and better manage your Azure App Service. Restart the App Service so the latest changes take effect.


:::moniker-end

:::moniker range="<=azure-pipelines"

OutputVariable - Output variable
string. Optional. Use when Action = Install Extensions.

Provides the variable name for the selected extension's local installation path.

This field is now deprecated and will be removed. Use the LocalPathsForInstalledExtensions variable from the Output Variables section in subsequent tasks.


:::moniker-end

:::moniker range="<=azure-pipelines"

AppInsightsResourceGroupName - Resource Group name for Application Insights
string. Required when Action == Enable Continuous Monitoring.

Enters or selects the resource group where your Application Insights resource is available.


:::moniker-end

:::moniker range="<=azure-pipelines"

ApplicationInsightsResourceName - Application Insights resource name
string. Required when Action == Enable Continuous Monitoring.

Selects the Application Insights resource where continuous monitoring data is recorded.

If your Application Insights resource is not listed here and you want to create a new resource, select +New. Once you create the resource in the Azure portal, come back here and select Refresh.


:::moniker-end

:::moniker range=">=azure-pipelines-2019"

ApplicationInsightsWebTestName - Application Insights web test name
string. Optional. Use when Action == Enable Continuous Monitoring.

Optional. Enters the Application Insights web test name you want to create or update.

If you don't provide a web test name, the default test name is used.


:::moniker-end

Task control options

All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.

Output variables

:::moniker range=">=azure-pipelines-2019"

This task defines the following output variables, which you can consume in downstream steps, jobs, and stages.

LocalPathsForInstalledExtensions
This input is the local installation paths for the extensions you select.

If you select multiple extensions, the output is a comma-separated list of local paths for each of the extensions you select. The output lists the paths in the order they appear in the Install Extensions field.

:::moniker-end

Remarks

Use this task to start, stop, restart, slot swap, Swap with Preview, install site extensions, or enable continuous monitoring for an Azure App Service.

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.

For more information, see Set up staging environments in Azure App Service.

Requirements

:::moniker range=">=azure-pipelines-2019"

Requirement Description
Pipeline types YAML, Classic build, Classic release
Runs on Agent, DeploymentGroup
Demands None
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version 1.102.0 or greater
Task category Deploy

:::moniker-end