このタスクでは、アプリケーションを Azure Spring Apps にデプロイし、それらのデプロイを管理します。
Von Bedeutung
このタスクは、 Azure Spring Apps の Basic/Standard プランと Enterprise プランでサポートされています。 詳細については、「 Azure Spring Apps へのアプリケーションのデプロイを自動化する」を参照してください。
構文
# 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.
# 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.
# 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.
入力
Azure サブスクリプション を
入力エイリアス: ConnectedServiceName
。
string
。 必須。
デプロイの Azure Resource Manager サブスクリプション を指定します。
Action
-
アクションの
string
。 必須。 使用できる値: Deploy
、 Set Production
(運用デプロイの設定)、 Delete Staging Deployment
。 既定値: Deploy
。
Azure Spring Apps で実行されるアクション。
AzureSpringCloud
-
Azure Spring アプリの名前
string
。 必須。
デプロイする Azure Spring Apps インスタンスの名前またはリソース ID。
AppName
-
アプリ
string
。 必須。
デプロイする Azure Spring Apps アプリの名前。 アプリは、タスクの実行前に存在している必要があります。
DeploymentType
-
デプロイの種類
string
。 任意。
Action = Deploy
するときに使用します。 使用できる値: Artifacts
、 CustomContainer
(カスタム コンテナ)。 既定値: Artifacts
。
ソースコードまたは Java パッケージを使用してデプロイするには、「アーティファクト」を選択します。コンテナイメージを使用してデプロイするには、[カスタムコンテナ]を選択します。
UseStagingDeployment
-
ステージングデプロイメントの使用
boolean
。 任意。
Action = Deploy || Action = Set Production
するときに使用します。 既定値: true
。
タスクの実行時に、この入力によって、 staging
として設定されたデプロイが自動的に選択されます。
true
に設定した場合は、実行時にステージング・デプロイメントとして設定されているデプロイメントにタスクを適用します。 省略する場合は、 DeploymentName
パラメーターを設定する必要があります。
CreateNewDeployment
-
新しいステージング デプロイが存在しない場合は作成します。
boolean
。 任意。
Action = Deploy && UseStagingDeployment = false
するときに使用します。 既定値: false
。
true
に設定し、DeploymentName
で指定されたデプロイメントが実行時に存在しない場合は、作成されます。 省略する場合は、 DeploymentName
パラメーターを設定する必要があります。
DeploymentName
-
配備
string
。 任意。
UseStagingDeployment = false && Action != Delete Staging Deployment
するときに使用します。
このタスクを適用する デプロイメント 。 ブルーグリーンデプロイメントを使用していない場合は、このフィールドを default
に設定します。 値は文字で始まり、小文字と数字のみで構成されている必要があります。
Package
-
パッケージまたはフォルダー
string
。 任意。
Action = Deploy && DeploymentType = Artifacts
するときに使用します。 既定値: $(System.DefaultWorkingDirectory)/**/*.jar
。
Azure Spring Apps アプリのコンテンツ (Java の場合は .jar
1 ファイル、.NET Core の場合は .zip
) を含むパッケージまたはフォルダーへのファイル パス。
変数 ( ビルド | リリース) とワイルドカードがサポートされています。
たとえば、$(System.DefaultWorkingDirectory)/**/*.jar
のように指定します。
Package
-
パッケージまたはフォルダー
string
。 任意。
Action = Deploy
するときに使用します。 既定値: $(System.DefaultWorkingDirectory)/**/*.jar
。
Azure Spring Apps アプリのコンテンツ (Java の場合は .jar
1 ファイル、.NET Core の場合は .zip
) を含むパッケージまたはフォルダーへのファイル パス。
変数 ( ビルド | リリース) とワイルドカードがサポートされています。
たとえば、$(System.DefaultWorkingDirectory)/**/*.jar
のように指定します。
Builder
-
ビルダ
string
。 任意。
Action = Deploy && DeploymentType = Artifacts
するときに使用します。
VMware Tanzu® Build Service™ のビルダーを選択すると、エンタープライズ レベルで使用できます。
詳細については、「 Tanzu Build Service を使用する」を参照してください。
RegistryServer
-
レジストリサーバー
string
。 任意。
Action = Deploy && DeploymentType = CustomContainer
するときに使用します。 既定値: docker.io
。
コンテナー イメージのレジストリ。 デフォルト: docker.io。
RegistryUsername
-
レジストリユーザー名
string
。 任意。
Action = Deploy && DeploymentType = CustomContainer
するときに使用します。
コンテナー レジストリのユーザー名です。
RegistryPassword
-
レジストリ パスワードの
string
。 任意。
Action = Deploy && DeploymentType = CustomContainer
するときに使用します。
コンテナー レジストリのパスワード。
ImageName
-
イメージ名とタグ
string
。 任意。
Action = Deploy && DeploymentType = CustomContainer
するときに使用します。 既定値: hello-world:v1
。
コンテナー イメージ タグ。
ImageCommand
-
画像コマンド
string
。 任意。
Action = Deploy && DeploymentType = CustomContainer
するときに使用します。
コンテナー イメージのコマンド。
ImageArgs
-
画像の引数
string
。 任意。
Action = Deploy && DeploymentType = CustomContainer
するときに使用します。
コンテナー イメージの引数。
ImageLanguageFramework
-
言語フレームワーク
string
。 任意。
Action = Deploy && DeploymentType = CustomContainer
するときに使用します。 使用できる値: springboot
。
EnvironmentVariables
-
環境変数の
string
。 任意。
Action = Deploy
するときに使用します。
構文 -key value
を使用して入力する環境変数 (例: -CUSTOMER_NAME Contoso
-WEBSITE_TIME_ZONE
)。 スペースを含む値は、二重引用符で囲む必要があります (例: "Eastern Standard Time"
)。
JvmOptions
-
JVMオプション
string
。 任意。
Action = Deploy && DeploymentType = Artifacts
するときに使用します。
アプリのJVMオプションを編集します。 JVM オプション ( -Xms1024m -Xmx2048m
など) を含む文字列。
JvmOptions
-
JVMオプション
string
。 任意。
Action = Deploy
するときに使用します。
アプリのJVMオプションを編集します。 JVM オプション ( -Xms1024m -Xmx2048m
など) を含む文字列。
RuntimeVersion
-
ランタイムバージョン
string
。 任意。
Action = Deploy && DeploymentType = Artifacts
するときに使用します。 使用できる値: Java_8
(Java 8)、 Java_11
(Java 11)、 Java_17
(Java 17)、 Java_21
(Java 21)、 NetCore_31
(.Net Core 3.1)。 既定値: Java_11
。
アプリが実行されるランタイム バージョン。
RuntimeVersion
-
ランタイムバージョン
string
。 任意。
Action = Deploy && DeploymentType = Artifacts
するときに使用します。 使用できる値: Java_8
(Java 8)、 Java_11
(Java 11)、 NetCore_31
(.Net Core 3.1)。 既定値: Java_11
。
アプリが実行されるランタイム バージョン。
RuntimeVersion
-
ランタイムバージョン
string
。 任意。
Action = Deploy
するときに使用します。 使用できる値: Java_8
(Java 8)、 Java_11
(Java 11)、 NetCore_31
(.Net Core 3.1)。 既定値: Java_11
。
アプリが実行されるランタイム バージョン。
DotNetCoreMainEntryPath
-
メインエントリパス
string
。 任意。
RuntimeVersion = NetCore_31
するときに使用します。
zip ルートを基準とした .NET 実行可能ファイルへの相対パス。
Version
-
バージョン
string
。 任意。
Action = Deploy
するときに使用します。
デプロイメント・バージョン。 設定されていない場合、バージョンは変更されません。
タスク コントロールのオプション
すべてのタスクには、タスク入力に加えて制御オプションがあります。 詳細については、「コントロール オプションと一般的なタスク プロパティを参照してください。
出力変数
このタスクでは、次の 出力変数を定義します。この変数は、ダウンストリームのステップ、ジョブ、およびステージで使用できます。
testEndpoint
「デプロイ」アクションの後のみ。 更新されたデプロイメントにアクセスするためのプライベートURLが含まれています。
注釈
このタスクを使用して、アプリケーションを Azure Spring Apps にデプロイし、Azure Spring Cloud のデプロイを管理します。
Von Bedeutung
このタスクは、 Azure Spring Apps の Basic/Standard プランと Enterprise プランでサポートされています。 詳細については、「 Azure Spring Apps へのアプリケーションのデプロイを自動化する」を参照してください。
例示
次の例は、一般的な使用シナリオを示しています。 詳細については、「 Azure Spring Apps へのアプリケーションのデプロイを自動化する」を参照してください。
ステージング環境のデプロイを削除する
「ステージングデプロイメントの削除」アクションを使用すると、本番トラフィックを受け取らないデプロイメントを削除できます。 これにより、そのデプロイメントで使用されていたリソースが解放され、新しいステージング・デプロイメントのためのスペースが確保されます。
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
展開
運用環境
次の例では、Azure Spring Apps の既定の運用デプロイにデプロイします。 これは、Basic SKU を使用する場合に考えられる唯一のデプロイ シナリオです。
注
パッケージ検索パターンは、1 つのパッケージのみを返す必要があります。 ビルド タスクで sources.jar と javadoc.jar などの複数の JAR パッケージが生成される場合は、アプリケーションのバイナリ成果物にのみ一致するように検索パターンを絞り込む必要があります。
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'
ブルーグリーン
次の例では、既存のステージングデプロイメントにデプロイします。 このデプロイメントは、本番デプロイメントとして設定されるまで、本番トラフィックを受信しません。
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'
代替アプローチを含む Blue-Green デプロイの詳細については、「 Blue-Green デプロイ戦略」を参照してください。
新規運用環境の設定
次の例では、現在のステージング デプロイを運用として設定し、運用トラフィックを受信するデプロイを効果的にスワップします。
variables:
azureSubscription: Contoso
steps:
- task: AzureSpringCloud@0
inputs:
azureSubscription: $(azureSubscription)
Action: 'Set Production'
AzureSpringCloud: contoso-dev-az-spr-cld
AppName: customer-api
UseStagingDeployment: true