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

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

Syntax

# 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.
# Service Fabric Application Deployment v1
# Deploy a 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>

如果您的應用程式具有如上述範例中所定義的參數,而且您想要將分割區計數變更為 22,您可以將發行管線或環境變數SampleApp_PartitionCount及其值定義為 。

注意

如果在發行管線和環境中定義相同的變數,則環境變數會取代發行管線變數。


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

選擇性。 使用僅包含已更新的應用程式檔、更新的應用程式指令清單和服務指令清單檔案的 diff 套件進行升級。

差異套件是藉由比較應用程式套件輸入中指定的封裝,與目前在目標叢集中註冊的套件進行比較來建立。 如果叢集目前套件中的服務版本與新套件相同,則會從新的應用程式封裝中移除此服務套件。 深入了解 差異套件


overridePublishProfileSettings - 覆寫所有發行配置檔升級設定
boolean. 預設值:false

選擇性。 如果未指定) ,請覆寫所有具有指定值的升級設定或預設值 (。 深入了解 升級設定


isUpgrade - 升級應用程式
boolean. 選擇性。 使用時機 overridePublishProfileSettings = true。 預設值:true

如果值設定為 false,則覆寫應用程式。


unregisterUnusedVersions - 取消註冊未使用的版本
boolean. 預設值:true

選擇性。 指出升級之後,是否會移除所有未使用的應用程式類型版本。


upgradeMode - 升級模式
string. 當 overridePublishProfileSettings = true && isUpgrade = true 時為必要。 允許值:MonitoredUnmonitoredAutoUnmonitoredManual。 預設值:Monitored


FailureAction - FailureAction
string. 當 overridePublishProfileSettings = 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 - 登錄認證來源
string. 當 configureDockerSettings = true 時為必要。 允許的值: AzureResourceManagerEndpoint (Azure Resource Manager 服務連線) 、 ContainerRegistryEndpoint (Container Registry Service Connection) 、 UsernamePassword (Username 和 Password) 。 預設值:AzureResourceManagerEndpoint

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


dockerRegistryConnection - Docker Registry 服務連線
輸入別名: dockerRegistryEndpointstring. 當 configureDockerSettings = true && registryCredentials = ContainerRegistryEndpoint 時為必要。

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

注意

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


azureSubscription - Azure 訂用帳戶
輸入別名: azureSubscriptionEndpointstring. 當 configureDockerSettings = 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
Capabilities 此工作不符合作業中後續工作的任何需求。
命令限制 任何
Settable 變數 任何
代理程式版本 1.95.0 或更新版本
工作類別 部署