AzureCloudPowerShellDeployment@1 - Azure 雲端服務部署 v1 工作
部署 Azure 雲端服務。
因為 Azure 雲端服務即將淘汰,因此此工作已被取代,請參閱 將 Azure 雲端服務(傳統版)遷移至 Azure 雲端服務(外延支援)。
語法
# Azure Cloud Service deployment v1
# Deploy an Azure Cloud Service.
- task: AzureCloudPowerShellDeployment@1
inputs:
azureClassicSubscription: # string. Alias: ConnectedServiceName. Required. Azure subscription (Classic).
#EnableAdvancedStorageOptions: false # boolean. Enable ARM storage support. Default: false.
StorageAccount: # string. Required when EnableAdvancedStorageOptions = false. Storage account (Classic).
#ARMConnectedServiceName: # string. Required when EnableAdvancedStorageOptions = true. Azure subscription (ARM).
#ARMStorageAccount: # string. Required when EnableAdvancedStorageOptions = true. Storage account (ARM).
ServiceName: # string. Required. Service name.
ServiceLocation: # string. Required. Service location.
CsPkg: # string. Required. CsPkg.
CsCfg: # string. Required. CsCfg.
slotName: 'Production' # string. Alias: Slot. Required. Environment (Slot). Default: Production.
#DeploymentLabel: '$(Build.BuildNumber)' # string. Deployment label. Default: $(Build.BuildNumber).
#AppendDateTimeToLabel: false # boolean. Append current date and time. Default: false.
#AllowUpgrade: true # boolean. Allow upgrade. Default: true.
#SimultaneousUpgrade: false # boolean. Optional. Use when AllowUpgrade == true. Simultaneous upgrade. Default: false.
#ForceUpgrade: false # boolean. Optional. Use when AllowUpgrade == true. Force upgrade. Default: false.
#VerifyRoleInstanceStatus: false # boolean. Verify role instance status. Default: false.
# Advanced Options For Creating New Service
#DiagnosticStorageAccountKeys: # string. Diagnostic storage account keys.
#NewServiceCustomCertificates: # string. Custom certificates to import.
#NewServiceAdditionalArguments: # string. Additional arguments.
#NewServiceAffinityGroup: # string. Affinity group.
輸入
azureClassicSubscription
-
Azure 訂用帳戶 (傳統)
輸入別名:ConnectedServiceName
。
string
。 必須的。
要以部署為目標的 Azure 訂用帳戶。
EnableAdvancedStorageOptions
-
啟用ARM記憶體支援
boolean
。 預設值:false
。
啟用或停用ARM記憶體支援。
StorageAccount
-
記憶體帳戶 (傳統)
string
。
EnableAdvancedStorageOptions = false
時為必要項。
部署之前,記憶體帳戶必須存在。
ARMConnectedServiceName
-
Azure 訂用帳戶 (ARM)
string
。
EnableAdvancedStorageOptions = true
時為必要項。
ARM 訂用帳戶。
ARMStorageAccount
-
記憶體帳戶 (ARM)
string
。
EnableAdvancedStorageOptions = true
時為必要項。
預先存在的ARM記憶體帳戶。
ServiceName
-
服務名稱
string
。 必須的。
現有的雲端服務名稱。
ServiceLocation
-
服務位置
string
。 必須的。
新服務部署的區域。 選項包括:美國東部、美國東部 2、美國中部、美國中南部、美國西部、北歐、西歐等。
CsPkg
-
CsPkg
string
。 必須的。
預設成品目錄中 CsPkg 的路徑。
CsCfg
-
CsCfg
string
。 必須的。
預設成品目錄中的 CsCfg 路徑。
slotName
-
環境 (位置)
輸入別名:Slot
。
string
。 必須的。 預設值:Production
。
將此值設定為 『Staging』,或使用預設值。
DeploymentLabel
-
部署標籤
string
。 預設值:$(Build.BuildNumber)
。
指定新部署的標籤名稱。 如果未指定,預設為全域唯一標識碼 (GUID)。
AppendDateTimeToLabel
-
附加目前的日期和時間
boolean
。 預設值:false
。
將目前的日期和時間附加至部署標籤。
AllowUpgrade
-
允許升級
boolean
。 預設值:true
。
允許升級至 Microsoft Azure 部署。
SimultaneousUpgrade
-
同時升級
boolean
。 選擇性。
AllowUpgrade == true
時使用 。 預設值:false
。
一次升級所有實例。 您的雲端服務目前無法使用。
ForceUpgrade
-
強制升級
boolean
。 選擇性。
AllowUpgrade == true
時使用 。 預設值:false
。
設定強制升級。 強制升級可能會導致本機數據遺失。
VerifyRoleInstanceStatus
-
驗證角色實例狀態
boolean
。 預設值:false
。
讓工作等到角色實例處於就緒狀態為止。
DiagnosticStorageAccountKeys
-
診斷記憶體帳戶金鑰
string
。
將記憶體金鑰字串格式化為 Role:Storagekey
。 系統會從診斷配置檔 (.wadcfgx) 擷取每個角色的診斷記憶體帳戶名稱。
- 如果找不到角色的 .wadcfgx 檔案:該角色未設定診斷擴展名。
- 如果在 .wadcfgx 檔案中找不到記憶體帳戶名稱:預設記憶體帳戶會用於儲存診斷結果,並忽略部署工作的記憶體密鑰參數。
注意:如果您的環境診斷結果中有敏感性資訊,請將 storage_account_key
儲存為秘密變數。 例如:
- WebRole:
WebRole_storage_account_key
- WorkerRole:
WorkerRole_stoarge_account_key
NewServiceCustomCertificates
-
匯入 自定義憑證
string
。
將自訂憑證字串格式化為 CertificatePfxBase64:CertificatePassword
。 將 certificate_password
儲存為秘密變數。 例如:
- Certificate1:
Certificate1_password
- 憑證2:
Certificate2_password
NewServiceAdditionalArguments
-
其他自變數
string
。
在建立新服務時傳遞其他自變數。 自變數會傳遞至 New-AzureService
Cmdlet。 例如: -Label 'MyTestService'
。
NewServiceAffinityGroup
-
Affinity 群組
string
。
建立新服務時,所使用的同質群組,而不是服務位置。
工作控制選項
除了工作輸入之外,所有工作都有控制選項。 如需詳細資訊,請參閱 控制項選項和一般工作屬性。
輸出變數
沒有。
備註
使用此工作來部署 Azure 雲端服務。