ServiceFabricDeploy@1 - Service Fabric 应用程序部署 v1 任务

使用此任务将 Service Fabric 应用程序部署到群集。 此任务根据发布配置文件中定义的设置将 Azure Service Fabric 应用程序部署到群集。

注释

此任务不支持使用工作流标识联合身份验证 Azure 资源管理器身份验证。

语法

# Service Fabric application deployment v1
# Deploy an Azure Service Fabric application to a cluster.
- task: ServiceFabricDeploy@1
  inputs:
    applicationPackagePath: # string. Required. Application Package. 
    serviceConnectionName: # string. Required. Cluster Service Connection. 
    #publishProfilePath: # string. Publish Profile. 
    #applicationParameterPath: # string. Application Parameters. 
    #overrideApplicationParameter: false # boolean. Override Application Parameters. Default: false.
  # Advanced Settings
    #compressPackage: false # boolean. Compress Package. Default: false.
    #copyPackageTimeoutSec: # string. CopyPackageTimeoutSec. 
    #registerPackageTimeoutSec: # string. RegisterPackageTimeoutSec. 
    overwriteBehavior: 'SameAppTypeAndVersion' # 'Always' | 'Never' | 'SameAppTypeAndVersion'. Required. Overwrite Behavior. Default: SameAppTypeAndVersion.
    #skipUpgradeSameTypeAndVersion: false # boolean. Skip upgrade for same Type and Version. Default: false.
    #skipPackageValidation: false # boolean. Skip package validation. Default: false.
  # Upgrade Settings
    #useDiffPackage: false # boolean. Use Diff Package. Default: false.
    #overridePublishProfileSettings: false # boolean. Override All Publish Profile Upgrade Settings. Default: false.
    #isUpgrade: true # boolean. Optional. Use when overridePublishProfileSettings = true. Upgrade the Application. Default: true.
    #unregisterUnusedVersions: true # boolean. Unregister Unused Versions. Default: true.
    #upgradeMode: 'Monitored' # 'Monitored' | 'UnmonitoredAuto' | 'UnmonitoredManual'. Required when overridePublishProfileSettings = true && isUpgrade = true. Upgrade Mode. Default: Monitored.
    #FailureAction: 'Rollback' # 'Rollback' | 'Manual'. Required when overridePublishProfileSettings = true && isUpgrade = true && upgradeMode = Monitored. FailureAction. Default: Rollback.
    #UpgradeReplicaSetCheckTimeoutSec: # string. Optional. Use when overridePublishProfileSettings = true && isUpgrade = true. UpgradeReplicaSetCheckTimeoutSec. 
    #TimeoutSec: # string. Optional. Use when overridePublishProfileSettings = true && isUpgrade = true. TimeoutSec. 
    #ForceRestart: false # boolean. Optional. Use when overridePublishProfileSettings = true && isUpgrade = true. ForceRestart. Default: false.
    #HealthCheckRetryTimeoutSec: # string. Optional. Use when overridePublishProfileSettings = true && isUpgrade = true && upgradeMode = Monitored. HealthCheckRetryTimeoutSec. 
    #HealthCheckWaitDurationSec: # string. Optional. Use when overridePublishProfileSettings = true && isUpgrade = true && upgradeMode = Monitored. HealthCheckWaitDurationSec. 
    #HealthCheckStableDurationSec: # string. Optional. Use when overridePublishProfileSettings = true && isUpgrade = true && upgradeMode = Monitored. HealthCheckStableDurationSec. 
    #UpgradeDomainTimeoutSec: # string. Optional. Use when overridePublishProfileSettings = true && isUpgrade = true && upgradeMode = Monitored. UpgradeDomainTimeoutSec. 
    #ConsiderWarningAsError: false # boolean. Optional. Use when overridePublishProfileSettings = true && isUpgrade = true && upgradeMode = Monitored. ConsiderWarningAsError. Default: false.
    #DefaultServiceTypeHealthPolicy: # string. Optional. Use when overridePublishProfileSettings = true && isUpgrade = true && upgradeMode = Monitored. DefaultServiceTypeHealthPolicy. 
    #MaxPercentUnhealthyDeployedApplications: # string. Optional. Use when overridePublishProfileSettings = true && isUpgrade = true && upgradeMode = Monitored. MaxPercentUnhealthyDeployedApplications. 
    #UpgradeTimeoutSec: # string. Optional. Use when overridePublishProfileSettings = true && isUpgrade = true && upgradeMode = Monitored. UpgradeTimeoutSec. 
    #ServiceTypeHealthPolicyMap: # string. Optional. Use when overridePublishProfileSettings = true && isUpgrade = true && upgradeMode = Monitored. ServiceTypeHealthPolicyMap. 
  # Docker Settings
    #configureDockerSettings: false # boolean. Configure Docker settings. Default: false.
    #registryCredentials: 'AzureResourceManagerEndpoint' # 'AzureResourceManagerEndpoint' | 'ContainerRegistryEndpoint' | 'UsernamePassword'. Required when configureDockerSettings = true. Registry Credentials Source. Default: AzureResourceManagerEndpoint.
    #dockerRegistryConnection: # string. Alias: dockerRegistryEndpoint. Required when configureDockerSettings = true && registryCredentials = ContainerRegistryEndpoint. Docker Registry Service Connection. 
    #azureSubscription: # string. Alias: azureSubscriptionEndpoint. Required when configureDockerSettings = true && registryCredentials = AzureResourceManagerEndpoint. Azure subscription. 
    #registryUserName: # string. Optional. Use when configureDockerSettings = true && registryCredentials = UsernamePassword. Registry User Name. 
    #registryPassword: # string. Optional. Use when configureDockerSettings = true && registryCredentials = UsernamePassword. Registry Password. 
    #passwordEncrypted: true # boolean. Optional. Use when configureDockerSettings = true && registryCredentials = UsernamePassword. Password Encrypted. Default: true.

输入

applicationPackagePath - 应用程序包
string。 必填。

指定要部署的应用程序包的路径。 可以在路径中使用 变量 和通配符。


serviceConnectionName - 群集服务连接
string。 必填。

指定要用于连接到群集的 Azure Service Fabric 服务连接。 在此引用的服务连接中定义的设置将替代发布配置文件中定义的设置。 选择 Manage 注册新的服务连接。

若要连接到群集,Service Fabric 任务使用计算机证书存储来存储有关证书的信息。 如果两个版本在同一台计算机上使用同一证书一起运行,它们将正确启动。 但是,如果其中一个任务已完成,则会清理计算机证书存储中的证书,这会影响第二个版本。


publishProfilePath - 发布配置文件
string

可选。 指定发布配置文件的路径,该文件定义要使用的设置。 可以在路径中使用 变量 和通配符。 详细了解如何在 Visual Studio 中创建发布配置文件


applicationParameterPath - 应用程序参数
string

可选。 指定应用程序参数文件的路径。 可以在路径中使用 变量 和通配符。 如果指定,这将替代发布配置文件中的值。 详细了解如何 如何在 Visual Studio中创建应用程序参数文件。


overrideApplicationParameter - 替代应用程序参数
boolean。 默认值:false

可选。 指定在生成或发布管道中定义的变量与应用程序清单文件中的 Parameter Name 项匹配。 详细了解如何 如何在 Visual Studio中创建应用程序参数文件。 示例:

 <Parameters> 
 <Parameter Name="SampleApp_PartitionCount" Value="1" /> 
 <Parameter Name="SampleApp_InstanceCount" DefaultValue="-1" /> 
 </Parameters>

如果应用程序具有在上述示例中定义的参数,并且想要将分区计数更改为 2,则可以将发布管道或环境变量 SampleApp_PartitionCount 及其值定义为 2

注释

如果在发布管道和环境中定义了相同的变量,则环境变量将取代发布管道变量。


compressPackage - 压缩包
boolean。 默认值:false

可选。 指定在复制到映像存储之前是否应压缩应用程序包。 如果启用,这将替代发布配置文件中的值。 详细了解如何 压缩包


copyPackageTimeoutSec - CopyPackageTimeoutSec
string

可选。 指定将应用程序包复制到映像存储的超时(以秒为单位)。 如果指定,这将替代发布配置文件中的值。


registerPackageTimeoutSec - RegisterPackageTimeoutSec
string

可选。 指定注册或取消注册应用程序包的超时(以秒为单位)。


overwriteBehavior - 覆盖行为
string。 必填。 允许的值:AlwaysNeverSameAppTypeAndVersion。 默认值:SameAppTypeAndVersion

如果未配置同名和升级的群集中存在应用程序,则覆盖行为。

Never 不会删除现有应用程序。 这是默认行为。

Always 将删除现有应用程序,即使其应用程序类型和版本与所创建的应用程序不同。

仅当现有应用程序类型和版本与所创建的应用程序相同时,SameAppTypeAndVersion 才会删除现有应用程序。


skipUpgradeSameTypeAndVersion - 跳过同一类型和版本 的升级
boolean。 默认值:false

可选。 指定如果群集中已存在相同的应用程序类型和版本,是否将跳过升级;否则,升级在验证期间失败。 如果启用,则重新部署是幂等的。


skipPackageValidation - 跳过包验证
boolean。 默认值:false

可选。 指定是否应在部署之前验证包。 详细了解 包验证


useDiffPackage - 使用差异包
boolean。 默认值:false

可选。 使用仅包含更新的应用程序文件、更新的应用程序清单和服务清单文件的差异包进行升级。

通过将应用程序包输入中指定的包与当前在目标群集中注册的包进行比较来创建差异包。 如果群集的当前包中的服务版本与新包相同,则会从新应用程序包中删除此服务包。 详细了解 差异包


overridePublishProfileSettings - 覆盖所有发布配置文件升级设置
boolean。 默认值:false

可选。 使用指定值或默认值替代所有升级设置(如果未指定)。 详细了解 升级设置


isUpgrade - 升级应用程序
boolean。 可选。 当 overridePublishProfileSettings = true时使用。 默认值:true

如果值设置为 false,则覆盖应用程序。


unregisterUnusedVersions - 取消注册未使用的版本
boolean。 默认值:true

可选。 指示升级后是否删除应用程序类型的所有未使用版本。


upgradeMode - 升级模式
stringoverridePublishProfileSettings = true && isUpgrade = true时是必需的。 允许的值:MonitoredUnmonitoredAutoUnmonitoredManual。 默认值:Monitored


FailureAction - FailureAction
stringoverridePublishProfileSettings = true && isUpgrade = true && upgradeMode = Monitored时是必需的。 允许的值:RollbackManual。 默认值:Rollback


UpgradeReplicaSetCheckTimeoutSec - UpgradeReplicaSetCheckTimeoutSec
string。 可选。 当 overridePublishProfileSettings = true && isUpgrade = true时使用。


TimeoutSec - 超时秒
string。 可选。 当 overridePublishProfileSettings = true && isUpgrade = true时使用。


ForceRestart - 强制重启
boolean。 可选。 当 overridePublishProfileSettings = true && isUpgrade = true时使用。 默认值:false


HealthCheckRetryTimeoutSec - HealthCheckRetryTimeoutSec
string。 可选。 当 overridePublishProfileSettings = true && isUpgrade = true && upgradeMode = Monitored时使用。


HealthCheckWaitDurationSec - HealthCheckWaitDurationSec
string。 可选。 当 overridePublishProfileSettings = true && isUpgrade = true && upgradeMode = Monitored时使用。


HealthCheckStableDurationSec - HealthCheckStableDurationSec
string。 可选。 当 overridePublishProfileSettings = true && isUpgrade = true && upgradeMode = Monitored时使用。


UpgradeDomainTimeoutSec - UpgradeDomainTimeoutSec
string。 可选。 当 overridePublishProfileSettings = true && isUpgrade = true && upgradeMode = Monitored时使用。


ConsiderWarningAsError - ConsiderWarningAsError
boolean。 可选。 当 overridePublishProfileSettings = true && isUpgrade = true && upgradeMode = Monitored时使用。 默认值:false


DefaultServiceTypeHealthPolicy - DefaultServiceTypeHealthPolicy
string。 可选。 当 overridePublishProfileSettings = true && isUpgrade = true && upgradeMode = Monitored时使用。


MaxPercentUnhealthyDeployedApplications - MaxPercentUnhealthyDeployedApplications
string。 可选。 当 overridePublishProfileSettings = true && isUpgrade = true && upgradeMode = Monitored时使用。


UpgradeTimeoutSec - UpgradeTimeoutSec
string。 可选。 当 overridePublishProfileSettings = true && isUpgrade = true && upgradeMode = Monitored时使用。


ServiceTypeHealthPolicyMap - ServiceTypeHealthPolicyMap
string。 可选。 当 overridePublishProfileSettings = true && isUpgrade = true && upgradeMode = Monitored时使用。


configureDockerSettings - 配置 Docker 设置
boolean。 默认值:false

使用指定的 Docker 设置配置应用程序。


registryCredentials - 注册表凭据源
stringconfigureDockerSettings = true时是必需的。 允许的值:AzureResourceManagerEndpoint(Azure 资源管理器服务连接)、ContainerRegistryEndpoint(容器注册表服务连接)、UsernamePassword(用户名和密码)。 默认值:AzureResourceManagerEndpoint

指定如何提供 Docker 注册表的凭据。


dockerRegistryConnection - Docker 注册表服务连接
输入别名dockerRegistryEndpoint. stringconfigureDockerSettings = true && registryCredentials = ContainerRegistryEndpoint时是必需的。

指定 Docker 注册表服务连接。 需要使用注册表进行身份验证的命令。

注释

在将注册表机密传输到 Service Fabric 群集之前,该任务会尝试加密注册表机密。 但是,该任务需要在代理计算机上安装群集的服务器证书。 如果证书不存在,则不会加密注册表机密。


azureSubscription - Azure 订阅
输入别名azureSubscriptionEndpoint. stringconfigureDockerSettings = true && registryCredentials = AzureResourceManagerEndpoint时是必需的。

指定 Azure 订阅。

注释

在将注册表机密传输到 Service Fabric 群集之前,该任务将尝试加密注册表机密。 但是,该任务需要在代理计算机上安装群集的服务器证书。 如果证书不存在,则不会加密注册表机密。


registryUserName - 注册表用户名
string。 可选。 当 configureDockerSettings = true && registryCredentials = UsernamePassword时使用。

指定 Docker 注册表的用户名。


registryPassword - 注册表密码
string。 可选。 当 configureDockerSettings = true && registryCredentials = UsernamePassword时使用。

指定 Docker 注册表的密码。 如果未加密密码,则应使用自定义发布管道机密变量来存储密码。


passwordEncrypted - 密码加密
boolean。 可选。 当 configureDockerSettings = true && registryCredentials = UsernamePassword时使用。 默认值:true

应使用 Invoke-ServiceFabricEncryptText加密密码。 如果不这样做,并且会在生成代理上安装与群集服务连接中的服务器证书指纹匹配的证书,该证书将用于加密密码;否则,将发生错误。


任务控制选项

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

输出变量

没有。

注解

使用此任务将 Service Fabric 应用程序部署到群集。 此任务根据发布配置文件中定义的设置将 Azure Service Fabric 应用程序部署到群集。

Service Fabric

此任务使用 Service Fabric 安装来连接并部署到 Service Fabric 群集。 在生成代理上下载并安装 Service Fabric

要求

要求 说明
管道类型 YAML,经典版本,经典版本
运行时间 代理,DeploymentGroup
需求 自承载代理必须具有与以下 要求 运行使用此任务的作业 功能: Cmd
功能 此任务不满足作业中后续任务的任何要求。
命令限制 任何
Settable 变量 任何
代理版本 1.95.0 或更高版本
任务类别 部署