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.
AzureSpringCloud - Azure Spring Apps Name string. Required.
The name or resource ID of the Azure Spring Apps instance to deploy.
AppName - App string. Required.
The name of the Azure Spring Apps app to deploy. The app must exist prior to the task execution.
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".
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.
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.
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.
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
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
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.
RegistryServer - Registry Server string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Default value: docker.io.
The registry of the container image. Default: docker.io.
RegistryUsername - Registry Username string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer.
The username of the container registry.
RegistryPassword - Registry Password string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer.
The password of the container registry.
ImageName - Image Name and Tag string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Default value: hello-world:v1.
The container image tag.
ImageCommand - Image Command string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer.
The command of the container image.
ImageArgs - Image Arguments string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer.
The arguments of the container image.
ImageLanguageFramework - Language Framework string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Allowed values: springboot.
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").
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.
JvmOptions - JVM Options string. Optional. Use when Action = Deploy.
Edits the app's JVM options. A string containing JVM options, such as -Xms1024m -Xmx2048m.
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:
yml
variables: azureSubscription:Contososteps:- 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
Deploying
To production
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:
Piezīme
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.
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.
Pievienojieties meetup sērijai, lai kopā ar citiem izstrādātājiem un ekspertiem izveidotu mērogojamus AI risinājumus, kuru pamatā ir reālas lietošanas gadījumi.