Bitzu

AZ-400 ยท Secrets and sensitive information

Using Azure Key Vault for pipeline secrets

Key Vault in pipelines (AzureKeyVault task, variable group link, Actions get secrets), access policies vs RBAC, rotation, soft delete and purge protection, certificates for signing.

Key points

  • Keep secrets, keys and certificates in Key Vault, not in YAML.
  • AzureKeyVault@2: downloads chosen secrets as masked variables via a service connection; the identity needs Get and List on secrets.
  • Data-plane access: Azure RBAC (Key Vault Secrets User) or legacy access policies.
  • Soft delete: deleted objects recoverable for 7-90 days.
  • Purge protection: no early purge.

Source: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/azure-key-vault-v2

Practice questions

Single choice

Which built-in Azure RBAC role lets a pipeline identity read secret values from a vault without being able to change them?

  1. Key Vault Secrets Officer
  2. Key Vault Reader
  3. Key Vault Secrets User
  4. Key Vault Contributor
Show answer

Answer: C. Key Vault Secrets User

Key Vault Secrets User reads secret contents. Secrets Officer can also write and delete. Key Vault Reader sees only metadata, not values. Key Vault Contributor is a control-plane role with no data access.

Select all that apply

Which statements about Key Vault soft delete and purge protection are correct?

  1. The retention interval of 7-90 days is set when the vault is created
  2. Soft delete can be turned off again at any time
  3. With purge protection on, a deleted object cannot be purged before retention ends
  4. Purge protection is enabled by default on every new vault
  5. A deleted secret is wiped immediately and cannot be recovered
Show answer

Answer: A. The retention interval of 7-90 days is set when the vault is created, C. With purge protection on, a deleted object cannot be purged before retention ends

The retention interval (7-90 days) is chosen at vault creation and cannot be changed afterwards. With purge protection on, deleted objects cannot be purged until retention ends. Soft delete cannot be switched off once on, purge protection is not on by default, and deletion alone does not remove data instantly in a soft-delete vault.

True or false

True or false: assigning the Key Vault Contributor role to a pipeline identity lets it read secret values.

Show answer

Answer: False

False. Key Vault Contributor manages the vault resource (control plane) and does not grant access to keys, secrets or certificates. Reading values needs a data-plane role such as Key Vault Secrets User.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More AZ-400 topics in this module