チュートリアル: テンプレート スペックの Azure portal フォームを作成する

ユーザーがテンプレート スペックをデプロイするのを支援するために、Azure portal に表示されるフォームを作成できます。このフォームによって、ユーザーは、テンプレート スペックにパラメーターとして渡される値を入力できます。

テンプレート スペックを作成する場合、フォームと Azure Resource Manager テンプレート (ARM テンプレート) を一緒にパッケージ化します。 ポータルを使用してテンプレート スペックをデプロイすると、フォームが自動的に起動します。

次のスクリーンショットは、Azure portal で開かれたフォームを示しています。

テンプレート スペックに値を入力する、Azure portal フォームのスクリーンショット。

前提条件

アクティブなサブスクリプションが含まれる Azure アカウント。 無料でアカウントを作成できます

Azure PowerShell の場合は、バージョン 6.0.0 以降を使用します。 Azure CLI の場合は、バージョン 2.24.0 以降を使用します。

テンプレートの作成

フォームで使用できるさまざまなポータル要素を表示するために、いくつかのパラメーターを含む ARM テンプレートを使用します。 次のテンプレートでは、キー コンテナーが作成され、ユーザーのキー コンテナーへのアクセス許可が構成され、シークレットが追加されます。

このファイルをコピーし、ローカルに保存します。 このチュートリアルでは、これに keyvault.json という名前を付けたことを前提としていますが、任意の名前を付けることができます。

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "keyVaultName": {
      "type": "string",
      "metadata": {
        "description": "Specifies the name of the key vault."
      }
    },
    "location": {
      "type": "string",
      "defaultValue": "[resourceGroup().location]",
      "metadata": {
        "description": "Specifies the Azure location where the key vault should be created."
      }
    },
    "enabledForDeployment": {
      "type": "bool",
      "defaultValue": false,
      "allowedValues": [
        true,
        false
      ],
      "metadata": {
        "description": "Specifies whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from the key vault."
      }
    },
    "enabledForDiskEncryption": {
      "type": "bool",
      "defaultValue": false,
      "allowedValues": [
        true,
        false
      ],
      "metadata": {
        "description": "Specifies whether Azure Disk Encryption is permitted to retrieve secrets from the vault and unwrap keys."
      }
    },
    "enabledForTemplateDeployment": {
      "type": "bool",
      "defaultValue": false,
      "allowedValues": [
        true,
        false
      ],
      "metadata": {
        "description": "Specifies whether Azure Resource Manager is permitted to retrieve secrets from the key vault."
      }
    },
    "tenantId": {
      "type": "string",
      "defaultValue": "[subscription().tenantId]",
      "metadata": {
        "description": "Specifies the Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. Get it by using Get-AzSubscription cmdlet."
      }
    },
    "objectId": {
      "type": "string",
      "metadata": {
        "description": "Specifies the object ID of a user, service principal or security group in the Azure Active Directory tenant for the vault. The object ID must be unique for the list of access policies. Get it by using Get-AzADUser or Get-AzADServicePrincipal cmdlets."
      }
    },
    "keysPermissions": {
      "type": "array",
      "defaultValue": [
        "list"
      ],
      "metadata": {
        "description": "Specifies the permissions to keys in the vault. Valid values are: all, encrypt, decrypt, wrapKey, unwrapKey, sign, verify, get, list, create, update, import, delete, backup, restore, recover, and purge."
      }
    },
    "secretsPermissions": {
      "type": "array",
      "defaultValue": [
        "list"
      ],
      "metadata": {
        "description": "Specifies the permissions to secrets in the vault. Valid values are: all, get, list, set, delete, backup, restore, recover, and purge."
      }
    },
    "skuName": {
      "type": "string",
      "defaultValue": "standard",
      "allowedValues": [
        "standard",
        "premium"
      ],
      "metadata": {
        "description": "Specifies whether the key vault is a standard vault or a premium vault."
      }
    },
    "secretName": {
      "type": "string",
      "metadata": {
        "description": "Specifies the name of the secret that you want to create."
      }
    },
    "secretValue": {
      "type": "secureString",
      "metadata": {
        "description": "Specifies the value of the secret that you want to create."
      }
    }
  },
  "resources": [
    {
      "type": "Microsoft.KeyVault/vaults",
      "apiVersion": "2022-07-01",
      "name": "[parameters('keyVaultName')]",
      "location": "[parameters('location')]",
      "properties": {
        "enabledForDeployment": "[parameters('enabledForDeployment')]",
        "enabledForDiskEncryption": "[parameters('enabledForDiskEncryption')]",
        "enabledForTemplateDeployment": "[parameters('enabledForTemplateDeployment')]",
        "tenantId": "[parameters('tenantId')]",
        "accessPolicies": [
          {
            "objectId": "[parameters('objectId')]",
            "tenantId": "[parameters('tenantId')]",
            "permissions": {
              "keys": "[parameters('keysPermissions')]",
              "secrets": "[parameters('secretsPermissions')]"
            }
          }
        ],
        "sku": {
          "name": "[parameters('skuName')]",
          "family": "A"
        },
        "networkAcls": {
          "defaultAction": "Allow",
          "bypass": "AzureServices"
        }
      }
    },
    {
      "type": "Microsoft.KeyVault/vaults/secrets",
      "apiVersion": "2022-07-01",
      "name": "[format('{0}/{1}', parameters('keyVaultName'), parameters('secretName'))]",
      "dependsOn": [
        "[resourceId('Microsoft.KeyVault/vaults', parameters('keyVaultName'))]"
      ],
      "properties": {
        "value": "[parameters('secretValue')]"
      }
    }
  ]
}

既定のフォームを作成する

Azure portal には、フォームを作成およびプレビューするためのサンドボックスが備わっています。 このサンドボックスで、既存の ARM テンプレートからフォームを表示できます。 この既定のフォームを使用して、テンプレート スペックのフォームの作成を開始します。フォームの構造について詳しくは、「FormViewType」を参照してください。

  1. フォーム ビューのサンドボックスを開きます。

    Azure portal [フォーム ビューのサンドボックス] インターフェイスのスクリーンショット。

  2. [パッケージの種類][CustomTemplate] (カスタム テンプレート) を選択します。 デプロイ テンプレートを指定する前に、必ずパッケージの種類を選択してください。

  3. [Deployment template (optional)] (デプロイ テンプレート (オプション)) で、ローカルに保存したキー コンテナー テンプレートを選択します。 現在の変更を上書きするかどうかを確認するメッセージが表示されたら、 [はい] を選択します。 自動生成されたフォームがコード ウィンドウに表示されます。 フォームはポータルから編集できます。 フォームをカスタマイズするには、「フォームをカスタマイズする」を参照してください。 自動生成されたフォームをよく見ると、既定のタイトルは [Test Form View] (テスト フォーム ビュー) となっており、[basics] (基本) というステップが 1 つだけ定義されています。

    {
      "$schema": "https://schema.management.azure.com/schemas/2021-09-09/uiFormDefinition.schema.json",
      "view": {
        "kind": "Form",
        "properties": {
          "title": "Test Form View",
          "steps": [
            {
              "name": "basics",
              "label": "Basics",
              "elements": [
                ...
              ]
            }
          ]
        },
        "outputs": {
          ...
        }
      }
    }
    
  4. 変更を行わずに動作を確認するには、 [プレビュー] を選択します。

    生成された基本 Azure portal フォームのスクリーンショット。

    サンドボックスにフォームが表示されます。 サブスクリプション、リソース グループ、リージョンを選択するためのフィールドがあります。 また、テンプレートのすべてのパラメーターのフィールドもあります。

    ほとんどのフィールドはテキスト ボックスですが、一部のフィールドはパラメーターの型に固有のものです。 テンプレートにパラメーターの許可値が含まれる場合、自動生成されるフォームではドロップダウン要素が使用されます。 このドロップダウン要素には、有効な値が事前に設定されます。

    タイトルと [プロジェクトの詳細] の間にはタブがありません。これは、既定のフォームでは、ステップが 1 つしか定義されていないためです。 [フォームをカスタマイズする] セクションで、パラメーターを複数のタブに振り分けます。

    警告

    [作成] を選択すると、実際のデプロイが開始されるため、これは選択しないでください。 このチュートリアルの後半に、テンプレート スペックをデプロイする機会があります。

  5. プレビューを終了するには、[キャンセル] を選択します。

フォームをカスタマイズする

既定のフォームは、フォームを理解するための適切な出発点ですが、通常はカスタマイズする必要があります。 サンドボックス内または Visual Studio Code 内でこれを編集できます。 プレビュー オプションは、サンドボックスでのみ使用できます。

  1. フォームに、その使用方法を表すタイトルを付けます。

    {
      "$schema": "https://schema.management.azure.com/schemas/2021-09-09/uiFormDefinition.schema.json#",
      "view": {
        "kind": "Form",
        "properties": {
          "title": "Key Vault and secret",
    
  2. 既定のフォームでは、テンプレートのすべてのフィールドが、Basics という 1 つのステップに結合されています。 ユーザーが、自分で指定する値を理解できるようにするために、フォームを複数のステップに分割します。 各ステップには、デプロイするソリューションの論理部分に関連するフィールドを含めます。

    Basics というラベルのステップを見つけます。 このステップは保持し、その下にステップを追加します。 新しいステップでは、キー コンテナーの構成、ユーザー アクセス許可の設定、シークレットの指定に重点を置きます。 Basics ステップの後にコンマを追加する必要があります。

    {
      "$schema": "https://schema.management.azure.com/schemas/2021-09-09/uiFormDefinition.schema.json#",
      "view": {
        "kind": "Form",
        "properties": {
          "title": "Key Vault and secret",
          "steps": [
            {
              "name": "basics",
              "label": "Basics",
              "elements": [
                ...
              ]
            },
            {
              "name": "keyvault",
              "label": "Key Vault",
              "elements": [
              ]
            },
            {
              "name": "permissions",
              "label": "Permissions",
              "elements": [
              ]
            },
            {
              "name": "secret",
              "label": "Secret",
              "elements": [
              ]
            }
          ]
        },
        "outputs": {
          ...
        }
      }
    }
    

    重要

    フォームのプロパティでは、大文字と小文字が区別されます。 例に示されている大文字と小文字を使用してください。

  3. [Preview](プレビュー) を選択します。 ステップが表示されますが、そのほとんどに要素はありません。

    複数の手順を示した Azure portal のスクリーンショット。

  4. 次に、要素を適切なステップに移動します。 Secret Name および Secret Value というラベルの要素から開始します。 これらの要素を Basics ステップから削除し、Secret ステップに追加します。

    {
      "name": "secret",
      "label": "Secret",
      "elements": [
      {
          "name": "secretName",
          "type": "Microsoft.Common.TextBox",
          "label": "Secret Name",
          "defaultValue": "",
          "toolTip": "Specifies the name of the secret that you want to create.",
          "constraints": {
            "required": true,
            "regex": "",
            "validationMessage": ""
          },
          "visible": true
        },
        {
          "name": "secretValue",
          "type": "Microsoft.Common.PasswordBox",
          "label": {
            "password": "Secret Value",
            "confirmPassword": "Confirm password"
          },
          "toolTip": "Specifies the value of the secret that you want to create.",
          "constraints": {
            "required": true,
            "regex": "",
            "validationMessage": ""
          },
          "options": {
            "hideConfirmation": true
          },
          "visible": true
        }
      ]
    }
    
  5. 要素を移動するとき、outputs セクションを修正する必要があります。 現時点で、outputs セクションでは、これらの要素が Basics ステップ内にまだあるものとして参照されます。 secret ステップ内の要素を参照するように構文を修正します。

    "outputs": {
      "parameters": {
        ...
        "secretName": "[steps('secret').secretName]",
        "secretValue": "[steps('secret').secretValue]"
      }
    
  6. 引き続き、要素を適切なステップに移動します。 それぞれを確認するのではなく、更新されたフォーム全体を確認します。

    {
      "$schema": "https://schema.management.azure.com/schemas/2021-09-09/uiFormDefinition.schema.json#",
      "view": {
        "kind": "Form",
        "properties": {
          "title": "Key Vault and secret",
          "steps": [
            {
              "name": "basics",
              "label": "Basics",
              "elements": [
                {
                  "name": "resourceScope",
                  "type": "Microsoft.Common.ResourceScope",
                  "location": {
                    "resourceTypes": [
                      "microsoft.resources/resourcegroups"
                    ]
                  }
                }
              ]
            },
            {
              "name": "keyvault",
              "label": "Key Vault",
              "elements": [
                {
                  "name": "keyVaultName",
                  "type": "Microsoft.Common.TextBox",
                  "label": "Key Vault Name",
                  "defaultValue": "",
                  "toolTip": "Specifies the name of the key vault.",
                  "constraints": {
                    "required": true,
                    "regex": "",
                    "validationMessage": ""
                  },
                  "visible": true
                },
                {
                  "name": "skuName",
                  "type": "Microsoft.Common.DropDown",
                  "label": "Sku Name",
                  "defaultValue": "Standard",
                  "toolTip": "Specifies whether the key vault is a standard vault or a premium vault.",
                  "constraints": {
                    "required": false,
                    "allowedValues": [
                      {
                        "label": "Standard",
                        "value": "Standard"
                      },
                      {
                        "label": "Premium",
                        "value": "Premium"
                      }
                    ]
                  },
                  "visible": true
                },
                {
                  "name": "location",
                  "type": "Microsoft.Common.TextBox",
                  "label": "Location",
                  "defaultValue": "[[resourceGroup().location]",
                  "toolTip": "Specifies the Azure location where the key vault should be created.",
                  "constraints": {
                    "required": false,
                    "regex": "",
                    "validationMessage": ""
                  },
                  "visible": true
                },
                {
                  "name": "enabledForDeployment",
                  "type": "Microsoft.Common.DropDown",
                  "label": "Enabled For Deployment",
                  "defaultValue": "false",
                  "toolTip": "Specifies whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from the key vault.",
                  "constraints": {
                    "required": false,
                    "allowedValues": [
                      {
                        "label": "true",
                        "value": true
                      },
                      {
                        "label": "false",
                        "value": false
                      }
                    ]
                  },
                  "visible": true
                },
                {
                  "name": "enabledForDiskEncryption",
                  "type": "Microsoft.Common.DropDown",
                  "label": "Enabled For Disk Encryption",
                  "defaultValue": "false",
                  "toolTip": "Specifies whether Azure Disk Encryption is permitted to retrieve secrets from the vault and unwrap keys.",
                  "constraints": {
                    "required": false,
                    "allowedValues": [
                      {
                        "label": "true",
                        "value": true
                      },
                      {
                        "label": "false",
                        "value": false
                      }
                    ]
                  },
                  "visible": true
                },
                {
                  "name": "enabledForTemplateDeployment",
                  "type": "Microsoft.Common.DropDown",
                  "label": "Enabled For Template Deployment",
                  "defaultValue": "false",
                  "toolTip": "Specifies whether Azure Resource Manager is permitted to retrieve secrets from the key vault.",
                  "constraints": {
                    "required": false,
                    "allowedValues": [
                      {
                        "label": "true",
                        "value": true
                      },
                      {
                        "label": "false",
                        "value": false
                      }
                    ]
                  },
                  "visible": true
                }
              ]
            },
            {
              "name": "permissions",
              "label": "Permissions",
              "elements": [
                {
                  "name": "tenantId",
                  "type": "Microsoft.Common.TextBox",
                  "label": "Tenant Id",
                  "defaultValue": "[[subscription().tenantId]",
                  "toolTip": "Specifies the Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. Get it by using Get-AzSubscription cmdlet.",
                  "constraints": {
                    "required": false,
                    "regex": "",
                    "validationMessage": ""
                  },
                  "visible": true
                },
                {
                  "name": "objectId",
                  "type": "Microsoft.Common.TextBox",
                  "label": "Object Id",
                  "defaultValue": "",
                  "toolTip": "Specifies the object ID of a user, service principal or security group in the Azure Active Directory tenant for the vault. The object ID must be unique for the list of access policies. Get it by using Get-AzADUser or Get-AzADServicePrincipal cmdlets.",
                  "constraints": {
                    "required": true,
                    "regex": "",
                    "validationMessage": ""
                  },
                  "visible": true
                },
                {
                  "name": "keysPermissions",
                  "type": "Microsoft.Common.TextBox",
                  "label": "Keys Permissions",
                  "defaultValue": "[[\"list\"]",
                  "toolTip": "Specifies the permissions to keys in the vault. Valid values are: all, encrypt, decrypt, wrapKey, unwrapKey, sign, verify, get, list, create, update, import, delete, backup, restore, recover, and purge.",
                  "constraints": {
                    "required": false,
                    "regex": "",
                    "validationMessage": ""
                  },
                  "visible": true
                },
                {
                  "name": "secretsPermissions",
                  "type": "Microsoft.Common.TextBox",
                  "label": "Secrets Permissions",
                  "defaultValue": "[[\"list\"]",
                  "toolTip": "Specifies the permissions to secrets in the vault. Valid values are: all, get, list, set, delete, backup, restore, recover, and purge.",
                  "constraints": {
                    "required": false,
                    "regex": "",
                    "validationMessage": ""
                  },
                  "visible": true
                }
              ]
            },
            {
              "name": "secret",
              "label": "Secret",
              "elements": [
                {
                  "name": "secretName",
                  "type": "Microsoft.Common.TextBox",
                  "label": "Secret Name",
                  "defaultValue": "",
                  "toolTip": "Specifies the name of the secret that you want to create.",
                  "constraints": {
                    "required": true,
                    "regex": "",
                    "validationMessage": ""
                  },
                  "visible": true
                },
                {
                  "name": "secretValue",
                  "type": "Microsoft.Common.PasswordBox",
                  "label": {
                    "password": "Secret Value",
                    "confirmPassword": "Confirm password"
                  },
                  "toolTip": "Specifies the value of the secret that you want to create.",
                  "constraints": {
                    "required": true,
                    "regex": "",
                    "validationMessage": ""
                  },
                  "options": {
                    "hideConfirmation": true
                  },
                  "visible": true
                }
              ]
            }
          ]
        },
        "outputs": {
          "parameters": {
            "keyVaultName": "[steps('keyvault').keyVaultName]",
            "location": "[steps('keyvault').location]",
            "enabledForDeployment": "[steps('keyvault').enabledForDeployment]",
            "enabledForDiskEncryption": "[steps('keyvault').enabledForDiskEncryption]",
            "enabledForTemplateDeployment": "[steps('keyvault').enabledForTemplateDeployment]",
            "tenantId": "[steps('permissions').tenantId]",
            "objectId": "[steps('permissions').objectId]",
            "keysPermissions": "[steps('permissions').keysPermissions]",
            "secretsPermissions": "[steps('permissions').secretsPermissions]",
            "skuName": "[steps('keyvault').skuName]",
            "secretName": "[steps('secret').secretName]",
            "secretValue": "[steps('secret').secretValue]"
          },
          "kind": "ResourceGroup",
          "location": "[steps('basics').resourceScope.location.name]",
          "resourceGroupId": "[steps('basics').resourceScope.resourceGroup.id]"
        }
      }
    }
    
  7. このファイルを keyvaultform.json という名前でローカルに保存します。

テンプレート スペックを作成する

テンプレート スペックを作成するとき、両方のファイルを指定します。

PowerShell の場合、New-AzTemplateSpec を使用し、-UIFormDefinitionFile パラメーターでフォームを指定します。

New-AzTemplateSpec `
  -name keyvaultspec `
  -version 1 `
  -ResourceGroupName templateSpecRG `
  -location westus2 `
  -templatefile keyvault.json `
  -UIFormDefinitionFile keyvaultform.json

Azure CLI の場合、az ts create を使用し、--ui-form-definition パラメーターでフォームを指定します。

az ts create \
  --name keyvaultspec \
  --version 1 \
  --resource-group templatespecRG \
  --location westus2 \
  --template-file keyvault.json \
  --ui-form-definition keyvaultform.json

ポータルを使用してデプロイする

フォームをテストするには、ポータルに移動し、テンプレート スペックに移動します。 [デプロイ] を選択します。

[デプロイ] オプションが強調表示された、Azure テンプレート スペック概要のスクリーンショット。

作成したフォームが表示されます。 ステップを実行し、フィールドの値を指定します。

Basics ステップで、Region のフィールドが表示されます。 このフィールドは、リソース グループの場所のために使用されます。 Key Vault ステップで、Location のフィールドが表示されます。 このフィールドは、キー コンテナーの場所のために使用されます。

Permissions ステップで、オブジェクト ID に対して自分のユーザー ID を指定できます。 キーとシークレットのアクセス許可に対して既定値 (["list"]) を使用します。 次のセクションで、このオプションを改善します。

値の指定が終了したら、 [作成] を選択してテンプレート スペックをデプロイします。

フォームを改善する

前のセクションでは、ステップを追加し、要素を移動しましたが、既定の動作は変更しませんでした。 このセクションでは、テンプレート スペックのユーザー エクスペリエンスを向上させる変更を行います。

これまで 2 つのアクセス許可フィールドはテキスト ボックスでした。 ここでは、ドロップダウンを使用します。 タイプを Microsoft.Common.DropDown に設定します。

以下を更新します。keysPermissions:

{
  "name": "keysPermissions",
  "type": "Microsoft.Common.DropDown",

および secretsPermissions:

{
  "name": "secretsPermissions",
  "type": "Microsoft.Common.DropDown",

これらのフィールドでは、配列をテンプレートに渡す必要があります。 通常のドロップダウンは、1 つの値しか選択できないため機能しません。 複数の値を選択し、それらを配列として渡すために、multiselect フィールドを追加し、true に設定します。

{
  "name": "keysPermissions",
  "type": "Microsoft.Common.DropDown",
  "label": "Keys Permissions",
  "multiselect": true,
{
  "name": "secretsPermissions",
  "type": "Microsoft.Common.DropDown",
  "label": "Secrets Permissions",
  "multiselect": true,

最後に、ドロップダウンの許可値と既定値を指定する必要があります。

{
  "name": "keysPermissions",
  "type": "Microsoft.Common.DropDown",
  "label": "Keys Permissions",
  "multiselect": true,
  "defaultValue":{
    "value": "list"
  },
  "toolTip": "Specifies the permissions to keys in the vault. Valid values are: all, encrypt, decrypt, wrapKey, unwrapKey, sign, verify, get, list, create, update, import, delete, backup, restore, recover, and purge.",
  "constraints": {
    "required": false,
    "allowedValues":[
      {
        "label": "all",
        "value": "all"
      },
      {
        "label": "encrypt",
        "value": "encrypt"
      },
      {
        "label": "decrypt",
        "value": "decrypt"
      },
      {
        "label": "list",
        "value": "list"
      },
      {
        "label": "delete",
        "value": "delete"
      },
      {
        "label": "backup",
        "value": "backup"
      },
      {
        "label": "restore",
        "value": "restore"
      },
      {
        "label": "recover",
        "value": "recover"
      },
      {
        "label": "purge",
        "value": "purge"
      },
      {
        "label": "wrapKey",
        "value": "wrapKey"
      },
      {
        "label": "unwrapKey",
        "value": "unwrapKey"
      },
      {
        "label": "sign",
        "value": "sign"
      },
      {
        "label": "verify",
        "value": "verify"
      },
      {
        "label": "get",
        "value": "get"
      },
      {
        "label": "create",
        "value": "create"
      },
      {
        "label": "update",
        "value": "update"
      },
      {
        "label": "import",
        "value": "import"
      }
    ]
  },
  "visible": true
},
{
  "name": "secretsPermissions",
  "type": "Microsoft.Common.DropDown",
  "label": "Secrets Permissions",
  "multiselect": true,
  "defaultValue":{
    "value": "list"
  },
  "toolTip": "Specifies the permissions to secrets in the vault. Valid values are: all, get, list, set, delete, backup, restore, recover, and purge.",
  "constraints": {
    "required": false,
    "allowedValues":[
      {
        "label": "all",
        "value": "all"
      },
      {
        "label": "get",
        "value": "get"
      },
      {
        "label": "list",
        "value": "list"
      },
      {
        "label": "set",
        "value": "set"
      },
      {
        "label": "delete",
        "value": "delete"
      },
      {
        "label": "backup",
        "value": "backup"
      },
      {
        "label": "restore",
        "value": "restore"
      },
      {
        "label": "recover",
        "value": "recover"
      },
      {
        "label": "purge",
        "value": "purge"
      }
    ]
  },
  "visible": true
}

テンプレート スペックの新しいバージョンを作成します。

PowerShell の場合:

New-AzTemplateSpec `
  -name keyvaultspec `
  -version 2 `
  -ResourceGroupName templateSpecRG `
  -location westus2 `
  -templatefile keyvault.json `
  -UIFormDefinitionFile keyvaultform.json

Azure CLI の場合:

az ts create \
  --name keyvaultspec \
  --version 2 \
  --resource-group templatespecRG \
  --location westus2 \
  --template-file keyvault.json \
  --ui-form-definition keyvaultform.json

改善されたポータル フォームを使用してテンプレート スペックを再デプロイします。

テンプレート スペックに値を入力する、Azure portal フォームのスクリーンショット。

これで、アクセス許可のフィールドは、複数の値が許可されるドロップダウンになりました。

次のステップ

テンプレート スペックをリンクされたテンプレートとしてデプロイする方法の詳細については、「チュートリアル:テンプレート スペックをリンクされたテンプレートとしてデプロイする」を参照してください。