QuestionQ102

VerifiedDeploy and manage Azure compute resources

You download an Azure Resource Manager template based on an existing virtual machine. The template will be used to deploy 100 virtual machines.

You need to modify the template so that it references an administrative password. You must prevent the password from being stored in plain text.

What should you create to store the password?

Explanation

Store the administrator password as a secret in Azure Key Vault. In the parameter file, reference the secret by the vault's resource ID (keyVault.id) and the secretName, so the password never appears in plain text in the template or parameter file. The vault must have enabledForTemplateDeployment set to true, and the user who deploys the template needs the Microsoft.KeyVault/vaults/deploy/action permission for the resource group and vault (the Owner and Contributor roles include it). An access policy gives users who work with the secret directly, such as the administrator who creates it, permissions on secrets; it isn't needed just to retrieve the secret during a deployment. On vaults that use the Azure RBAC permission model, which Microsoft recommends, an Azure role assignment replaces the access policy.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!