AzureAppServiceManage@0 - Azure 应用服务管理 v0 任务

启动、停止、重启、槽交换、槽删除、安装站点扩展或为 Azure 应用服务启用持续监视。

语法

# 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.

输入

azureSubscription - Azure 订阅
输入别名:ConnectedServiceNamestring。 必填。

选择 Azure 资源管理器订阅。


Action - 操作
string。 允许的值:Swap SlotsStart Azure App Service(启动应用服务)、Stop Azure App Service(停止应用服务)、Restart Azure App Service(重启应用服务)、Start Swap With PreviewComplete Swap(使用预览完成交换)、Cancel Swap(使用预览取消交换)、Delete SlotInstall ExtensionsEnable Continuous MonitoringStart all continuous webjobsStop all continuous webjobs。 默认值:Swap Slots

可选。 定义要在应用服务上执行的作。 可以启动、停止、重启、槽交换、使用预览开始交换、使用预览完成交换、取消与预览交换、安装站点扩展或为 Azure 应用服务启用持续监视。


WebAppName - 应用服务名称
string。 必填。

输入或选择现有 Azure 应用服务的名称。


SpecifySlotOrASE - 指定槽或应用服务环境
输入别名:SpecifySlotboolean。 可选。 当 Action != Swap Slots && Action != Delete Slot && Action != Start Swap With Preview && Action != Complete Swap && Action != Cancel Swap时使用。 默认值:false


ResourceGroupName - 资源组
stringAction = Swap Slots || Action = Delete Slot || SpecifySlot = true || Action = Start Swap With Preview || Action = Complete Swap || Action = Cancel Swap时是必需的。

输入或选择包含上面指定的 Azure 应用服务的 Azure 资源组。


SourceSlot - 源槽
stringAction = Swap Slots || Action = Start Swap With Preview || Action = Complete Swap时是必需的。

action == Swap Slots时用作源槽。 交换作将目标槽的流量定向到源槽。


SwapWithProduction - 与生产 交换
boolean。 可选。 当 Action = Swap Slots || Action = Start Swap With Preview || Action = Complete Swap时使用。 默认值:true

将源槽的流量与生产交换。 如果未选择此选项,则需要提供源和目标槽名称。


TargetSlot - 目标槽
stringSwapWithProduction = false时是必需的。

action == Swap Slots时用作目标槽。 交换作将目标槽的流量定向到源槽。


PreserveVnet - 保留 Vnet
boolean。 可选。 当 Action = Swap Slots || Action = Start Swap With Preview || Action = Complete Swap时使用。 默认值:false

保留虚拟网络设置。


Slot -
stringAction = Delete Slot || Action = Cancel Swap || SpecifySlot = true时是必需的。 默认值:production


ExtensionsList - 安装扩展
stringAction = Install Extensions时是必需的。

站点扩展在 azure 应用服务Microsoft上运行。 可以将一组工具安装为站点扩展,并更好地管理 Azure 应用服务。 重启应用服务,使最新更改生效。


OutputVariable - 输出变量
string。 可选。 当 Action = Install Extensions时使用。

为所选扩展的本地安装路径提供变量名称。

此字段现已弃用,将被删除。 在后续任务中使用“输出变量”部分中的 LocalPathsForInstalledExtensions 变量。


Application InsightsAppInsightsResourceGroupName - 资源组名称
stringAction == Enable Continuous Monitoring时是必需的。

输入或选择 Application Insights 资源可用的资源组。


ApplicationInsightsResourceName - Application Insights 资源名称
stringAction == Enable Continuous Monitoring时是必需的。

选择记录连续监视数据的 Application Insights 资源。

如果 Application Insights 资源未在此处列出,并且想要创建新资源,请选择“+新建。 在 Azure 门户中创建资源后,返回此处并选择 刷新


ApplicationInsightsWebTestName - Application Insights Web 测试名称
string。 可选。 当 Action == Enable Continuous Monitoring时使用。

可选。 输入要创建或更新的 Application Insights Web 测试名称。

如果未提供 Web 测试名称,则使用默认测试名称。


任务控制选项

除任务输入之外,所有任务都具有控制选项。 有关详细信息,请参阅 控件选项和常见任务属性

输出变量

此任务定义以下 输出变量,可以在下游步骤、作业和阶段中使用。

LocalPathsForInstalledExtensions
此输入是所选扩展的本地安装路径。

如果选择多个扩展,则输出是所选每个扩展的本地路径的逗号分隔列表。 输出按其出现在“安装扩展”字段中的顺序列出路径。

注解

使用此任务可以启动、停止、重启、槽交换、与预览交换、安装站点扩展或为 Azure 应用服务启用持续监视。

交换期间发生的情况

将两个槽(通常从过渡槽交换到生产槽)时,请确保生产槽始终是目标槽。 这样,交换操作才不会影响生产应用。

此外,在交换(或与预览版交换)作的任何时刻,初始化交换的应用的所有工作都在源槽上发生。 准备和预热源槽时,目标槽将保持联机,而不管交换是成功还是失败。

有关详细信息,请参阅 在 Azure 应用服务中设置过渡环境。

要求

要求 说明
管道类型 YAML,经典版本,经典版本
运行时间 代理,DeploymentGroup
需求 没有
功能 此任务不满足作业中后续任务的任何要求。
命令限制 任何
Settable 变量 任何
代理版本 1.102.0 或更高版本
任务类别 部署