Azure Cloud Service Deployment task

Azure Pipelines

Use this task in a build or release pipeline to deploy an Azure Cloud Service.

YAML snippet

# Azure Cloud Service deployment
# Deploy an Azure Cloud Service
- task: AzureCloudPowerShellDeployment@1
  inputs:
    azureClassicSubscription: 
    #storageAccount: # Required when enableAdvancedStorageOptions == False
    serviceName: 
    serviceLocation: 
    csPkg: 
    csCfg: 
    #slotName: 'Production' 
    #deploymentLabel: '$(Build.BuildNumber)' # Optional
    #appendDateTimeToLabel: false # Optional
    #allowUpgrade: true 
    #simultaneousUpgrade: false # Optional
    #forceUpgrade: false # Optional
    #verifyRoleInstanceStatus: false # Optional
    #diagnosticStorageAccountKeys: # Optional
    #newServiceCustomCertificates: # Optional
    #newServiceAdditionalArguments: # Optional
    #newServiceAffinityGroup: # Optional
    #enableAdvancedStorageOptions: false 
    #aRMConnectedServiceName: # Required when enableAdvancedStorageOptions == True
    #aRMStorageAccount: # Required when enableAdvancedStorageOptions == True

Arguments

ArgumentDescription
Azure subscription (Classic)(Required) Azure Classic subscription to target for deployment.
Storage account(Required) Storage account must exist prior to deployment.
Service name(Required) Select or enter an existing cloud service name.
Service location(Required) Select a region for new service deployment.Possible options are East US, East US 2, Central US, South Central US, West US, North Europe, West Europe and others.
CsPkg(Required) Path of CsPkg under the default artifact directory.
CsCfg(Required) Path of CsCfg under the default artifact directory.
Environment (Slot)(Required) Production or Staging
Deployment label(Optional) Specifies the label name for the new deployment. If not specified, a Globally Unique Identifier (GUID) is used.
Append current date and time(Optional) Appends current date and time to deployment label
Allow upgrade(Required) When selected allows an upgrade to the Microsoft Azure deployment
Simultaneous upgrade(Optional) Updates all instances at once. Your cloud service will be unavailable during update.
Force upgrade(Optional) When selected sets the upgrade to a forced upgrade, which could potentially cause loss of local data.
Diagnostic storage account keys(Optional) Provide storage keys for diagnostics storage account in Role:Storagekey format. The diagnostics storage account name for each role will be obtained from diagnostics config file (.wadcfgx). If the .wadcfgx file for a role is not found, diagnostics extensions won’t be set for the role. If the storage account name is missing in the .wadcfgx file, the default storage account will be used for storing diagnostics results and the storage key parameters from deployment task will be ignored. It’s recommended to save <storage_account_key> as a secret variable unless there is no sensitive information in the diagnostics result for your stage.

For example,
WebRole: <WebRole_storage_account_key>
WorkerRole: <WorkerRole_storage_account_key>
Custom certificates to import(Optional) Provide custom certificates in CertificatePfxBase64:CertificatePassword format. It’s recommended to save <certificate_password> as a secret variable.

For example,
Certificate1: <Certificate1_password>
Certificate2: <Certificate2_password>
Additional arguments(Optional) Pass in additional arguments while creating a brand new service. These will be passed on to New-AzureService cmdlet. Eg: -Label 'MyTestService'
Affinity group(Optional) While creating new service, this affinity group will be considered instead of using service location.
Control options

Open source

This task is open source on GitHub. Feedback and contributions are welcome.