AzureAppServiceManage@0 - Azure App 服務 管理 v0 工作

啟動、停止、重新啟動、位置交換、位置刪除、安裝月臺擴充功能,或啟用 Azure App 服務的持續監視。

啟動、停止、重新啟動、位置交換、安裝月臺擴充功能,或啟用 Azure App 服務的持續監視。

Syntax

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

輸入

azureSubscription - Azure 訂用帳戶
輸入別名: ConnectedServiceNamestring. 必要。

選取 Azure Resource Manager 訂用帳戶。


Action - 行動
string. 允許的值:Swap Slots、 (Start App Service) 、 Stop Azure App Service (Stop App Service) 、 Restart Azure App Service (Restart App Service) 、、Complete SwapStart Swap With Preview (Complete Swap with Preview) 、 Cancel Swap (Cancel Swap with Preview) 、Install Extensions、、 。Start Azure App ServiceStop all continuous webjobsStart all continuous webjobsDelete SlotEnable Continuous Monitoring 預設值:Swap Slots

選擇性。 定義要對 App Service 執行的動作。 您可以啟動、停止、重新啟動、位置交換、使用預覽開始交換、使用預覽完成交換、使用預覽取消交換、安裝網站延伸模組,或啟用 Azure App 服務的持續監視。


Action - 行動
string. 允許的值:Swap Slots、 (Start App Service) 、 Stop Azure App Service (Stop App Service) 、 (Restart App Service) 、Install Extensions、 。 Start Azure App ServiceEnable Continuous MonitoringRestart Azure App ServiceStart all continuous webjobsStop all continuous webjobs 預設值:Swap Slots

選擇性。 定義要對 App Service 執行的動作。 您可以啟動、停止、重新啟動、位置交換、使用預覽開始交換、使用預覽完成交換、使用預覽取消交換、安裝網站延伸模組,或啟用 Azure App 服務的持續監視。


WebAppName - App Service 名稱
string. 必要。

輸入或選取現有 Azure App 服務 的名稱。


SpecifySlotOrASE - 指定位置或 App Service 環境
輸入別名: SpecifySlotboolean. 選擇性。 使用時機 Action != Swap Slots && Action != Delete Slot && Action != Start Swap With Preview && Action != Complete Swap && Action != Cancel Swap。 預設值:false


SpecifySlotOrASE - 指定位置或 App Service 環境
輸入別名: SpecifySlotboolean. 選擇性。 使用時機 Action != Swap Slots。 預設值:false


ResourceGroupName - 資源群組
string. 當 Action = Swap Slots || Action = Delete Slot || SpecifySlot = true || Action = Start Swap With Preview || Action = Complete Swap || Action = Cancel Swap 時為必要。

輸入或選取包含上述 Azure App 服務 的 Azure 資源群組。


ResourceGroupName - 資源群組
string. 當 Action = Swap Slots || SpecifySlot = true 時為必要。

輸入或選取包含上述 Azure App 服務 的 Azure 資源群組。


SourceSlot - 來源位置
string. 當 Action = Swap Slots || Action = Start Swap With Preview || Action = Complete Swap 時為必要。

當做來源位置使用。action == Swap Slots 交換動作會將目的地位置的流量導向來源位置。


SourceSlot - 來源位置
string. 當 Action = Swap Slots 時為必要。

當做來源位置使用。action == Swap Slots 交換動作會將目的地位置的流量導向來源位置。


SwapWithProduction - 與生產環境交換
boolean. 選擇性。 使用時機 Action = Swap Slots || Action = Start Swap With Preview || Action = Complete Swap。 預設值:true

交換來源位置的流量與生產環境。 如果您未選取此選項,則必須提供來源和目標位置名稱。


SwapWithProduction - 與生產環境交換
boolean. 選擇性。 使用時機 Action = Swap Slots。 預設值:true

交換來源位置的流量與生產環境。 如果您未選取此選項,則必須提供來源和目標位置名稱。


TargetSlot - 目標位置
string. 當 SwapWithProduction = false 時為必要。

當 做為目的地位置時 action == Swap Slots使用 。 交換動作會將目的地位置的流量導向來源位置。


TargetSlot - 目標位置
string. 當 Action = Swap Slots && SwapWithProduction = false 時為必要。

當 做為目的地位置時 action == Swap Slots使用 。 交換動作會將目的地位置的流量導向來源位置。


PreserveVnet - 保留 Vnet
boolean. 選擇性。 使用時機 Action = Swap Slots || Action = Start Swap With Preview || Action = Complete Swap。 預設值:false

保留虛擬網路設定。


PreserveVnet - 保留 Vnet
boolean. 選擇性。 使用時機 Action = Swap Slots。 預設值:false

保留虛擬網路設定。


Slot -
string. 當 Action = Delete Slot || Action = Cancel Swap || SpecifySlot = true 時為必要。 預設值:production


Slot -
string. 當 Action != Swap Slots && SpecifySlot = true 時為必要。 預設值:production


ExtensionsList - 安裝擴充功能
string. 當 Action = Install Extensions 時為必要。

網站延伸模組會在 Microsoft Azure App 服務 上執行。 您可以將一組工具安裝為月臺擴充功能,並更妥善地管理您的 Azure App 服務。 重新啟動 App Service,讓最新的變更生效。


OutputVariable - 輸出變數
string. 選擇性。 使用時機 Action = Install Extensions

提供所選取延伸模組本機安裝路徑的變數名稱。

此欄位現在已被取代,將會移除。 LocalPathsForInstalledExtensions在後續工作中,使用 [輸出變數] 區段中的 變數。


AppInsightsResourceGroupName - Application Insights 的資源組名
string. 當 Action == Enable Continuous Monitoring 時為必要。

輸入或選取 Application Insights 資源可用的資源群組。


ApplicationInsightsResourceName - Application Insights 資源名稱
string. 當 Action == Enable Continuous Monitoring 時為必要。

選取記錄連續監視數據的 Application Insights 資源。

如果您的 Application Insights 資源未列在這裡,而且您想要建立新的資源,請選取 [+新增]。 一旦您在 Azure 入口網站 中建立資源,請返回這裏,然後選取 [重新整理]。


ApplicationInsightsWebTestName - Application Insights Web 測試名稱
string. 選擇性。 使用 時 Action == Enable Continuous Monitoring

選擇性。 輸入您想要建立或更新的 Application Insights Web 測試名稱。

如果您沒有提供 Web 測試名稱,則會使用預設的測試名稱。


工作控制選項

除了工作輸入之外,所有工作都有控制選項。 如需詳細資訊,請參閱 控制選項和一般工作屬性

輸出變數

此工作會定義下列 輸出變數,您可以在下游步驟、作業和階段中使用。

LocalPathsForInstalledExtensions
這個輸入是您選取之延伸模組的本機安裝路徑。

如果您選取多個延伸模組,則輸出會為您選取的每個延伸模組,以逗號分隔的本機路徑清單。 輸出會依其出現在 [安裝延伸模組] 字段中的順序列出路徑。

備註

使用此工作來啟動、停止、重新啟動、位置交換、使用預覽交換、安裝網站延伸模組,或啟用 Azure App 服務的持續監視。

交換期間發生的情況

當您將兩個位置交換 (通常從預備位置交換至生產位置) ,請確定生產位置一律是目標位置。 如此,交換作業就不會對生產應用程式產生影響。

此外,在交換 (或與預覽) 作業交換的任何時間點,所有初始化交換應用程式的工作都會發生在來源位置上。 無論交換成功或失敗,在來源位置進行準備和準備就緒時,目標位置都會保持線上狀態。

如需詳細資訊,請參閱在 Azure App Service 中設定預備環境

規格需求

需求 描述
管線類型 YAML、傳統組建、傳統版本
在上執行 Agent、DeploymentGroup
要求
Capabilities 此工作不符合作業中後續工作的任何需求。
命令限制 任何
可設定變數 任何
代理程式版本 1.102.0 或更新版本
工作類別 部署