title | description | ms.date | monikerRange |
---|---|---|---|
AzureSpringCloud@0 - Azure Spring Apps v0 task |
Deploy applications to Azure Spring Apps and manage deployments. |
07/02/2024 |
>=azure-pipelines-2022 |
:::moniker range=">=azure-pipelines-2022"
This task deploys applications to Azure Spring Apps and manages those deployments.
Important
This task is supported on Azure Spring Apps Basic/Standard and Enterprise plans. For more information, see Automate application deployments to Azure Spring Apps.
:::moniker-end
:::moniker range="=azure-pipelines"
# Azure Spring Apps v0
# Deploy applications to Azure Spring Apps and manage deployments.
- task: AzureSpringCloud@0
inputs:
azureSubscription: # string. Alias: ConnectedServiceName. Required. Azure subscription.
Action: 'Deploy' # 'Deploy' | 'Set Production' | 'Delete Staging Deployment'. Required. Action. Default: Deploy.
AzureSpringCloud: # string. Required. Azure Spring Apps Name.
AppName: # string. Required. App.
#DeploymentType: 'Artifacts' # 'Artifacts' | 'CustomContainer'. Optional. Use when Action = Deploy. Deployment Type. Default: Artifacts.
#UseStagingDeployment: true # boolean. Optional. Use when Action = Deploy || Action = Set Production. Use Staging Deployment. Default: true.
#CreateNewDeployment: false # boolean. Optional. Use when Action = Deploy && UseStagingDeployment = false. Create a new staging deployment if one does not exist. Default: false.
#DeploymentName: # string. Optional. Use when UseStagingDeployment = false && Action != Delete Staging Deployment. Deployment.
#Package: '$(System.DefaultWorkingDirectory)/**/*.jar' # string. Optional. Use when Action = Deploy && DeploymentType = Artifacts. Package or folder. Default: $(System.DefaultWorkingDirectory)/**/*.jar.
#RegistryServer: 'docker.io' # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Registry Server. Default: docker.io.
#RegistryUsername: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Registry Username.
#RegistryPassword: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Registry Password.
#ImageName: 'hello-world:v1' # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Image Name and Tag. Default: hello-world:v1.
#ImageCommand: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Image Command.
#ImageArgs: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Image Arguments.
#ImageLanguageFramework: # 'springboot'. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Language Framework.
# Application and Configuration Settings
#Builder: # string. Optional. Use when Action = Deploy && DeploymentType = Artifacts. Builder.
#EnvironmentVariables: # string. Optional. Use when Action = Deploy. Environment Variables.
#JvmOptions: # string. Optional. Use when Action = Deploy && DeploymentType = Artifacts. JVM Options.
#RuntimeVersion: 'Java_11' # 'Java_8' | 'Java_11' | 'Java_17' | 'Java_21' | 'NetCore_31'. Optional. Use when Action = Deploy && DeploymentType = Artifacts. Runtime Version. Default: Java_11.
#DotNetCoreMainEntryPath: # string. Optional. Use when RuntimeVersion = NetCore_31. Main Entry Path.
#Version: # string. Optional. Use when Action = Deploy. Version.
:::moniker-end
:::moniker range=">=azure-pipelines-2022.1 <=azure-pipelines-2022.2"
# Azure Spring Apps v0
# Deploy applications to Azure Spring Apps and manage deployments.
- task: AzureSpringCloud@0
inputs:
azureSubscription: # string. Alias: ConnectedServiceName. Required. Azure subscription.
Action: 'Deploy' # 'Deploy' | 'Set Production' | 'Delete Staging Deployment'. Required. Action. Default: Deploy.
AzureSpringCloud: # string. Required. Azure Spring Apps Name.
AppName: # string. Required. App.
#DeploymentType: 'Artifacts' # 'Artifacts' | 'CustomContainer'. Optional. Use when Action = Deploy. Deployment Type. Default: Artifacts.
#UseStagingDeployment: true # boolean. Optional. Use when Action = Deploy || Action = Set Production. Use Staging Deployment. Default: true.
#CreateNewDeployment: false # boolean. Optional. Use when Action = Deploy && UseStagingDeployment = false. Create a new staging deployment if one does not exist. Default: false.
#DeploymentName: # string. Optional. Use when UseStagingDeployment = false && Action != Delete Staging Deployment. Deployment.
#Package: '$(System.DefaultWorkingDirectory)/**/*.jar' # string. Optional. Use when Action = Deploy && DeploymentType = Artifacts. Package or folder. Default: $(System.DefaultWorkingDirectory)/**/*.jar.
#RegistryServer: 'docker.io' # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Registry Server. Default: docker.io.
#RegistryUsername: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Registry Username.
#RegistryPassword: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Registry Password.
#ImageName: 'hello-world:v1' # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Image Name and Tag. Default: hello-world:v1.
#ImageCommand: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Image Command.
#ImageArgs: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Image Arguments.
#ImageLanguageFramework: # 'springboot'. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Language Framework.
# Application and Configuration Settings
#Builder: # string. Optional. Use when Action = Deploy && DeploymentType = Artifacts. Builder.
#EnvironmentVariables: # string. Optional. Use when Action = Deploy. Environment Variables.
#JvmOptions: # string. Optional. Use when Action = Deploy && DeploymentType = Artifacts. JVM Options.
#RuntimeVersion: 'Java_11' # 'Java_8' | 'Java_11' | 'NetCore_31'. Optional. Use when Action = Deploy && DeploymentType = Artifacts. Runtime Version. Default: Java_11.
#DotNetCoreMainEntryPath: # string. Optional. Use when RuntimeVersion = NetCore_31. Main Entry Path.
#Version: # string. Optional. Use when Action = Deploy. Version.
:::moniker-end
:::moniker range="=azure-pipelines-2022"
# Azure Spring Apps v0
# Deploy applications to Azure Spring Apps and manage deployments.
- task: AzureSpringCloud@0
inputs:
azureSubscription: # string. Alias: ConnectedServiceName. Required. Azure subscription.
Action: 'Deploy' # 'Deploy' | 'Set Production' | 'Delete Staging Deployment'. Required. Action. Default: Deploy.
AzureSpringCloud: # string. Required. Azure Spring Apps Name.
AppName: # string. Required. App.
#UseStagingDeployment: true # boolean. Optional. Use when Action = Deploy || Action = Set Production. Use Staging Deployment. Default: true.
#CreateNewDeployment: false # boolean. Optional. Use when Action = Deploy && UseStagingDeployment = false. Create a new staging deployment if one does not exist. Default: false.
#DeploymentName: # string. Optional. Use when UseStagingDeployment = false && Action != Delete Staging Deployment. Deployment.
#Package: '$(System.DefaultWorkingDirectory)/**/*.jar' # string. Optional. Use when Action = Deploy. Package or folder. Default: $(System.DefaultWorkingDirectory)/**/*.jar.
# Application and Configuration Settings
#EnvironmentVariables: # string. Optional. Use when Action = Deploy. Environment Variables.
#JvmOptions: # string. Optional. Use when Action = Deploy. JVM Options.
#RuntimeVersion: 'Java_11' # 'Java_8' | 'Java_11' | 'NetCore_31'. Optional. Use when Action = Deploy. Runtime Version. Default: Java_11.
#DotNetCoreMainEntryPath: # string. Optional. Use when RuntimeVersion = NetCore_31. Main Entry Path.
#Version: # string. Optional. Use when Action = Deploy. Version.
:::moniker-end
:::moniker range=">=azure-pipelines-2022"
azureSubscription
- Azure subscription
Input alias: ConnectedServiceName
. string
. Required.
Specifies the Azure Resource Manager subscription for the deployment.
:::moniker-end
:::moniker range=">=azure-pipelines-2022"
Action
- Action
string
. Required. Allowed values: Deploy
, Set Production
(Set Production Deployment), Delete Staging Deployment
. Default value: Deploy
.
The action to be performed on Azure Spring Apps.
:::moniker-end
:::moniker range=">=azure-pipelines-2022"
AzureSpringCloud
- Azure Spring Apps Name
string
. Required.
The name or resource ID of the Azure Spring Apps instance to deploy.
:::moniker-end
:::moniker range=">=azure-pipelines-2022"
AppName
- App
string
. Required.
The name of the Azure Spring Apps app to deploy. The app must exist prior to the task execution.
:::moniker-end
:::moniker range=">=azure-pipelines-2022.1"
DeploymentType
- Deployment Type
string
. Optional. Use when Action = Deploy
. Allowed values: Artifacts
, CustomContainer
(Custom Container). Default value: Artifacts
.
To deploy with source code or Java package, choose "Artifacts"; To deploy with container image, choose "Custom Container".
:::moniker-end
:::moniker range=">=azure-pipelines-2022"
UseStagingDeployment
- Use Staging Deployment
boolean
. Optional. Use when Action = Deploy || Action = Set Production
. Default value: true
.
At the time the task runs, this input automatically selects the deployment that's set as staging
.
If set to true
, apply the task to the deployment that is set as the staging deployment at time of execution. If omitted, the DeploymentName
parameter must be set.
:::moniker-end
:::moniker range=">=azure-pipelines-2022"
CreateNewDeployment
- Create a new staging deployment if one does not exist.
boolean
. Optional. Use when Action = Deploy && UseStagingDeployment = false
. Default value: false
.
If set to true
, and the deployment specified by DeploymentName
does not exist at execution time, it will be created. If omitted, the DeploymentName
parameter must be set.
:::moniker-end
:::moniker range=">=azure-pipelines-2022"
DeploymentName
- Deployment
string
. Optional. Use when UseStagingDeployment = false && Action != Delete Staging Deployment
.
The deployment to which this task will apply. If not using blue-green deployments, set this field to default
. The value must start with a letter and consist of lowercase letters and numbers only.
:::moniker-end
:::moniker range=">=azure-pipelines-2022.1"
Package
- Package or folder
string
. Optional. Use when Action = Deploy && DeploymentType = Artifacts
. Default value: $(System.DefaultWorkingDirectory)/**/*.jar
.
The file path to the package or folder containing the Azure Spring Apps app contents (.jar
file for Java, .zip
for .NET Core).
Variables ( Build | Release) and wildcards are supported.
For example, $(System.DefaultWorkingDirectory)/**/*.jar
:::moniker-end
:::moniker range="=azure-pipelines-2022"
Package
- Package or folder
string
. Optional. Use when Action = Deploy
. Default value: $(System.DefaultWorkingDirectory)/**/*.jar
.
The file path to the package or folder containing the Azure Spring Apps app contents (.jar
file for Java, .zip
for .NET Core).
Variables ( Build | Release) and wildcards are supported.
For example, $(System.DefaultWorkingDirectory)/**/*.jar
:::moniker-end
:::moniker range=">=azure-pipelines-2022.1"
Builder
- Builder
string
. Optional. Use when Action = Deploy && DeploymentType = Artifacts
.
Select a builder of VMware Tanzu® Build Service™, this can be used in enterprise tier.
For detailed description, please check Use Tanzu Build Service.
:::moniker-end
:::moniker range=">=azure-pipelines-2022.1"
RegistryServer
- Registry Server
string
. Optional. Use when Action = Deploy && DeploymentType = CustomContainer
. Default value: docker.io
.
The registry of the container image. Default: docker.io.
:::moniker-end
:::moniker range=">=azure-pipelines-2022.1"
RegistryUsername
- Registry Username
string
. Optional. Use when Action = Deploy && DeploymentType = CustomContainer
.
The username of the container registry.
:::moniker-end
:::moniker range=">=azure-pipelines-2022.1"
RegistryPassword
- Registry Password
string
. Optional. Use when Action = Deploy && DeploymentType = CustomContainer
.
The password of the container registry.
:::moniker-end
:::moniker range=">=azure-pipelines-2022.1"
ImageName
- Image Name and Tag
string
. Optional. Use when Action = Deploy && DeploymentType = CustomContainer
. Default value: hello-world:v1
.
The container image tag.
:::moniker-end
:::moniker range=">=azure-pipelines-2022.1"
ImageCommand
- Image Command
string
. Optional. Use when Action = Deploy && DeploymentType = CustomContainer
.
The command of the container image.
:::moniker-end
:::moniker range=">=azure-pipelines-2022.1"
ImageArgs
- Image Arguments
string
. Optional. Use when Action = Deploy && DeploymentType = CustomContainer
.
The arguments of the container image.
:::moniker-end
:::moniker range=">=azure-pipelines-2022.1"
ImageLanguageFramework
- Language Framework
string
. Optional. Use when Action = Deploy && DeploymentType = CustomContainer
. Allowed values: springboot
.
:::moniker-end
:::moniker range=">=azure-pipelines-2022"
EnvironmentVariables
- Environment Variables
string
. Optional. Use when Action = Deploy
.
The environment variables to be entered using the syntax -key value
(for example: -CUSTOMER_NAME Contoso
-WEBSITE_TIME_ZONE
). Values containing spaces should be enclosed in double quotes (for example: "Eastern Standard Time"
).
:::moniker-end
:::moniker range=">=azure-pipelines-2022.1"
JvmOptions
- JVM Options
string
. Optional. Use when Action = Deploy && DeploymentType = Artifacts
.
Edits the app's JVM options. A string containing JVM options, such as -Xms1024m -Xmx2048m
.
:::moniker-end
:::moniker range="=azure-pipelines-2022"
JvmOptions
- JVM Options
string
. Optional. Use when Action = Deploy
.
Edits the app's JVM options. A string containing JVM options, such as -Xms1024m -Xmx2048m
.
:::moniker-end
:::moniker range="=azure-pipelines"
RuntimeVersion
- Runtime Version
string
. Optional. Use when Action = Deploy && DeploymentType = Artifacts
. Allowed values: Java_8
(Java 8), Java_11
(Java 11), Java_17
(Java 17), Java_21
(Java 21), NetCore_31
(.Net Core 3.1). Default value: Java_11
.
The runtime version on which the app will run.
:::moniker-end
:::moniker range=">=azure-pipelines-2022.1 <=azure-pipelines-2022.2"
RuntimeVersion
- Runtime Version
string
. Optional. Use when Action = Deploy && DeploymentType = Artifacts
. Allowed values: Java_8
(Java 8), Java_11
(Java 11), NetCore_31
(.Net Core 3.1). Default value: Java_11
.
The runtime version on which the app will run.
:::moniker-end
:::moniker range="=azure-pipelines-2022"
RuntimeVersion
- Runtime Version
string
. Optional. Use when Action = Deploy
. Allowed values: Java_8
(Java 8), Java_11
(Java 11), NetCore_31
(.Net Core 3.1). Default value: Java_11
.
The runtime version on which the app will run.
:::moniker-end
:::moniker range=">=azure-pipelines-2022"
DotNetCoreMainEntryPath
- Main Entry Path
string
. Optional. Use when RuntimeVersion = NetCore_31
.
The path to the .NET executable relative to the zip root.
:::moniker-end
:::moniker range=">=azure-pipelines-2022"
Version
- Version
string
. Optional. Use when Action = Deploy
.
The deployment version. If not set, the version is left unchanged.
:::moniker-end
All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.
:::moniker range=">=azure-pipelines-2022"
This task defines the following output variables, which you can consume in downstream steps, jobs, and stages.
testEndpoint
After the 'Deploy' action only. Contains private URL for accessing the updated deployment.
:::moniker-end
Use this task to deploy applications to Azure Spring Apps and to manage Azure Spring Cloud deployments.
Important
This task is supported on Azure Spring Apps Basic/Standard and Enterprise plans. For more information, see Automate application deployments to Azure Spring Apps.
The following examples demonstrate common usage scenarios. For more information, see Automate application deployments to Azure Spring Apps.
The "Delete Staging Deployment" action allows you to delete the deployment not receiving production traffic. This frees up resources used by that deployment and makes room for a new staging deployment:
variables:
azureSubscription: Contoso
steps:
- task: AzureSpringCloud@0
continueOnError: true # Don't fail the pipeline if a staging deployment doesn't already exist.
inputs:
continueOnError: true
inputs:
azureSubscription: $(azureSubscription)
Action: 'Delete Staging Deployment'
AppName: customer-api
AzureSpringCloud: contoso-dev-az-spr-cld
The following example deploys to the default production deployment in Azure Spring Apps. This is the only possible deployment scenario when using the Basic SKU:
Note
The package search pattern should only return exactly one package. If the build task produces multiple JAR packages such as sources.jar and javadoc.jar, you need to refine the search pattern so that it only matches the application binary artifact.
variables:
azureSubscription: Contoso
steps:
- task: AzureSpringCloud@0
inputs:
azureSubscription: $(azureSubscription)
Action: 'Deploy'
AzureSpringCloud: contoso-dev-az-spr-cld
AppName: customer-api
UseStagingDeployment: false
DeploymentName: default
Package: '$(System.DefaultWorkingDirectory)/**/*customer-api*.jar'
The following example deploys to a pre-existing staging deployment. This deployment will not receive production traffic until it is set as a production deployment.
variables:
azureSubscription: Contoso
steps:
- task: AzureSpringCloud@0
inputs:
azureSubscription: $(azureSubscription)
Action: 'Deploy'
AzureSpringCloud: contoso-dev-az-spr-cld
AppName: customer-api
UseStagingDeployment: true
Package: '$(System.DefaultWorkingDirectory)/**/*customer-api*.jar'
For more on blue-green deployments, including an alternative approach, see Blue-green deployment strategies.
The following example sets the current staging deployment as production, effectively swapping which deployment receives production traffic.
variables:
azureSubscription: Contoso
steps:
- task: AzureSpringCloud@0
inputs:
azureSubscription: $(azureSubscription)
Action: 'Set Production'
AzureSpringCloud: contoso-dev-az-spr-cld
AppName: customer-api
UseStagingDeployment: true
:::moniker range=">=azure-pipelines-2022"
Requirement | Description |
---|---|
Pipeline types | YAML, Classic build, Classic release |
Runs on | Agent, DeploymentGroup |
Demands | None |
Capabilities | This task does not satisfy any demands for subsequent tasks in the job. |
Command restrictions | Any |
Settable variables | Any |
Agent version | 2.104.1 or greater |
Task category | Deploy |
:::moniker-end