AzureAppServiceManage@0 - Azure App Service 管理 v0 工作
啟動、停止、重新啟動、位置交換、位置刪除、安裝網站擴充功能,或啟用 Azure App Service 的持續監視。
語法
# 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 訂用帳戶
輸入別名:ConnectedServiceName
。
string
。 必須的。
選取 Azure Resource Manager 訂用帳戶。
Action
-
動作
string
。 允許的值:Swap Slots
、Start Azure App Service
(啟動 App Service)、Stop Azure App Service
(停止 App Service)、Restart Azure App Service
(重新啟動 App Service)、Start Swap With Preview
、Complete Swap
Complete Swap
(預覽完整交換)、Cancel Swap
Delete Slot
Delete Slot
、Install Extensions
、Enable Continuous Monitoring
、Start all continuous webjobs
、Stop all continuous webjobs
。 預設值:Swap Slots
。
選擇性。 定義在 App Service 上執行的動作。 您可以啟動、停止、重新啟動、位置交換、使用預覽開始交換、使用預覽完成交換、取消使用預覽交換、安裝網站延伸模組,或啟用 Azure App Service 的持續監視。
WebAppName
-
App Service 名稱
string
。 必須的。
輸入或選取現有 Azure App Service 的名稱。
SpecifySlotOrASE
-
指定位置或 App Service 環境
輸入別名:SpecifySlot
。
boolean
。 選擇性。
Action != Swap Slots && Action != Delete Slot && Action != Start Swap With Preview && Action != Complete Swap && Action != Cancel Swap
時使用 。 預設值:false
。
ResourceGroupName
-
資源群組
string
。
Action = Swap Slots || Action = Delete Slot || SpecifySlot = true || Action = Start Swap With Preview || Action = Complete Swap || Action = Cancel Swap
時為必要項。
輸入或選取包含上面指定之 Azure App Service 的 Azure 資源群組。
SourceSlot
-
來源位置
string
。
Action = 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
-
目標位置
string
。
SwapWithProduction = false
時為必要項。
當 action == Swap Slots
時,請使用 作為目的地位置。 交換動作會將目的地位置的流量導向來源位置。
PreserveVnet
-
保留 Vnet
boolean
。 選擇性。
Action = Swap Slots || Action = Start Swap With Preview || Action = Complete Swap
時使用 。 預設值:false
。
保留虛擬網路設定。
Slot
-
位置
string
。
Action = Delete Slot || Action = Cancel Swap || SpecifySlot = true
時為必要項。 預設值:production
。
ExtensionsList
-
安裝延伸模組
string
。
Action = Install Extensions
時為必要項。
Microsoft Azure App Service 上執行的網站延伸模組。 您可以將一組工具安裝為網站延伸模組,並更妥善地管理您的 Azure App Service。 重新啟動 App Service,讓最新的變更生效。
OutputVariable
-
輸出變數
string
。 選擇性。
Action = Install Extensions
時使用 。
提供所選取延伸模組本機安裝路徑的變數名稱。
此欄位現在已被取代,將會移除。 使用後續工作中 [輸出變數] 區段中的 LocalPathsForInstalledExtensions
變數。
Application Insights的 AppInsightsResourceGroupName
- 資源組名
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 Service 的持續監視。
交換期間發生的情況
當您交換兩個位置(通常是從預備位置到生產位置),請確定生產位置一律是目標位置。 如此,交換作業就不會對生產應用程式產生影響。
此外,在交換(或與預覽版交換)作業的任何時間點,初始化交換的應用程式的所有工作都會發生在來源位置上。 無論交換成功或失敗,在來源位置進行準備和準備就緒時,目標位置都會保持線上狀態。
如需詳細資訊,請參閱在 Azure App 服務 中設定預備環境。
需求
要求 | 說明 |
---|---|
管線類型 | YAML、傳統組建、傳統版本 |
執行於 | Agent、DeploymentGroup |
需求 | 沒有 |
功能 | 此工作不符合作業中後續工作的任何需求。 |
命令限制 | 任意 |
Settable 變數 | 任意 |
代理程式版本 | 1.102.0 或更新 |
工作類別 | 部署 |