共用方式為


ServiceFabricDeploy@1 - Service Fabric 應用程式部署 v1 工作

使用此工作將 Service Fabric 應用程式部署至叢集。 此工作會根據發行配置檔中定義的設定,將 Azure Service Fabric 應用程式部署到叢集。

備註

此工作不支援使用工作流程身分識別同盟 Azure Resource Manager 驗證。

語法

# 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 - TimeoutSec
string。 選擇性。 overridePublishProfileSettings = true && isUpgrade = true時使用 。


ForceRestart - 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 Resource Manager 服務連接)、ContainerRegistryEndpoint(Container Registry Service Connection)、UsernamePassword(使用者名稱和密碼)。 預設值:AzureResourceManagerEndpoint

指定如何提供 Docker 登錄的認證。


dockerRegistryConnection - Docker Registry Service 連線
輸入別名:dockerRegistryEndpointstringconfigureDockerSettings = true && registryCredentials = ContainerRegistryEndpoint時為必要項。

指定 Docker 登錄服務連線。 需要用於需要向登錄進行驗證的命令。

備註

工作會先嘗試加密登錄秘密,再將它傳輸至 Service Fabric 叢集。 不過,工作需要叢集的伺服器證書才能安裝在代理程式計算機上。 如果憑證不存在,登錄密碼將不會加密。


azureSubscription - Azure 訂用帳戶
輸入別名:azureSubscriptionEndpointstringconfigureDockerSettings = 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、傳統組建、傳統版本
執行於 Agent、DeploymentGroup
需求 自我裝載代理程式必須具有 功能, 符合下列 需求, 執行使用此工作的作業: Cmd
功能 此工作不符合作業中後續工作的任何需求。
命令限制 任意
Settable 變數 任意
代理程式版本 1.95.0 或更新
工作類別 部署