次の方法で共有


AzureResourceManagerTemplateDeployment@3 - ARM テンプレートのデプロイ v3 タスク

このタスクを使用して、Azure Resource Manager (ARM) テンプレートをすべてのデプロイ スコープにデプロイします。

構文

# ARM template deployment v3
# Deploy an Azure Resource Manager (ARM) template to all the deployment scopes.
- task: AzureResourceManagerTemplateDeployment@3
  inputs:
  # Azure Details
    deploymentScope: 'Resource Group' # 'Management Group' | 'Subscription' | 'Resource Group'. Required. Deployment scope. Default: Resource Group.
    azureResourceManagerConnection: # string. Alias: ConnectedServiceName. Required. Azure Resource Manager connection. 
    #subscriptionId: # string. Alias: subscriptionName. Required when deploymentScope != Management Group. Subscription. 
    #action: 'Create Or Update Resource Group' # 'Create Or Update Resource Group' | 'DeleteRG'. Required when deploymentScope = Resource Group. Action. Default: Create Or Update Resource Group.
    #resourceGroupName: # string. Required when deploymentScope = Resource Group. Resource group. 
    #location: # string. Required when action = Create Or Update Resource Group || deploymentScope != Resource Group. Location. 
  # Template
    #templateLocation: 'Linked artifact' # 'Linked artifact' | 'URL of the file'. Required when action = Create Or Update Resource Group || deploymentScope != Resource Group. Template location. Default: Linked artifact.
    #csmFileLink: # string. Required when (action = Create Or Update Resource Group || deploymentScope != Resource Group) && templateLocation = URL of the file. Template link. 
    #csmParametersFileLink: # string. Optional. Use when (action = Create Or Update Resource Group || deploymentScope != Resource Group) && templateLocation = URL of the file. Template parameters link. 
    #csmFile: # string. Required when (action = Create Or Update Resource Group || deploymentScope != Resource Group) && templateLocation = Linked artifact. Template. 
    #csmParametersFile: # string. Optional. Use when (action = Create Or Update Resource Group || deploymentScope != Resource Group) && templateLocation = Linked artifact. Template parameters. 
    #overrideParameters: # string. Optional. Use when action = Create Or Update Resource Group || deploymentScope != Resource Group. Override template parameters. 
    #deploymentMode: 'Incremental' # 'Incremental' | 'Complete' | 'Validation'. Required when action = Create Or Update Resource Group || deploymentScope != Resource Group. Deployment mode. Default: Incremental.
  # Advanced
    #deploymentName: # string. Optional. Use when action = Create Or Update Resource Group || deploymentScope != Resource Group. Deployment name. 
    #deploymentOutputs: # string. Optional. Use when action = Create Or Update Resource Group || deploymentScope != Resource Group. Deployment outputs. 
    #addSpnToEnvironment: false # boolean. Optional. Use when action = Create Or Update Resource Group || deploymentScope != Resource Group. Access service principal details in override parameters. Default: false.
    #useWithoutJSON: false # boolean. Optional. Use when action = Create Or Update Resource Group || deploymentScope != Resource Group. Use individual output values without JSON.Stringify applied. Default: false.
# ARM template deployment v3
# Deploy an Azure Resource Manager (ARM) template to all the deployment scopes.
- task: AzureResourceManagerTemplateDeployment@3
  inputs:
  # Azure Details
    deploymentScope: 'Resource Group' # 'Management Group' | 'Subscription' | 'Resource Group'. Required. Deployment scope. Default: Resource Group.
    azureResourceManagerConnection: # string. Alias: ConnectedServiceName. Required. Azure Resource Manager connection. 
    #subscriptionId: # string. Alias: subscriptionName. Required when deploymentScope != Management Group. Subscription. 
    #action: 'Create Or Update Resource Group' # 'Create Or Update Resource Group' | 'DeleteRG'. Required when deploymentScope = Resource Group. Action. Default: Create Or Update Resource Group.
    #resourceGroupName: # string. Required when deploymentScope = Resource Group. Resource group. 
    #location: # string. Required when action = Create Or Update Resource Group || deploymentScope != Resource Group. Location. 
  # Template
    #templateLocation: 'Linked artifact' # 'Linked artifact' | 'URL of the file'. Required when action = Create Or Update Resource Group || deploymentScope != Resource Group. Template location. Default: Linked artifact.
    #csmFileLink: # string. Required when (action = Create Or Update Resource Group || deploymentScope != Resource Group) && templateLocation = URL of the file. Template link. 
    #csmParametersFileLink: # string. Optional. Use when (action = Create Or Update Resource Group || deploymentScope != Resource Group) && templateLocation = URL of the file. Template parameters link. 
    #csmFile: # string. Required when (action = Create Or Update Resource Group || deploymentScope != Resource Group) && templateLocation = Linked artifact. Template. 
    #csmParametersFile: # string. Optional. Use when (action = Create Or Update Resource Group || deploymentScope != Resource Group) && templateLocation = Linked artifact. Template parameters. 
    #overrideParameters: # string. Optional. Use when action = Create Or Update Resource Group || deploymentScope != Resource Group. Override template parameters. 
    #deploymentMode: 'Incremental' # 'Incremental' | 'Complete' | 'Validation'. Required when action = Create Or Update Resource Group || deploymentScope != Resource Group. Deployment mode. Default: Incremental.
  # Advanced
    #deploymentName: # string. Optional. Use when action = Create Or Update Resource Group || deploymentScope != Resource Group. Deployment name. 
    #deploymentOutputs: # string. Optional. Use when action = Create Or Update Resource Group || deploymentScope != Resource Group. Deployment outputs. 
    #addSpnToEnvironment: false # boolean. Optional. Use when action = Create Or Update Resource Group || deploymentScope != Resource Group. Access service principal details in override parameters. Default: false.

入力

deploymentScope - 展開スコープの
string. 必須。 使用できる値: Management GroupSubscriptionResource Group。 既定値: Resource Group.

デプロイのスコープ。 デプロイ スコープ の詳細について説明します。


Azure Resource Manager 接続azureResourceManagerConnection - する
入力エイリアス: ConnectedServiceNamestring. 必須。

選択したデプロイ スコープへのアクセス権を持つ Azure Resource Manager サービス接続を指定します。


subscriptionId - サブスクリプションの
入力エイリアス: subscriptionNamestring. deploymentScope != Management Groupする場合に必要です。

Azure サブスクリプションを指定します。

大事な

指定する値は、サブスクリプション名ではなく、サブスクリプション ID である必要があります。


action - アクションの
string. deploymentScope = Resource Groupする場合に必要です。 使用できる値: Create Or Update Resource GroupDeleteRG (リソース グループの削除)。 既定値: Create Or Update Resource Group.

Azure リソースまたはリソース グループに対して実行されるアクション。


resourceGroupName - リソース グループの
string. deploymentScope = Resource Groupする場合に必要です。

リソース グループの名前を提供します。


location - 場所の
string. action = Create Or Update Resource Group || deploymentScope != Resource Groupする場合に必要です。

リソース グループのデプロイ スコープ: リソース グループをデプロイする場所。 リソース グループが Azure サブスクリプションに既に存在する場合、この値は無視されます。 その他のデプロイ スコープ: デプロイ メタデータを格納する場所。


templateLocation - テンプレートの場所の
string. action = Create Or Update Resource Group || deploymentScope != Resource Groupする場合に必要です。 使用できる値: Linked artifactURL of the file。 既定値: Linked artifact.

テンプレートとパラメーター JSON ファイルの場所。 ファイル リンクされたコード/ビルド成果物の一部である場合は、リンクされた成果物 を選択します。 リンクされた成果物の場合は、Bicep ファイルへのパスを指定することもできます。 JSON ファイル パブリックにアクセスできる http/https URL に配置されている場合は、ファイルの URL を選択します。 プライベート ストレージ アカウントに格納されているファイルを使用するには、テンプレートの URL に Shared Access Signature (SAS) トークンを取得して含めます。 例: <blob_storage_url>/template.json?. パラメーター ファイルをストレージ アカウントにアップロードして SAS トークンを生成するには、Azure ファイル コピー タスク 使用するか、PowerShell を使用するか、Azure CLI する手順に従います。


csmFileLink - テンプレート リンク
string. (action = Create Or Update Resource Group || deploymentScope != Resource Group) && templateLocation = URL of the fileする場合に必要です。

テンプレート ファイルの URL を指定します。 URL の例: https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vm-simple-windows/azuredeploy.json

プライベート ストレージ アカウントに格納されているテンプレートをデプロイするには、テンプレートの URL に Shared Access Signature (SAS) トークンを取得して含めます。 例: <blob_storage_url>/template.json?<SAStoken>. テンプレート ファイル (またはリンクされたテンプレート) をストレージ アカウントにアップロードして SAS トークンを生成するには、Azure ファイル コピー タスクを使用するか、PowerShell を使用するか、Azure CLI する手順に従います。

テンプレート パラメーターをグリッドで表示するには、[テンプレート パラメーターのオーバーライド] テキスト ボックスの横にある ... をクリックします。 この機能を使用するには、ソースで CORS ルールが有効になっている必要があります。 テンプレートが Azure Storage BLOB 内にある場合は、「クロスオリジン リソース共有 を参照して CORS を有効にします。


csmParametersFileLink - テンプレート パラメーター リンク
string. 随意。 (action = Create Or Update Resource Group || deploymentScope != Resource Group) && templateLocation = URL of the fileするときに使用します。

パラメーター ファイルの URL を指定します。 URL の例: https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vm-simple-windows/azuredeploy.parameters.json

プライベート ストレージ アカウントに格納されているファイルを使用するには、テンプレートの URL に Shared Access Signature (SAS) トークンを取得して含めます。 例: <blob_storage_url>/template.json?<SAStoken>. テンプレート ファイル (またはリンクされたテンプレート) をストレージ アカウントにアップロードして SAS トークンを生成するには、Azure ファイル コピー タスクを使用するか、PowerShell を使用するか、Azure CLI する手順に従います。

テンプレート パラメーターをグリッドで表示するには、[テンプレート パラメーターのオーバーライド] テキスト ボックスの横にある ... をクリックします。 この機能を使用するには、ソースで CORS ルールが有効になっている必要があります。 テンプレートが Azure Storage BLOB 内にある場合は、「クロスオリジン リソース共有 を参照して CORS を有効にします。


csmFile - テンプレートの
string. (action = Create Or Update Resource Group || deploymentScope != Resource Group) && templateLocation = Linked artifactする場合に必要です。

Azure Resource Manager テンプレートを指すパスまたはパターンを指定します。 Azure Resource Manager テンプレート の詳細を確認します。 すぐに開始するには、このサンプル テンプレート 使用します。 Azure CLI バージョンが 2.20.0 > 場合、Bicep ファイルをサポートします。


csmParametersFile - テンプレート パラメーターの
string. 随意。 (action = Create Or Update Resource Group || deploymentScope != Resource Group) && templateLocation = Linked artifactするときに使用します。

Azure Resource Manager テンプレートのパラメーター ファイルのパスまたはパターンを指定します。 Azure CLI バージョンが 2.47.0 > 場合、Bicep Param ファイル をサポートします。


overrideParameters - テンプレート パラメーター をオーバーライドする
string. 随意。 action = Create Or Update Resource Group || deploymentScope != Resource Groupするときに使用します。

オーバーライドするテンプレート パラメーターを指定します。

グリッド内のテンプレート パラメーターを表示するには、[パラメーターのオーバーライド] ボックスの横にある ... をクリックします。 この機能を使用するには、ソースで CORS ルールが有効になっている必要があります。 テンプレートが Azure Storage BLOB 内にある場合は、この文字列を参照して CORS を有効にするか、テキスト ボックスにオーバーライドするテンプレート パラメーターを入力します。

例: -storageName fabrikam -adminUsername $(vmusername) -adminPassword (ConvertTo-SecureString -String '$(password)' -AsPlainText -Force) -azureKeyVaultName $(fabrikamFibre).

パラメーター値に複数の単語がある場合は、変数を使用して値を渡す場合でも、単語を引用符で囲みます。 たとえば、-name "parameter value" -name2 "$(var)"します。 オブジェクト型パラメーターをオーバーライドするには、文字列化された JSON オブジェクトを使用します。 たとえば、-options ["option1"] -map {"key1": "value1" }します。


deploymentMode - 展開モードの
string. action = Create Or Update Resource Group || deploymentScope != Resource Groupする場合に必要です。 使用できる値: IncrementalCompleteValidation (検証のみ)。 既定値: Incremental.

Incremental モードでは、デプロイがリソース グループの増分更新として処理されます。 リソース グループに存在するが、テンプレートでは指定されていない変更されていないリソースは残ります。

Complete モードでは、テンプレートに含まれていないリソースが削除されます。 完全モードは、増分モードよりも比較的時間がかかります。 タスクがタイムアウトになった場合は、タイムアウトを増やすか、Incremental モードに変更することを検討してください。

警告

完全モードでは、テンプレートで指定されていないリソース グループ内の既存のリソースがすべて削除されます。 デプロイするリソース グループに、テンプレートで指定されていない必要なリソースが含まれていないかどうかを確認します。 Validate モードでは、実際のリソースを作成する前に、テンプレートに関する問題を見つけることができます。

手記

Validate モードでは、リソースがデプロイされていない場合でも、常にリソース グループが作成されます。 展開モードの詳細については、を参照してください。


deploymentName - 展開名の
string. 随意。 action = Create Or Update Resource Group || deploymentScope != Resource Groupするときに使用します。

作成するリソース グループデプロイの名前を指定します。


deploymentOutputs - デプロイの出力
string. 随意。 action = Create Or Update Resource Group || deploymentScope != Resource Groupするときに使用します。

出力変数の変数の名前を指定します。この変数には、現在の配置オブジェクトの出力セクションが文字列形式で含まれています。 ConvertFrom-Json PowerShell コマンドレットを使用して JSON オブジェクトを解析し、個々の出力値にアクセスできます。 デプロイ出力 詳細を確認します。


addSpnToEnvironment - オーバーライド パラメーターのサービス プリンシパルの詳細
boolean. 随意。 action = Create Or Update Resource Group || deploymentScope != Resource Groupするときに使用します。 既定値: false.

スクリプトの実行環境として選択された Azure エンドポイントのサービス プリンシパル ID とキーを追加します。 変数 $servicePrincipalId$servicePrincipalKey は、-key $servicePrincipalKeyなどのオーバーライド パラメーターに含めることができます。


useWithoutJSON - JSON なしで個々の出力値を使用します。stringify applied
boolean. 随意。 action = Create Or Update Resource Group || deploymentScope != Resource Groupするときに使用します。 既定値: false.

個々の出力値は JSON 経由で変換されます。既定では文字列化されます。 JSON 経由で変換せずに出力値をそのまま使用する場合。Stringify、このオプションを有効にします。 詳細については、この 参照してください。


タスク コントロールのオプション

すべてのタスクには、タスク入力に加えて制御オプションがあります。 詳細については、「コントロール オプションと一般的なタスク プロパティを参照してください。

出力変数

何一つ。

備考

手記

このタスクは、Azure CLI バージョンが 2.20.0 > 場合に Bicep ファイルをサポートします。

  • すべてのデプロイ スコープでのデプロイのサポートを追加しました。
    • VM 関連のすべてのアクションを削除しました。

必要条件

要件 形容
パイプラインの種類 YAML、クラシック ビルド、クラシック リリース
実行日 エージェント、DeploymentGroup
の需要 何一つ
機能の このタスクは、ジョブ内の後続のタスクに対する要求を満たしていません。
コマンドの制限 任意
設定可能な変数 任意
エージェントのバージョン 2.119.1 以上
タスク カテゴリ 展開