A company stores deployment secrets in an Azure Key Vault (Standard tier) that uses the Vault access policy permission model. Azure Pipelines deploys infrastructure by using ARM templates with parameter files, and some pipelines use the AzureKeyVault@2 task. The team reports the issues and requirements listed below.
Match each issue or requirement to the action that resolves it. Each action may be used once, more than once, or not at all.
- Correct match: Set enabledForTemplateDeployment to true on the key vault.
The vault must have enabledForTemplateDeployment set to true before Resource Manager can read secrets during a deployment. The user already holds the deploy action permission, so granting secret permissions to a pipeline identity does not address this failure.
- Correct match: Grant the pipeline identity Get and List secret permissions.
This failure occurs when the pipeline's service principal or managed identity lacks the right to list vault secrets, so that identity needs Get and List secret permissions. enabledForTemplateDeployment concerns Resource Manager template deployments, not the identity used by the pipeline task.
- Correct match: Use a reference object with the vault ID and secretName in the parameter file.
In the parameter file, a reference object that gives the Key Vault resource ID and the secret name replaces the literal value, and Resource Manager fetches the secret at deployment time. Changing vault properties or permissions alone does not tell the template where the parameter value comes from.
- Correct match: Enable logging for the key vault and configure streaming to an event hub.
Vault logging records secret access activity, and configuring an event hub destination meets the streaming requirement. Granting permissions or using parameter references does not record access activity.
Resource Manager requires enabledForTemplateDeployment to be true and the deploying identity to have the deploy/action permission. The pipeline identity needs Get and List secret permissions to resolve the task's access error. A parameter-file reference identifies the vault and secret from which Resource Manager retrieves the parameter value. Vault logging configured to stream to an event hub meets the monitoring requirement. Premium provides HSM-protected keys; changing tiers does not configure deployment access, parameter references, or log streaming.