AzureCloudPowerShellDeployment@1 - Azure 云服务部署 v1 任务

部署 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.
# Azure Cloud Service deployment v1
# Deploy an Azure Cloud Service.
- task: AzureCloudPowerShellDeployment@1
  inputs:
    azureClassicSubscription: # string. Alias: ConnectedServiceName. Required. Azure subscription (Classic). 
    StorageAccount: # string. Required. Storage account. 
    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.
# Azure Cloud Service Deployment v1
# Deploy an Azure Cloud Service.
- task: AzureCloudPowerShellDeployment@1
  inputs:
    azureClassicSubscription: # string. Alias: ConnectedServiceName. Required. Azure subscription (Classic). 
    StorageAccount: # string. Required. Storage account. 
    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 订阅 (经典)
输入别名: ConnectedServiceNamestring. 必需。

要以部署为目标的 Azure 订阅。


EnableAdvancedStorageOptions - 启用 ARM 存储支持
boolean. 默认值:false

启用或禁用 ARM 存储支持。


StorageAccount - 存储帐户 (经典)
string. 当 EnableAdvancedStorageOptions = false 时,需要此选项。

在部署之前,存储帐户必须存在。


StorageAccount - 存储帐户
string. 必需。

在部署之前,存储帐户必须存在。


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 - 环境 (槽)
输入别名: Slotstring. 必需。 默认值:Production

将此值设置为“暂存”或使用默认值。


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
  • Certificate2: Certificate2_password

NewServiceAdditionalArguments - 其他参数
string.

创建新服务时传递其他参数。 参数将 New-AzureService 传递到 cmdlet。 例如 -Label 'MyTestService'


NewServiceAffinityGroup - 地缘组
string.

创建新服务时使用的地缘组,而不是服务位置。


任务控制选项

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

输出变量

无。

备注

使用此任务部署 Azure 云服务。

要求

要求 说明
管道类型 YAML、经典版本、经典版本
运行平台 Agent
需求 自承载代理必须具有满足以下要求的功能才能运行使用此任务的作业:azureps
功能 此任务不满足作业中后续任务的任何要求。
命令限制 任意
可设置变量 任意
代理版本 1.103.0 或更高版本
任务类别 部署