Search code examples
azure-resource-managerazure-rm-template

pass value from one step into the next step in ARM deployment


I’m using ARM template deployment to create resources.

As part of the deployment (at a given step), I need to use a secret from an existing keyvault.

Is there a way to fetch that data at one step and pass it to the next step that needs that data?


Solution

  • You can use the Key Vault Secret in ARM Template by using something similar to below example:

    "adminPassword": {
        "reference": {
            "keyVault": {
                "id": "/subscriptions/<SubscriptionID>/resourceGroups/<KeyVaultRG>/providers/Microsoft.KeyVault/vaults/<KeyVaultName>"
            },
            "secretName": "vmAdminPassword"
        }
    }