Tag: Azure Key Vault

Implement and configure disk encryption (SC-500 Exam Prep)

This post is a part of the "SC-500: Implementing End-to-End Security Controls for Cloud and AI Workloads" Exam Prep Hub.
This topic falls under these sections:
Secure compute (20–25%)
   --> Implement security for servers and virtual machines (VMs)
      --> Implement and configure disk encryption


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Overview

Disk encryption protects data stored on virtual machine disks from unauthorized access. In Azure, disk encryption is an important defense-in-depth control for infrastructure-as-a-service workloads, especially when virtual machines process sensitive, regulated, or confidential information.

For the SC-500 exam, you should understand:

  • The difference between server-side encryption and guest-based disk encryption.
  • How Azure Disk Encryption uses BitLocker or DM-Crypt.
  • How Azure Key Vault stores and protects encryption keys and secrets.
  • The difference between Azure Disk Encryption and encryption at host.
  • How to configure disk encryption for Windows and Linux virtual machines.
  • How to use customer-managed keys.
  • How to protect encryption keys and avoid operational problems.
  • The retirement considerations for Azure Disk Encryption.

Why Disk Encryption Is Important

Virtual machine disks can contain:

  • Operating system files.
  • Application data.
  • Database files.
  • Temporary files.
  • Credentials and configuration data.
  • Logs and diagnostic information.
  • Cached information.
  • Sensitive customer or business data.

If a disk, snapshot, backup, or storage medium is accessed without authorization, encryption helps prevent the data from being read in its unencrypted form.

Disk encryption helps protect data:

  • At rest.
  • In snapshots and images.
  • In operating system and data volumes.
  • In temporary disks, depending on the encryption method and configuration.
  • During storage or infrastructure access scenarios.

Disk encryption does not replace:

  • Identity and access management.
  • Network security.
  • Endpoint protection.
  • Application-level authorization.
  • Database security.
  • Backup security.
  • Monitoring and auditing.

It is one layer in a defense-in-depth security strategy.


Azure Disk Encryption Concepts

Server-Side Encryption

Azure managed disks are encrypted at rest by default using platform-managed keys. This is commonly called server-side encryption, or SSE.

Azure managed disks, snapshots, and images are transparently encrypted using 256-bit Advanced Encryption Standard encryption. The encryption is handled by the Azure platform and does not normally require changes inside the virtual machine.

Server-side encryption protects data persisted in Azure Storage. However, it does not necessarily encrypt every type of data temporarily stored on the virtual machine host, such as:

  • Temporary disk data.
  • OS disk caches.
  • Data disk caches.

For stronger end-to-end protection, consider encryption at host.


Azure Disk Encryption

Azure Disk Encryption, or ADE, encrypts disks from inside the guest operating system.

It uses:

  • BitLocker for Windows virtual machines.
  • DM-Crypt for Linux virtual machines.

Azure Disk Encryption integrates with Azure Key Vault to manage disk-encryption keys and secrets.

Azure Disk Encryption can encrypt:

  • The operating system disk.
  • Data disks.
  • Temporary disks when the appropriate volume option is selected.

ADE uses the virtual machine’s operating system and CPU resources to perform guest-based encryption.

Windows

For Windows virtual machines, Azure Disk Encryption uses BitLocker to provide full disk encryption for the OS disk and data disks. The temporary disk can also be encrypted when the VolumeType setting is All.

Linux

For Linux virtual machines, Azure Disk Encryption uses DM-Crypt to provide full disk encryption for the OS disk and data disks. The temporary disk can be encrypted when using the EncryptFormatAll option.


Encryption at Host

Encryption at host provides encryption on the physical Azure VM host before data is written to Azure Storage.

It encrypts:

  • Temporary disks.
  • OS disk caches.
  • Data disk caches.
  • Data flowing from the VM host to Azure Storage.

Encryption at host provides end-to-end encryption for VM data and does not use the VM’s CPU for encryption. It therefore avoids the performance impact associated with guest-based encryption.

Encryption at Host Compared with Azure Disk Encryption

FeatureAzure Disk EncryptionEncryption at Host
Encryption locationInside the guest OSOn the Azure VM host
Windows technologyBitLockerAzure platform encryption
Linux technologyDM-CryptAzure platform encryption
Uses VM CPUYesNo
Encrypts OS and data disksYesYes
Encrypts temporary disksWith appropriate configurationYes
Encrypts disk cachesNot comprehensivelyYes
Uses Azure Key VaultYesMay use platform-managed or customer-managed keys
Recommended for new deploymentsGenerally noGenerally yes
Migration considerationExisting ADE workloads must be migratedPreferred modern approach

Microsoft states that Azure Disk Encryption is scheduled for retirement on September 15, 2028. Until that date, existing ADE workloads can continue operating, but after the retirement date encrypted disks will fail to unlock following VM reboots. New workloads should use encryption at host, and existing ADE workloads should be migrated before the retirement date.


Azure Disk Encryption and Azure Key Vault

Azure Key Vault is used to control and manage the encryption keys and secrets associated with Azure Disk Encryption.

A typical arrangement includes:

  1. The VM’s disks are encrypted using BitLocker or DM-Crypt.
  2. Encryption secrets are stored in Azure Key Vault.
  3. The VM or Azure platform accesses the required secrets during boot and disk-unlock operations.
  4. Key Vault access policies or permissions control access to the encryption material.

Key Vault Requirements

When configuring a Key Vault for Azure Disk Encryption:

  • The Key Vault must be in the same region as the VM.
  • The Key Vault must be in the same Microsoft Entra tenant as the VM.
  • The Key Vault must be enabled for disk encryption.
  • Required access permissions must be configured.
  • Networking rules must allow the required access.
  • Soft-delete should be enabled.
  • The encryption keys and secrets must not be deleted or disabled while they are still required.

Azure documentation specifically requires the Key Vault and VM to be colocated in the same region and tenant so encryption secrets do not cross regional boundaries.

Enabling Key Vault for Disk Encryption

When creating a Key Vault with Azure CLI, the relevant option is:

az keyvault create \
--name "<key-vault-name>" \
--resource-group "<resource-group-name>" \
--location "eastus" \
--enabled-for-disk-encryption

For an existing Key Vault, you can enable the setting with:

az keyvault update \
--name "<key-vault-name>" \
--resource-group "<resource-group-name>" \
--enabled-for-disk-encryption true

The equivalent Azure PowerShell parameter is:

-EnabledForDiskEncryption

If the Key Vault firewall is enabled, the required trusted-service access and network configuration must also be considered.


Encryption Keys and Key Encryption Keys

Disk Encryption Secrets

Azure Disk Encryption uses encryption secrets associated with the guest-based encryption process. These secrets are stored in Azure Key Vault.

Protecting the Key Vault is therefore critical. If an attacker gains unauthorized access to the encryption secrets, the security value of disk encryption can be significantly reduced.

Key Encryption Key

A key encryption key, or KEK, provides an additional layer of protection.

When a KEK is used:

  1. Azure Disk Encryption generates or uses disk-encryption secrets.
  2. The secrets are wrapped using the KEK.
  3. The wrapped secrets are stored in Key Vault.
  4. The KEK remains protected in Key Vault.

A KEK can be:

  • Generated in Azure Key Vault.
  • Imported into Azure Key Vault.
  • Protected by a customer-controlled key-management process supported by Key Vault.

Azure Disk Encryption requires an RSA key for a KEK; elliptic-curve keys are not supported for this purpose. Versioned KEK URLs are also required.

Important KEK Considerations

  • Do not delete the KEK while encrypted VMs depend on it.
  • Do not disable the key version currently being used.
  • Retain the correct key version.
  • Ensure administrators have appropriate Key Vault permissions.
  • Monitor key expiration and rotation.
  • Test recovery procedures before changing encryption keys.

Customer-Managed Keys

Azure managed disks can use either:

  • Platform-managed keys.
  • Customer-managed keys.

With customer-managed keys, the organization controls the key used to encrypt and decrypt managed disk data.

Customer-managed keys can help organizations meet requirements related to:

  • Regulatory compliance.
  • Key ownership.
  • Key rotation.
  • Key revocation.
  • Separation of duties.
  • Internal security policies.
  • Customer-controlled cryptographic material.

Customer-managed keys depend on managed identities and Microsoft Entra ID. If a subscription, resource group, or managed disk is moved to another Microsoft Entra tenant, the associated managed identity may not transfer, which can cause customer-managed-key access to stop working.


Azure Disk Encryption Prerequisites

Before enabling ADE, verify the following.

Supported VM

The virtual machine must use:

  • A supported operating system.
  • A supported VM size.
  • A supported disk configuration.
  • A supported Azure region.

Not every VM size, operating system image, or disk configuration supports every encryption scenario.

Key Vault

The Key Vault must:

  • Exist in the same region as the VM.
  • Be in the same Microsoft Entra tenant.
  • Be enabled for disk encryption.
  • Have the required permissions.
  • Be reachable according to its networking configuration.
  • Have soft-delete enabled where required.

Networking

The VM must be able to reach the services required for encryption and key retrieval.

If Key Vault network restrictions are enabled, validate:

  • Private endpoint configuration, if used.
  • Virtual network integration.
  • Firewall rules.
  • Trusted Microsoft services settings.
  • DNS resolution.
  • Routing.
  • Required outbound connectivity.

Backup and Recovery

Before encrypting a production VM:

  • Verify that a recent backup exists.
  • Confirm that the backup can be restored.
  • Document the Key Vault and key dependencies.
  • Record the encryption configuration.
  • Test recovery of encrypted disks.
  • Ensure the required keys and secrets are retained.

Encryption without a recovery plan can create a situation in which data is technically protected but operationally inaccessible.


Configuring Azure Disk Encryption

Azure Disk Encryption can be configured through:

  • The Azure portal.
  • Azure CLI.
  • Azure PowerShell.
  • Infrastructure-as-code templates.

The general process is:

  1. Identify the VM and its operating system.
  2. Confirm that the VM is supported.
  3. Create or select a Key Vault.
  4. Enable Key Vault for disk encryption.
  5. Configure Key Vault permissions and networking.
  6. Optionally create a KEK.
  7. Enable disk encryption on the VM.
  8. Select the volumes to encrypt.
  9. Monitor the encryption operation.
  10. Verify the encryption status.
  11. Test restart and recovery behavior.

Encrypting Windows VMs

For a Windows VM, Azure Disk Encryption uses BitLocker.

A typical configuration decision is the volume type:

  • OS — encrypt only the operating system disk.
  • Data — encrypt data disks.
  • All — encrypt the OS disk, data disks, and temporary disk where supported.

The exact supported options depend on the operating system, VM configuration, and current Azure tooling.

After enabling encryption, verify:

  • The OS disk is encrypted.
  • Data disks are encrypted.
  • The intended temporary-disk behavior is configured.
  • The VM can restart successfully.
  • The VM can retrieve the required encryption secrets.
  • The Key Vault remains available.

Encrypting Linux VMs

For a Linux VM, Azure Disk Encryption uses DM-Crypt.

Before enabling encryption, verify:

  • The Linux distribution is supported.
  • The filesystem configuration is supported.
  • The VM uses a supported disk layout.
  • Required packages and extensions are available.
  • The VM has sufficient free space and stable connectivity.
  • The encryption operation will not conflict with existing encryption.

The EncryptFormatAll option can be used for scenarios in which additional volumes, including temporary storage, must be encrypted. However, this option must be used carefully because formatting operations can result in data loss if applied to disks containing existing data.

After enabling encryption, verify:

  • The OS disk is encrypted.
  • Data disks are encrypted.
  • Mount points remain available.
  • The VM restarts correctly.
  • Required secrets can be retrieved from Key Vault.
  • Applications can access their data.

Azure Disk Encryption Extension

Azure Disk Encryption is commonly implemented through the Azure Disk Encryption extension.

The extension performs encryption-related operations inside the guest operating system and communicates with the Azure platform and Key Vault as required.

When troubleshooting, inspect:

  • VM extension status.
  • Extension provisioning state.
  • Azure Activity Log.
  • VM boot diagnostics.
  • Guest operating system logs.
  • Key Vault audit logs.
  • Key Vault access configuration.
  • Network connectivity.
  • Encryption status reported by Azure.

A failed extension operation may indicate:

  • Unsupported operating system.
  • Unsupported VM size.
  • Incorrect Key Vault configuration.
  • Missing permissions.
  • Network restrictions.
  • Invalid key or secret references.
  • Insufficient disk space.
  • Existing encryption conflicts.
  • An unsupported disk layout.
  • A disabled or expired key.

Monitoring and Verifying Encryption

After configuring disk encryption, do not assume that the operation succeeded simply because the deployment completed.

Verify the actual encryption state.

Useful verification methods include:

  • Azure portal encryption status.
  • Azure CLI.
  • Azure PowerShell.
  • VM extension status.
  • Operating system commands.
  • Azure Resource Graph queries.
  • Azure Policy compliance.
  • Defender for Cloud recommendations.
  • Azure Activity Log.
  • Key Vault audit logs.

For Windows, verify BitLocker status inside the operating system.

For Linux, verify the DM-Crypt and encrypted-volume configuration.

Also verify that:

  • The VM can reboot.
  • Encrypted disks unlock correctly.
  • Applications can read and write data.
  • Backup operations continue to work.
  • Key Vault access remains functional.
  • Key rotation or key-version changes do not break access.

Protecting Encryption Keys

Disk encryption is only as strong as the protection applied to its keys and secrets.

Key Vault Security Recommendations

Use the following practices:

  • Apply least-privilege access.
  • Restrict administrative access.
  • Use Microsoft Entra role-based access control or appropriate access policies.
  • Enable logging and monitoring.
  • Enable soft-delete.
  • Use purge protection where appropriate.
  • Restrict network access.
  • Prefer private endpoints when appropriate.
  • Monitor key and secret access.
  • Separate key-management duties from VM administration.
  • Avoid embedding secrets in scripts or templates.
  • Avoid granting broad access to the entire Key Vault.
  • Maintain recovery procedures for keys and secrets.

Key Rotation

Key rotation must be planned carefully.

Important considerations include:

  • Which key version is currently used?
  • Is the new key version supported by the encryption configuration?
  • Will the old key remain available?
  • Will disabling the old key prevent VM startup?
  • Are backups dependent on the old key?
  • Has the rotation process been tested?

For Azure Disk Encryption, automatic Key Vault key rotation is not fully compatible with the way ADE continues to use the original encryption key. Rotating a key does not necessarily break ADE, but disabling the original key can prevent the VM from unlocking its disks.


Azure Disk Encryption Retirement

Azure Disk Encryption is scheduled for retirement on September 15, 2028.

The important implications are:

  • Existing ADE workloads can continue operating until the retirement date.
  • ADE-enabled workloads must be migrated before the retirement date.
  • After retirement, encrypted disks may fail to unlock after VM reboots.
  • New VM deployments should generally use encryption at host.
  • Backups of ADE-enabled VMs must also be considered during migration.

The recommended modern approach is to use:

  • Encryption at host for new VM workloads.
  • Customer-managed keys where organizational requirements justify them.
  • Confidential VM capabilities when stronger confidential-computing protections are required.

Azure Disk Encryption Versus Encryption at Host: Exam Perspective

A common SC-500 exam scenario may ask which solution should be used for a new VM deployment.

Choose encryption at host when the requirement is to:

  • Encrypt temporary disks.
  • Encrypt OS and data disk caches.
  • Protect data end-to-end from the VM host to Azure Storage.
  • Avoid using the VM CPU for encryption.
  • Use the recommended modern disk-encryption approach.

Choose Azure Disk Encryption mainly when:

  • You are managing an existing ADE-encrypted workload.
  • A legacy workload specifically requires BitLocker or DM-Crypt-based guest encryption.
  • You are preparing to migrate an existing ADE workload.
  • The scenario explicitly requires guest-based encryption.

Remember that standard managed-disk server-side encryption is already enabled by default. The question is often whether the scenario requires protection beyond ordinary encryption at rest.


Common Mistakes to Avoid

Mistake 1: Assuming server-side encryption encrypts everything on the VM host

Server-side encryption protects data persisted in Azure Storage. It does not necessarily provide the same coverage as encryption at host for temporary disks and disk caches.

Mistake 2: Treating Azure Disk Encryption and encryption at host as identical

They operate at different layers:

  • ADE encrypts inside the guest operating system.
  • Encryption at host encrypts on the physical VM host.

Mistake 3: Deleting or disabling the old key after rotation

An encrypted VM may still depend on the original key version.

Mistake 4: Ignoring Key Vault networking

A VM may fail to unlock its disks if it cannot reach Key Vault.

Mistake 5: Encrypting without a tested recovery plan

If keys or secrets are lost, encrypted data may become inaccessible.

Mistake 6: Using EncryptFormatAll without understanding its effect

Formatting or encrypting all volumes can cause data loss if existing data disks are not handled correctly.

Mistake 7: Assuming encryption eliminates the need for access controls

Encryption does not replace RBAC, network security, identity protection, monitoring, or application security.

Mistake 8: Deploying new workloads with ADE without considering retirement

New workloads should generally use encryption at host because ADE is scheduled for retirement.


Key Takeaways

For the SC-500 exam, remember these points:

  1. Azure managed disks are encrypted at rest by default using platform-managed keys.
  2. Azure Disk Encryption uses BitLocker for Windows and DM-Crypt for Linux.
  3. Azure Disk Encryption integrates with Azure Key Vault.
  4. ADE encrypts from inside the guest operating system.
  5. Encryption at host encrypts data on the physical VM host.
  6. Encryption at host also protects temporary disks and disk caches.
  7. Encryption at host does not use the VM CPU for encryption.
  8. ADE requires careful management of Key Vault keys and secrets.
  9. A KEK provides an additional layer of protection for encryption secrets.
  10. The Key Vault and VM must be in the same region and Microsoft Entra tenant for ADE.
  11. Disabling or deleting a required key can prevent a VM from unlocking its disks.
  12. ADE is scheduled for retirement on September 15, 2028.
  13. New workloads should generally use encryption at host.
  14. Encryption must be verified after deployment.
  15. Encryption is only one component of defense in depth.

Practice Exam Questions

Question 1

A company is deploying new Azure virtual machines. The security team requires encryption of the OS disk, data disks, temporary disks, and disk caches. The solution should not use the VM’s CPU for encryption.

Which solution should you recommend?

A. Azure Disk Encryption
B. Encryption at host
C. BitLocker configured manually inside the VM
D. Azure Storage service-side encryption only

Correct answer: B

Explanation: Encryption at host encrypts temporary disks, OS and data disk caches, and data flowing from the VM host to Azure Storage. It performs encryption on the host rather than using the VM’s CPU.


Question 2

Which technology does Azure Disk Encryption use to encrypt the operating system and data disks of a Linux virtual machine?

A. BitLocker
B. Azure Storage encryption
C. DM-Crypt
D. Transparent Data Encryption

Correct answer: C

Explanation: Azure Disk Encryption uses DM-Crypt for Linux virtual machines. BitLocker is used for Windows virtual machines.


Question 3

An administrator is configuring a Key Vault for Azure Disk Encryption. Which requirement must be satisfied?

A. The Key Vault must be in a different region from the VM
B. The Key Vault must be in the same region and Microsoft Entra tenant as the VM
C. The Key Vault must be publicly accessible from the internet
D. The Key Vault must use only platform-managed keys

Correct answer: B

Explanation: Azure Disk Encryption requires the Key Vault and VM to be in the same region and Microsoft Entra tenant so that encryption secrets do not cross regional boundaries.


Question 4

What is the primary purpose of a key encryption key in an Azure Disk Encryption configuration?

A. To encrypt the VM’s network traffic
B. To replace BitLocker or DM-Crypt
C. To encrypt the Azure subscription
D. To wrap and protect the disk-encryption secrets stored in Key Vault

Correct answer: D

Explanation: A key encryption key, or KEK, provides an additional protection layer by wrapping the disk-encryption secrets before they are stored in Azure Key Vault.


Question 5

A company rotates a Key Vault key used by an existing Azure Disk Encryption VM. What should the administrator do before disabling the old key version?

A. Confirm that the VM and its backups no longer depend on the old key version
B. Delete the old key immediately
C. Disable the entire Key Vault
D. Restart the VM before changing the key

Correct answer: A

Explanation: Azure Disk Encryption may continue using the original encryption key. Disabling or deleting that key can prevent the VM from unlocking its disks after a restart.


Question 6

Which statement best describes server-side encryption for Azure managed disks?

A. It requires BitLocker to be installed in the guest operating system
B. It is automatically applied to data persisted in Azure Storage
C. It encrypts only temporary disks
D. It requires a customer-managed key in every deployment

Correct answer: B

Explanation: Azure managed disks are encrypted at rest by default using server-side encryption and platform-managed keys. Customer-managed keys are optional.


Question 7

A Linux administrator wants to encrypt all supported volumes, including temporary storage, using Azure Disk Encryption. Which configuration should the administrator investigate?

A. EncryptFormatAll
B. UseBitLocker
C. EnableTrustedLaunch
D. EnableTDE

Correct answer: A

Explanation: For Linux VMs, the EncryptFormatAll option can be used to encrypt additional volumes, including temporary storage. It must be used carefully because formatting operations can cause data loss.


Question 8

A new Azure VM must have encrypted temporary disks and encrypted OS and data disk caches. Which encryption option is most appropriate?

A. Azure Disk Encryption with only the OS volume selected
B. Manual encryption of the data disks inside the guest OS
C. Encryption at host
D. Azure SQL Transparent Data Encryption

Correct answer: C

Explanation: Encryption at host protects temporary disks and OS and data disk caches in addition to providing encryption for VM data flowing to Azure Storage.


Question 9

Which statement about Azure Disk Encryption is correct?

A. It uses BitLocker for Windows and DM-Crypt for Linux
B. It is performed only by Azure Storage and does not involve the guest OS
C. It does not require Azure Key Vault
D. It encrypts all network traffic leaving the VM

Correct answer: A

Explanation: Azure Disk Encryption is guest-based. It uses BitLocker on Windows and DM-Crypt on Linux, and it integrates with Azure Key Vault for encryption keys and secrets.


Question 10

A security engineer is planning a new VM deployment in 2026. Which recommendation is most appropriate regarding Azure Disk Encryption?

A. Use ADE for every new VM because it is the preferred long-term solution
B. Avoid all forms of disk encryption because managed disks are automatically encrypted
C. Use encryption at host for new workloads and plan migration for existing ADE workloads
D. Use only manual BitLocker configuration inside the guest operating system

Correct answer: C

Explanation: Azure Disk Encryption is scheduled for retirement on September 15, 2028. Microsoft recommends encryption at host for new workloads and migration of existing ADE-enabled workloads before the retirement date.


Go to the SC-500 Exam Prep Hub main page

Configure Key Vault settings (SC-500 Exam Prep)

This post is a part of the "SC-500: Implementing End-to-End Security Controls for Cloud and AI Workloads" Exam Prep Hub.
This topic falls under these sections:
Manage identity, access, and governance (20–25%)
   --> Secure secrets and keys by using Azure Key Vault
      --> Configure Key Vault settings


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Overview

Microsoft Azure Key Vault is a managed service designed to securely store and control access to sensitive information such as:

  • Secrets — passwords, connection strings, API keys, tokens, and other sensitive values.
  • Keys — cryptographic keys used for encryption, decryption, signing, verification, wrapping, and unwrapping.
  • Certificates — certificates and their associated private keys.

For the SC-500 exam, configuring Key Vault is not simply about creating a vault. You need to understand how to configure the vault as a security boundary using identity, authorization, network, and data-protection controls.

A well-secured Key Vault generally follows the principles of:

  1. Least privilege
  2. Defense in depth
  3. Zero Trust
  4. Assume breach
  5. Minimize public exposure
  6. Protect against accidental and malicious deletion

Microsoft’s current security guidance recommends using Azure RBAC, managed identities, network restrictions, private endpoints where appropriate, and just-in-time privileged access.


1. Understand the Key Vault Security Boundary

A Key Vault should generally be treated as a security boundary for the secrets, keys, and certificates associated with an application or workload.

A common secure architecture is:

One Key Vault per application, environment, and region

For example:

Application A
├── Development Key Vault
├── Test Key Vault
└── Production Key Vault
Application B
├── Development Key Vault
├── Test Key Vault
└── Production Key Vault

This separation reduces the potential blast radius if one application or environment is compromised.

For example, placing development and production secrets in the same vault can unnecessarily allow a compromised development workload to become a pathway toward production secrets.


2. Key Vault Has Two Security Planes

One of the most important concepts to understand is that Key Vault has a control plane and a data plane.

Control plane

The control plane manages the Key Vault resource itself.

Examples include:

  • Creating a vault
  • Deleting a vault
  • Updating vault properties
  • Configuring networking
  • Configuring diagnostic settings
  • Managing certain resource-level settings

Azure RBAC is used for management-plane authorization.

Data plane

The data plane controls access to the actual contents of the vault.

Examples include:

  • Reading secrets
  • Creating secrets
  • Deleting secrets
  • Reading keys
  • Encrypting or decrypting using keys
  • Creating certificates
  • Retrieving certificates

Data-plane authorization can use Azure RBAC or the legacy Key Vault access policy model. Azure RBAC is the recommended model.

Exam distinction

A user can have permission to manage the Key Vault resource without necessarily having permission to read the secrets inside it.

For example:

A user with the Key Vault Contributor role can manage the Key Vault resource, but the role does not automatically grant access to keys, secrets, and certificates.

This distinction is extremely important for SC-500 questions.


3. Configure the Authorization Model

Azure Key Vault supports two data-plane authorization models:

  1. Azure RBAC
  2. Key Vault access policies

Azure RBAC

Azure RBAC is the recommended authorization model.

RBAC provides centralized authorization using:

  • Security principal
  • Role definition
  • Scope

For example:

Managed Identity
↓
Key Vault Secrets User
↓
Production Key Vault

RBAC provides several security advantages:

  • Centralized authorization
  • Integration with Microsoft Entra ID
  • Integration with Privileged Identity Management
  • Consistent Azure authorization model
  • Better separation between resource administration and data access
  • Support for least-privilege role assignments

Current Azure Key Vault documentation identifies RBAC as the recommended authorization model, and starting with API version 2026-02-01, RBAC is the default authorization model for newly created vaults.


4. Key Vault RBAC Roles

Several built-in roles are particularly important.

Key Vault Contributor

Allows management of the Key Vault resource itself.

It does not provide access to secrets, keys, or certificates.

This is an important exam trap.

Key Vault Secrets User

Allows a principal to read secret contents.

A common scenario is:

An Azure App Service needs to retrieve a database connection string stored as a Key Vault secret.

The application could use a managed identity with an appropriate Key Vault RBAC role.

Key Vault Secrets Officer

Provides broader management permissions for secrets.

It is appropriate when a principal needs to manage secrets rather than merely read them.

Key Vault Crypto User

Provides permissions for cryptographic operations involving keys.

For example, an application may need to use a key for cryptographic operations without being granted broad administrative access to the vault.

Key Vault Administrator

Provides extensive data-plane permissions.

This role should be carefully controlled because it provides significant access to Key Vault data.


5. Use Managed Identities

Applications should generally authenticate to Key Vault using managed identities rather than storing credentials in application configuration.

For example:

Azure Function
│
│ Managed Identity
▼
Microsoft Entra ID
│
▼
Azure Key Vault
│
▼
Secret

The major advantage is that the application doesn’t need to store a client secret, password, or certificate merely to authenticate to Key Vault.

Exam scenario

If a question says:

An Azure Web App needs to access a Key Vault secret without storing credentials in application configuration.

The preferred solution is typically:

Enable a managed identity on the Web App and assign an appropriate Key Vault RBAC role.


6. Apply Least Privilege

Do not give applications more Key Vault permissions than they require.

For example:

RequirementAppropriate approach
Read secretsKey Vault Secrets User
Manage secretsKey Vault Secrets Officer
Perform cryptographic operationsAppropriate Key Vault Crypto role
Manage vault resourceKey Vault Contributor
Full administrative accessKey Vault Administrator

The key principle is:

Grant the smallest role that satisfies the requirement.

Avoid assigning broad roles such as Owner or Contributor when a narrower Key Vault role is sufficient.


7. Understand the Legacy Access Policy Model

Key Vault access policies are the older authorization mechanism.

An access policy can specify permissions for:

  • Keys
  • Secrets
  • Certificates

For example, a principal might receive:

Secrets:
Get
List

Although access policies remain supported, Azure RBAC is preferred for new deployments.

There is an important security reason.

With the legacy access policy model, a principal with sufficient control-plane permissions to modify the vault can potentially grant itself data-plane access through an access policy.

Azure RBAC provides stronger separation of responsibilities because granting data-plane RBAC permissions requires appropriate authorization to create role assignments.

Exam takeaway

If a question asks:

Which authorization model should be used for a new security-sensitive Key Vault?

The answer will generally be:

Azure RBAC.


8. Configure Soft Delete

Soft delete protects deleted Key Vaults and Key Vault objects from immediate permanent deletion.

When an object is deleted, it enters a recoverable deleted state rather than immediately disappearing permanently.

This helps protect against:

  • Accidental deletion
  • Malicious deletion
  • Application errors
  • Administrative mistakes
  • Certain ransomware scenarios

Soft delete applies to Key Vault objects such as:

  • Secrets
  • Keys
  • Certificates

It also protects the vault itself from immediate permanent deletion.


9. Understand Soft-Delete Retention

The soft-delete retention period determines how long deleted objects remain recoverable.

The current configurable retention period is:

7–90 days

The default retention period is 90 days.

Once the retention setting is established for a vault, it cannot subsequently be changed.

Exam trap

Do not confuse:

Soft delete

with:

Purge protection

They solve related but different problems.


10. Configure Purge Protection

Purge protection provides an additional layer of protection against permanently deleting soft-deleted Key Vaults or objects.

Without purge protection:

Delete
↓
Soft-deleted
↓
Can potentially be purged
↓
Permanent deletion

With purge protection:

Delete
↓
Soft-deleted
↓
Purge blocked
↓
Retention period expires
↓
Permanent deletion becomes possible

Purge protection is especially important when Key Vault keys are used to protect critical data.

For example, if an Azure Storage encryption key is permanently deleted, the encrypted data may become unrecoverable.

Microsoft specifically recommends purge protection when keys are used for encryption.


11. Important Purge Protection Characteristics

Purge protection:

  • Works with soft delete
  • Prevents premature permanent deletion
  • Helps protect against malicious destruction
  • Is irreversible once enabled
  • Is particularly important for encryption keys

Exam rule

If a question says:

A Key Vault contains keys used for encryption of critical data, and administrators must be prevented from permanently deleting those keys before the retention period expires.

The key setting is:

Purge protection.


12. Configure Network Security

Key Vault can be protected using network controls.

The goal is to prevent unauthorized network access to the vault.

Important network controls include:

  • Public network access settings
  • Firewall rules
  • Virtual network restrictions
  • Private endpoints
  • Private Link
  • Trusted Microsoft services

Microsoft’s current security guidance favors disabling public network access and using private endpoints when the workload architecture supports it.


13. Configure the Key Vault Firewall

A Key Vault firewall can restrict access based on network location.

You can restrict access using:

  • IP network rules
  • Virtual network rules
  • Other supported network controls

For example:

Internet
X
│
│ blocked
▼
Key Vault
▲
│
Allowed corporate network

This reduces the attack surface compared with allowing unrestricted public access.


14. Public Network Access

Key Vault has a setting controlling whether the vault accepts traffic through its public endpoint.

Conceptually:

Public network access: Enabled
↓
Public endpoint can be used
↓
Firewall/network rules determine access

versus:

Public network access: Disabled
↓
Public access blocked
↓
Private endpoint access can be used

When public network access is disabled, traffic through the public endpoint is blocked; private endpoint traffic can still provide access.

Exam clue

If a question says:

The organization requires that Key Vault not be accessible from the public Internet.

Look for:

Disable public network access and use a private endpoint.


15. Use Private Endpoints

An Azure Private Endpoint provides a private network interface in an Azure virtual network that connects privately to the Key Vault service through Azure Private Link.

Conceptually:

Azure VNet
│
├── Application
│
└── Private Endpoint
│
│ Private Link
▼
Azure Key Vault

The application can access Key Vault through a private IP address instead of relying on a publicly accessible endpoint.

Private endpoints are particularly useful for:

  • Production workloads
  • Sensitive workloads
  • Regulated environments
  • Internal applications
  • Workloads requiring private network connectivity

16. Private DNS Is Important

When using a private endpoint, DNS configuration is an important part of the architecture.

Applications should resolve the Key Vault hostname to the private endpoint’s IP address when appropriate.

A common architecture is:

Application
│
▼
Private DNS Zone
│
▼
Private Endpoint IP
│
▼
Azure Key Vault

Therefore, a scenario involving a private endpoint may also require appropriate private DNS configuration.

Exam clue

If the question says:

A VM can reach the private endpoint’s network but continues resolving the Key Vault hostname to a public address.

The problem may be:

DNS configuration.


17. Private Endpoint vs. Firewall

These controls are related but not identical.

Firewall

Controls which network sources can access the public Key Vault endpoint.

Private Endpoint

Provides private connectivity to the Key Vault service through a virtual network.

Strong security architecture

For a highly restricted workload, you may use:

Public network access
↓
Disabled
Private Endpoint
↓
Enabled
Private DNS
↓
Configured
RBAC
↓
Least privilege
Soft Delete
↓
Enabled
Purge Protection
↓
Enabled

This is a classic defense-in-depth configuration.


18. Trusted Microsoft Services

Some Azure services may need to access Key Vault while network restrictions are enabled.

Key Vault supports an option allowing certain trusted Microsoft services to bypass network restrictions where supported.

This should not be interpreted as:

“Allow all Microsoft services.”

It is a controlled exception for supported trusted services.

Exam consideration

If a question requires a particular Azure service to access a firewall-protected Key Vault and the scenario specifically identifies the service as requiring trusted-service access, consider the Allow trusted Microsoft services setting.

However, don’t enable broad exceptions when a more restrictive private-network architecture satisfies the requirement.


19. Configure Key Vault for Defense in Depth

A strong Key Vault configuration should combine multiple security layers.

For example:

Identity

  • Microsoft Entra ID
  • Managed identities
  • MFA for privileged administrators
  • Conditional Access where appropriate

Authorization

  • Azure RBAC
  • Least privilege
  • PIM for privileged roles

Network

  • Private endpoint
  • Private DNS
  • Firewall/network restrictions
  • Disabled public network access where appropriate

Data protection

  • Soft delete
  • Purge protection
  • Appropriate secret/key lifecycle management

Monitoring

  • Diagnostic logging
  • Azure Monitor
  • Microsoft Defender for Cloud
  • Alerts for suspicious activity

20. Use Privileged Identity Management

Administrators should not necessarily have permanent high-level Key Vault privileges.

Microsoft Entra Privileged Identity Management (PIM) can provide eligible, just-in-time access.

Instead of:

Administrator
↓
Permanent Key Vault Administrator

use:

Administrator
↓
Eligible role
↓
Activation
↓
MFA / approval
↓
Temporary privileged access

This reduces the amount of time privileged permissions are available.

Current Microsoft guidance specifically recommends using PIM for eligible, just-in-time Key Vault administrative roles.


21. Configure Azure Policy

Azure Policy can help enforce Key Vault security standards across an organization.

For example, policies can help ensure that Key Vaults:

  • Use Azure RBAC
  • Disable public network access
  • Use private endpoints
  • Have firewall protection
  • Follow organizational security requirements

Azure provides built-in Key Vault policies for many of these scenarios.

For example:

Subscription
│
▼
Azure Policy
│
├── Require RBAC
├── Restrict public access
├── Require firewall
└── Require private connectivity

Audit vs. Deny

A policy can often be configured to:

Audit

Identify noncompliant resources without preventing deployment.

or:

Deny

Prevent deployment/configuration that violates the organization’s requirements.

A common implementation strategy is:

Audit first → remediate → enforce with Deny

This helps reduce the risk of unexpectedly breaking existing workloads.


22. Monitor Key Vault Security

Security configuration is not enough. You should also monitor Key Vault activity.

Useful monitoring capabilities include:

  • Azure Monitor
  • Diagnostic settings
  • Log Analytics
  • Microsoft Defender for Cloud
  • Alerts
  • Activity logs

Monitoring can help identify:

  • Unexpected secret access
  • Unusual key operations
  • Unauthorized access attempts
  • Configuration changes
  • Suspicious administrative activity

Microsoft Defender for Cloud can also provide security recommendations for Key Vault, including recommendations related to RBAC and secret expiration.


23. Secret Expiration

Secrets should generally have an appropriate expiration date.

For example:

Database password
│
├── Created: January 1
├── Rotation: Every 90 days
└── Expiration: March 31

Permanent credentials increase the window of opportunity if a credential is compromised.

Defender for Cloud includes recommendations related to ensuring Key Vault secrets have expiration dates.


24. Common Configuration Choices

The following table summarizes the most important settings.

RequirementKey Vault configuration
Centralized data-plane authorizationAzure RBAC
Application needs secret accessManaged identity + appropriate RBAC role
Prevent accidental deletionSoft delete
Prevent permanent deletion during retentionPurge protection
Prevent Internet accessDisable public network access
Private application accessPrivate endpoint
Restrict public endpointFirewall/network rules
Temporary administrator privilegesPIM
Enforce organization-wide configurationAzure Policy
Monitor access/activityDiagnostic settings + Azure Monitor
Protect critical encryption keysSoft delete + purge protection
Reduce application credential managementManaged identity
Reduce Key Vault blast radiusSeparate vaults by application/environment

25. High-Value SC-500 Exam Distinctions

Memorize these distinctions.

RBAC vs. Access Policy

RBAC = preferred modern authorization model.

Access Policy = legacy Key Vault authorization model.


Control Plane vs. Data Plane

Control plane = manage the Key Vault resource.

Data plane = access keys, secrets, and certificates.


Soft Delete vs. Purge Protection

Soft delete = recover deleted objects.

Purge protection = prevent permanent deletion before the retention period expires.


Firewall vs. Private Endpoint

Firewall = restrict network access based on network rules.

Private endpoint = provide private connectivity through a VNet.


Contributor vs. Secrets User

Key Vault Contributor = manage the vault resource.

Key Vault Secrets User = read secret contents.


Permanent Privileges vs. PIM

Permanent role = privilege remains available.

PIM = eligible, time-limited privileged access.


26. Recommended Secure Key Vault Configuration

For a security-sensitive production workload, a strong configuration could look like this:

                    Microsoft Entra ID
                           │
                 ┌─────────┴─────────┐
                 │                   │
          Managed Identity          PIM
                 │                   │
                 ▼                   ▼
           Application         Administrator
                 │                   │
                 └─────────┬─────────┘
                           ▼
                    Azure RBAC
                           │
                           ▼
                    Azure Key Vault
                 ┌─────────┼─────────┐
                 │         │         │
             Secrets     Keys    Certificates
                 │
                 │
        ┌────────┴────────┐
        │                 │
   Soft Delete       Purge Protection
        │
        └────────┬────────┘
                 │
          Network Security
                 │
       ┌─────────┴─────────┐
       │                   │
 Firewall / Rules    Private Endpoint
                           │
                      Private DNS

The exact configuration depends on the workload, but this architecture demonstrates the defense-in-depth mindset expected from a security engineer.


27. SC-500 Exam Tips

When you encounter a Key Vault scenario, ask these questions in order:

Question 1: Who needs access?

Identify the:

  • User
  • Group
  • Application
  • Managed identity
  • Service principal

Question 2: What do they need to do?

Determine whether they need to:

  • Read
  • Create
  • Update
  • Delete
  • Manage
  • Encrypt/decrypt
  • Sign/verify

Question 3: Which authorization model?

For modern deployments:

Azure RBAC

Question 4: Does the workload need public access?

If not:

Disable public network access.

Question 5: Does the application need private connectivity?

If yes:

Private Endpoint + appropriate DNS configuration.

Question 6: What happens if someone deletes the secret/key?

Use:

Soft delete

Question 7: What if someone tries to permanently purge it?

Use:

Purge protection

Question 8: Does an administrator need permanent privileges?

If not:

PIM / just-in-time access

Question 9: Must this configuration be enforced across many subscriptions?

Consider:

Azure Policy

This decision process can help eliminate incorrect answers quickly.


Practice Exam Questions

Question 1

A company has an Azure App Service that needs to retrieve a database password stored in Azure Key Vault. The company does not want to store credentials in the App Service configuration.

What should you implement?

A. Enable a managed identity for the App Service and assign an appropriate Key Vault RBAC role.

B. Store a Key Vault access key in an App Service application setting.

C. Create a Key Vault access policy that contains the App Service’s password.

D. Enable anonymous access to the Key Vault.

Answer: A

Explanation

A managed identity allows the App Service to authenticate to Azure resources without storing credentials in application configuration. The identity should then receive the minimum Key Vault RBAC permissions required.

B is incorrect because it introduces credentials that must be stored and managed.

C is incorrect because an access policy does not itself eliminate the need for application authentication.

D would violate basic security principles.


Question 2

A Key Vault contains encryption keys used to protect critical business data. Security administrators want to ensure that a deleted key cannot be permanently purged before the configured retention period expires.

Which setting should you configure?

A. Azure Firewall

B. Private Endpoint

C. Purge protection

D. Azure RBAC

Answer: C

Explanation

Purge protection prevents a soft-deleted Key Vault or Key Vault object from being permanently purged before the applicable retention period expires.

Soft delete provides recoverability, while purge protection prevents premature permanent deletion.


Question 3

A security team wants applications to access Key Vault privately from an Azure virtual network. The Key Vault must not be accessible through its public endpoint.

What should you implement?

A. Key Vault access policies

B. A private endpoint and disable public network access

C. Azure RBAC and enable public network access

D. A resource lock on the Key Vault

Answer: B

Explanation

A private endpoint provides private connectivity to Key Vault through Azure Private Link. Disabling public network access prevents access through the public endpoint.

RBAC controls authorization; it does not itself create private network connectivity.

A resource lock protects resource management operations but does not provide private network access.


Question 4

An administrator has the Key Vault Contributor role on a Key Vault. The administrator attempts to read a secret but receives an authorization error.

What is the most likely explanation?

A. Key Vault secrets cannot be accessed through Azure RBAC.

B. The administrator must have the Owner role on the subscription.

C. Key Vault requires a private endpoint before secrets can be read.

D. Key Vault Contributor provides management-plane permissions but does not grant access to secret contents.

Answer: D

Explanation

Key Vault Contributor is a control-plane role. It allows management of the Key Vault resource but does not automatically grant access to keys, secrets, or certificates.

A data-plane role, such as an appropriate Key Vault secrets role, must be assigned.


Question 5

A company wants to protect a Key Vault against accidental deletion of secrets. Deleted secrets must remain recoverable for a defined retention period.

Which feature should be enabled?

A. Soft delete

B. Azure Policy

C. Private Link

D. Conditional Access

Answer: A

Explanation

Soft delete places deleted Key Vault objects into a recoverable state instead of immediately permanently deleting them.

Purge protection provides an additional control against permanent deletion, but the basic requirement described here is recoverability after deletion.


Question 6

An organization wants to prevent users from deploying new Key Vaults that allow unrestricted public network access.

Which Azure service should be used to enforce this requirement across subscriptions?

A. Azure Bastion

B. Microsoft Sentinel

C. Azure Policy

D. Azure Private DNS

Answer: C

Explanation

Azure Policy can evaluate and enforce organizational requirements across Azure resources. Key Vault has built-in policies that can audit or deny configurations such as unrestricted public network access.

Azure Private DNS provides name resolution and does not enforce resource configuration.


Question 7

A company uses Azure RBAC for Key Vault. A security administrator should only have elevated permissions when performing a specific administrative task. The organization requires MFA and approval before the administrator receives the elevated role.

What should be used?

A. Azure Resource Lock

B. Microsoft Entra Privileged Identity Management

C. Azure Firewall

D. Azure Private Link

Answer: B

Explanation

Microsoft Entra Privileged Identity Management supports eligible, just-in-time privileged access. Organizations can configure requirements such as MFA and approval for activation.

This reduces the amount of time highly privileged permissions remain active.


Question 8

A company is deploying a new security-sensitive Key Vault. The security team wants a centralized authorization model that supports Azure RBAC and Privileged Identity Management.

Which authorization model should be selected?

A. Key Vault access policies

B. Shared access signatures

C. Anonymous authorization

D. Azure RBAC

Answer: D

Explanation

Azure RBAC is the recommended Key Vault authorization model and integrates with broader Azure authorization capabilities, including Privileged Identity Management.

Access policies are the legacy Key Vault authorization model.


Question 9

An organization has configured a private endpoint for an Azure Key Vault. Applications can reach the virtual network but resolve the Key Vault hostname to an address associated with public connectivity rather than the private endpoint.

What should the administrator investigate first?

A. Private DNS configuration

B. Key Vault soft-delete retention

C. Purge protection

D. Secret expiration dates

Answer: A

Explanation

Private endpoint implementations commonly require appropriate DNS configuration so that the Key Vault hostname resolves to the private endpoint.

Soft delete, purge protection, and secret expiration are unrelated to hostname resolution.


Question 10

A security team wants to reduce the blast radius of a compromised development application. The application currently shares a Key Vault with a production application.

What is the best security improvement?

A. Give the development application the Key Vault Administrator role.

B. Enable anonymous access for development.

C. Separate the Key Vaults by application and environment and grant each workload only the permissions it requires.

D. Store production and development secrets under different secret names in the same vault.

Answer: C

Explanation

A Key Vault should generally be treated as a security boundary. Separating vaults by application and environment reduces the blast radius of a compromise.

Simply separating secrets by name does not provide the same degree of isolation.

Granting development administrators broader permissions would increase risk rather than reduce it.


Key Takeaways

For SC-500: Configure Key Vault settings, remember the following:

RBAC → preferred authorization model

Managed identity → preferred way for Azure workloads to authenticate without stored credentials

Key Vault Contributor → manages the vault resource, not the secrets

Soft delete → recover deleted vaults/objects

Purge protection → prevents premature permanent deletion

Private endpoint → private connectivity to Key Vault

Disable public network access → eliminate public endpoint access

Firewall/network rules → restrict network sources

Private DNS → helps private endpoint name resolution

PIM → just-in-time privileged administration

Azure Policy → enforce Key Vault security standards at scale

Least privilege + defense in depth → the overarching security strategy

The most important exam mindset is to separate identity, authorization, network security, and data-protection requirements. A scenario may require several controls simultaneously, and the best answer is usually the one that satisfies the requirement with the least privilege and least network exposure rather than simply adding a broad administrative role.


Go to the SC-500 Exam Prep Hub main page

Implement Defender for Key Vault (SC-500 Exam Prep)

This post is a part of the "SC-500: Implementing End-to-End Security Controls for Cloud and AI Workloads" Exam Prep Hub.
This topic falls under these sections:
Manage identity, access, and governance (20–25%)
   --> Secure secrets and keys by using Azure Key Vault
      --> Implement Defender for Key Vault


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Overview

Azure Key Vault is designed to securely store and manage sensitive information such as:

  • Cryptographic keys
  • Secrets
  • Passwords
  • Connection strings
  • Certificates

While Key Vault provides strong security controls for authentication, authorization, encryption, networking, and auditing, organizations also need to detect suspicious or potentially malicious access to the vault.

Microsoft Defender for Key Vault provides an additional threat-detection layer for Azure Key Vault. It uses security intelligence and behavioral analysis to identify unusual and potentially harmful access patterns involving Key Vault.

For the SC-500 exam, it is important to understand that Defender for Key Vault is primarily a threat detection and alerting capability. It does not replace Key Vault access controls, Azure RBAC, firewall rules, private endpoints, or diagnostic logging.


What Is Microsoft Defender for Key Vault?

Microsoft Defender for Key Vault is a workload protection capability within Microsoft Defender for Cloud.

It monitors Key Vault activity and looks for patterns that may indicate:

  • Compromised credentials
  • Credential theft
  • Secret discovery or dumping
  • Unauthorized access attempts
  • Access from suspicious locations
  • Unusual users or applications accessing a vault
  • Unusual volumes of Key Vault operations
  • Suspicious sequences of Key Vault operations

The goal is to detect threats that may not be obvious simply by looking at whether an individual request was technically authorized.

For example, suppose a service principal normally accesses one Key Vault from an expected application environment. Suddenly, the same identity accesses many Key Vaults and performs an unusually large number of secret operations.

The individual requests might be authorized, but the behavioral pattern could indicate that the identity has been compromised.

Defender for Key Vault can identify this type of activity and generate a security alert.


Why Defender for Key Vault Is Important

Key Vault frequently contains information that can provide an attacker with access to other systems.

For example, a secret might contain:

  • A database password
  • An API key
  • A connection string
  • A service credential
  • A certificate
  • An application secret

An attacker who gains access to Key Vault may therefore be able to move laterally into other resources.

This makes Key Vault a particularly attractive target.

Defender for Key Vault adds another security layer by attempting to identify suspicious access after authentication and authorization controls have been applied.

A useful way to think about the security layers is:

Security layerPrimary purpose
Microsoft Entra IDAuthentication and identity
Azure RBAC / Key Vault permissionsAuthorization
Network rules / firewallNetwork access control
Private EndpointPrivate network connectivity
Diagnostic loggingActivity visibility
Microsoft Defender for Key VaultThreat detection
Microsoft SentinelSIEM/SOAR investigation and response

The important exam concept is that these controls complement one another.


Defender for Key Vault vs. Key Vault Security Controls

A common SC-500 question may describe several possible security mechanisms and ask which one addresses a particular requirement.

Authentication

Microsoft Entra ID determines who or what is attempting to access Key Vault.

Authorization

Azure RBAC or Key Vault’s supported permission model determines what that identity is allowed to do.

Network Security

Key Vault firewall/network settings and private endpoints determine where network access can originate from and how the service is reached.

Logging

Key Vault diagnostic logging records operations and provides information for auditing and investigation.

Defender for Key Vault

Defender for Key Vault analyzes activity for suspicious or anomalous behavior and generates security alerts.

Therefore:

Defender for Key Vault does not grant access, deny access, replace RBAC, or act as the Key Vault firewall.

Its primary role is threat detection.


Enabling Defender for Key Vault

Defender for Key Vault is enabled through Microsoft Defender for Cloud.

The general process is:

  1. Open Microsoft Defender for Cloud in the Azure portal.
  2. Select Environment settings.
  3. Select the Azure subscription to protect.
  4. Open Defender plans.
  5. Turn the Key Vault plan on.
  6. Save the configuration.

Once enabled, Defender for Key Vault provides threat protection for the applicable Key Vault resources in the protected subscription.

Important exam point

Defender for Key Vault is a Defender for Cloud workload protection plan.

It is not a feature that you enable by going into an individual Key Vault and turning on a generic “Defender” switch.


Prerequisites

Before enabling Defender for Key Vault, Microsoft Defender for Cloud must be enabled for the Azure subscription.

The basic sequence is therefore:

Azure subscription → Microsoft Defender for Cloud → Key Vault plan

You should also understand that enabling Defender for Key Vault is different from configuring Key Vault itself.

A secure Key Vault should still have appropriate:

  • Identity controls
  • RBAC permissions
  • Network restrictions
  • Private connectivity where appropriate
  • Logging
  • Monitoring
  • Key and secret lifecycle management

Defender for Key Vault provides additional threat detection rather than replacing these controls.


What Does Defender for Key Vault Detect?

Defender for Key Vault focuses on unusual and potentially malicious access patterns.

The exact alerts can evolve as Microsoft improves its threat detection capabilities, but important categories include the following.

Access From a Suspicious IP Address

Defender for Key Vault can detect successful Key Vault access originating from an IP address identified as suspicious by Microsoft’s threat intelligence.

For example:

A service principal normally accesses a Key Vault from an organization’s Azure environment. The same identity successfully accesses the vault from an IP address associated with malicious activity.

This can generate a security alert.

The important point is that the access may have succeeded.

Defender is detecting the suspicious nature of the access rather than simply reporting a failed authorization attempt.


Access From a TOR Exit Node

Access to a Key Vault through a known TOR exit node can indicate an attempt to conceal the source of the connection.

Defender for Key Vault can generate an alert when a vault is accessed from a known TOR exit node.

This is another example of behavioral/threat intelligence detection rather than traditional authorization.


High Volume of Key Vault Operations

Defender can identify an anomalous volume of operations involving a user, service principal, or Key Vault.

For example:

An application normally performs a few hundred Key Vault operations per day.

Suddenly, thousands of operations occur within a short period.

That behavior could indicate:

  • Credential compromise
  • Secret discovery
  • Automated data collection
  • An application malfunction
  • Other abnormal activity

Defender can generate an alert for investigation.

Importantly, an anomaly does not automatically mean an attack occurred.

Legitimate applications can sometimes produce unusual patterns.


Suspicious Policy Change Followed by Secret Retrieval

One particularly important attack pattern involves changing access permissions and then retrieving secrets.

For example:

  1. An identity modifies Key Vault access permissions.
  2. The identity subsequently performs Secret Get operations.
  3. The sequence is unusual for that identity.

This could indicate that an attacker has obtained sufficient privileges to modify access controls and is attempting to gain access to secrets that were previously inaccessible.

Defender for Key Vault can identify this type of suspicious sequence.

Exam takeaway

Pay attention to sequences of actions, not just individual actions.

A single legitimate operation might not be suspicious.

A sequence such as:

change permissions → retrieve secrets

can be much more significant.


Suspicious Secret Listing Followed by Secret Retrieval

Another important pattern involves secret enumeration.

An attacker may first attempt to determine what secrets exist and then retrieve them.

For example:

Secret List → Secret Get → Secret Get → Secret Get

This can be associated with attempts to discover and extract credentials.

Defender for Key Vault can detect anomalous patterns involving secret listing followed by secret retrieval.

This is particularly important because stolen Key Vault secrets can potentially provide access to additional systems.


Unusual User Access

Defender can identify situations where a user who does not normally access a Key Vault suddenly accesses it.

For example:

An employee normally works with development resources and has never accessed production Key Vaults.

Suddenly, that user accesses a production Key Vault.

Even if the access is technically permitted, the behavioral anomaly may warrant investigation.


Unusual Application or Service Principal Access

The same concept applies to applications and service principals.

For example:

A service principal normally accesses:

  • Key Vault A

It suddenly begins accessing:

  • Key Vault B
  • Key Vault C
  • Key Vault D
  • Key Vault E

Defender may identify the unusual application behavior.

This can be particularly useful for detecting compromised application identities.


Unusual User/Application Pair

Defender can also identify an unusual combination of a user and application/service principal accessing a Key Vault.

This provides a more contextual view than simply asking:

“Did this user access the vault?”

The detection can consider whether the user/application relationship itself is unusual.


High-Volume Access to Multiple Key Vaults

Another potentially suspicious pattern is when a user or service principal accesses an unusually large number of Key Vaults.

An attacker who compromises an identity may attempt to enumerate vaults throughout an environment in search of valuable secrets.

For example:

Key Vault 1 → Key Vault 2 → Key Vault 3 → Key Vault 4 → …

An unusually broad access pattern may indicate credential compromise or reconnaissance.


Unusual Access Denied Events

Defender for Key Vault can also detect certain unusual unsuccessful access attempts.

Examples include:

  • A user who normally doesn’t access a Key Vault attempts access.
  • A user or service principal attempts to access an unusually large number of Key Vaults.
  • An access attempt originates from a suspicious IP address.

The distinction is important:

Successful suspicious access

Potentially indicates that an attacker has successfully gained access.

Failed suspicious access

May indicate reconnaissance or an attempted attack that was blocked.

Both can be useful security signals.


Defender for Key Vault Alerts

When Defender for Key Vault identifies suspicious activity, it generates security alerts in Microsoft Defender for Cloud.

The alert provides information that can help security personnel investigate the activity.

Depending on the alert, information can include details about:

  • The affected Key Vault
  • The user or service principal
  • The activity
  • Source IP information
  • The suspicious behavior
  • Severity
  • Threat context
  • Recommended investigation or remediation actions

Security teams can review these alerts through the Defender for Cloud security alerts experience.


Investigating a Defender for Key Vault Alert

When an alert is generated, don’t immediately assume that the identity has been compromised.

Instead, investigate the context.

A useful investigation process is:

1. Identify the affected Key Vault

Determine which vault was accessed.

Ask:

  • Is this a production vault?
  • What type of information does it contain?
  • Which applications depend on it?

2. Identify the identity

Determine whether the activity came from:

  • A user
  • Service principal
  • Managed identity
  • Application

3. Examine the activity

Determine what operations were performed.

For example:

  • Secret List
  • Secret Get
  • Key operations
  • Permission changes

4. Examine the source

Investigate:

  • Source IP
  • Geographic context
  • Network path
  • Whether the source is expected

5. Determine whether the behavior is legitimate

For example, a deployment may legitimately cause a temporary increase in Key Vault operations.

6. Investigate related activity

Look for related activity involving:

  • Microsoft Entra ID
  • Azure resources
  • Other Key Vaults
  • Applications
  • Service principals
  • Other security alerts

7. Respond appropriately

Depending on the investigation, response actions could include:

  • Disabling or restricting a compromised identity
  • Revoking credentials
  • Rotating secrets
  • Reviewing RBAC assignments
  • Restricting network access
  • Removing unauthorized permissions
  • Investigating other affected resources

Defender for Key Vault and Microsoft Sentinel

Defender for Cloud security alerts can be integrated with broader security operations workflows.

Microsoft Sentinel can be used to provide centralized SIEM/SOAR capabilities.

This allows organizations to correlate Key Vault security alerts with other security data.

For example:

Defender for Key Vault alert

↓

Microsoft Sentinel

↓

Correlate with Entra ID sign-in activity

↓

Investigate compromised identity

↓

Automate response if appropriate

This is especially useful in environments where Key Vault activity needs to be correlated with identity, endpoint, application, and network events.


Defender for Key Vault and Key Vault Diagnostic Logging

These capabilities serve different purposes.

Key Vault diagnostic logging

Provides information about operations occurring within Key Vault.

It is primarily useful for:

  • Auditing
  • Troubleshooting
  • Investigation
  • Operational monitoring

Defender for Key Vault

Provides specialized threat detection for suspicious access patterns.

It is primarily useful for:

  • Threat detection
  • Security alerts
  • Behavioral analysis
  • Identifying potentially malicious activity

The two should generally be considered complementary.


Defender for Key Vault vs. Defender CSPM

This is an important distinction for the exam.

Defender for Key Vault focuses on protecting Key Vault through threat detection of suspicious access and activity.

Defender CSPM focuses primarily on improving security posture, identifying risks, and providing security recommendations and related posture-management capabilities.

For example:

RequirementAppropriate capability
Detect suspicious Key Vault accessDefender for Key Vault
Detect anomalous secret access patternsDefender for Key Vault
Identify security misconfigurationsDefender CSPM / Defender for Cloud posture capabilities
Improve overall cloud security postureDefender CSPM
Generate Key Vault threat alertsDefender for Key Vault

A scenario asking you to detect malicious or anomalous Key Vault access should immediately make you think of Defender for Key Vault.


Defender for Key Vault vs. Azure Policy

Azure Policy and Defender for Key Vault solve very different problems.

Azure Policy

Used to enforce or audit configuration requirements.

For example:

Require Defender for Key Vault to be enabled.

A built-in Azure Policy definition can audit whether Defender for Key Vault is enabled.

Defender for Key Vault

Actually provides the workload threat-detection capability for Key Vault.

Therefore:

Azure Policy → governance

Defender for Key Vault → threat protection

An organization can use both.


A Typical Defense-in-Depth Architecture

A secure Key Vault environment might look like this:

Microsoft Entra ID

↓
Authentication

Azure RBAC

↓
Authorization

Key Vault firewall / network rules

↓
Network restriction

Private Endpoint

↓
Private connectivity

Key Vault diagnostic logging

↓
Audit and visibility

Microsoft Defender for Key Vault

↓
Threat detection

Microsoft Sentinel

↓
Centralized investigation and automated response

This layered approach is consistent with the defense-in-depth philosophy emphasized throughout the SC-500 exam.


Key Exam Concepts to Remember

The following points are particularly important for SC-500.

Remember #1: Defender for Key Vault is part of Defender for Cloud

You enable it through the Defender for Cloud → Environment settings → Defender plans experience.

Remember #2: It detects suspicious activity

Its primary purpose is threat detection, not authorization.

Remember #3: It can detect anomalous behavior

Examples include:

  • Unusual users
  • Unusual applications
  • Unusual user/application combinations
  • Unusual operation patterns
  • High operation volume
  • Access from suspicious IP addresses
  • TOR-based access
  • Suspicious secret listing and retrieval
  • Suspicious permission changes followed by secret retrieval

Remember #4: A successful login can still be suspicious

An identity can be valid and authorized while its behavior is anomalous.

Remember #5: It does not replace RBAC

RBAC determines what an identity is allowed to do.

Defender determines whether activity appears suspicious.

Remember #6: Logging and Defender are complementary

Logging provides activity records.

Defender provides specialized threat detection and security alerts.

Remember #7: Defender alerts require investigation

An anomaly is a security signal, not automatically proof of compromise.

Remember #8: Think behaviorally

Many Defender for Key Vault detections are based on patterns and anomalies, rather than a single isolated event.


Practice Exam Questions

Question 1

An organization stores database credentials and API keys in Azure Key Vault. The security team wants to detect when a service principal begins accessing the vault in an unusual manner compared with its historical behavior.

Which solution should you implement?

A. Azure Resource Locks

B. Microsoft Defender for Key Vault

C. Azure Firewall

D. Azure Policy

Answer: B

Explanation

Microsoft Defender for Key Vault is designed to detect unusual and potentially harmful access patterns involving Key Vault. It can identify anomalous behavior involving users, service principals, applications, operation patterns, and access locations.

Azure Resource Locks protect resources from accidental deletion or modification. Azure Firewall provides network traffic filtering, while Azure Policy provides governance and compliance enforcement. None is specifically designed to perform behavioral threat detection for Key Vault.


Question 2

A security engineer wants to detect a situation in which an attacker changes Key Vault permissions and then retrieves secrets that the attacker previously could not access.

Which Defender for Key Vault capability is most relevant?

A. Detection of excessive Key Vault latency

B. Detection of suspicious policy changes followed by secret retrieval

C. Detection of expired certificates

D. Detection of Key Vault resource deletion

Answer: B

Explanation

Defender for Key Vault can detect anomalous patterns in which a user or service principal performs a suspicious vault policy change followed by Secret Get operations.

This pattern can indicate that an attacker modified permissions to gain access to previously inaccessible secrets.

The other choices do not describe this Defender for Key Vault detection scenario.


Question 3

An organization has enabled Microsoft Defender for Cloud and wants to enable threat protection specifically for Azure Key Vault.

Where should the security engineer configure the protection?

A. Azure Key Vault → Networking → Firewalls

B. Azure Key Vault → Access configuration → RBAC

C. Microsoft Defender for Cloud → Environment settings → Defender plans → Key Vault

D. Microsoft Entra admin center → Authentication methods

Answer: C

Explanation

Defender for Key Vault is enabled as a Defender for Cloud workload protection plan.

The administrator selects the appropriate subscription under Microsoft Defender for Cloud → Environment settings, enables the Key Vault plan, and saves the configuration.

The other options configure different security capabilities.


Question 4

A user who has never previously accessed a production Key Vault suddenly accesses it from a location that is unusual for that user. The user has valid permissions.

What is the primary security capability that can identify this type of behavior?

A. Azure Resource Manager locks

B. Azure Private Link

C. Microsoft Defender for Key Vault

D. Azure Policy

Answer: C

Explanation

Defender for Key Vault can identify unusual user access patterns, including situations where a user who does not normally access a Key Vault suddenly accesses one.

The fact that the user has valid permissions does not necessarily mean the activity is safe. Defender for Key Vault is specifically designed to detect potentially suspicious behavior even when the activity involves an otherwise valid identity.


Question 5

A service principal normally accesses one Key Vault. An attacker compromises the service principal and begins enumerating many Key Vaults in the organization.

Which Defender for Key Vault detection is most relevant?

A. User or service principal accessing an anomalously high volume of Key Vaults

B. Key Vault certificate expiration

C. Key Vault resource lock modification

D. Azure VM disk encryption failure

Answer: A

Explanation

Defender for Key Vault can detect anomalously high-volume access to Key Vaults by users or service principals.

This type of behavior can indicate that an attacker is attempting to discover additional vaults and credentials after compromising an identity.

The other choices are unrelated to this Key Vault threat-detection scenario.


Question 6

An organization wants to ensure that every Azure subscription has Microsoft Defender for Key Vault enabled. The organization wants noncompliant subscriptions to be identified automatically.

Which service is best suited for enforcing or auditing this configuration requirement?

A. Microsoft Sentinel

B. Azure Policy

C. Microsoft Defender for Key Vault

D. Azure Bastion

Answer: B

Explanation

Azure Policy can audit or enforce organizational configuration requirements. There is a built-in policy definition for auditing whether Defender for Key Vault is enabled.

The important distinction is:

Azure Policy → governance and compliance

Defender for Key Vault → threat detection

Microsoft Sentinel is primarily a SIEM/SOAR platform, while Azure Bastion provides secure administrative access to virtual machines.


Question 7

A security analyst receives a Defender for Key Vault alert indicating that a vault was accessed from a known TOR exit node.

What does this alert primarily indicate?

A. The Key Vault certificate has expired

B. The Key Vault has reached its transaction limit

C. The vault was accessed through a network associated with TOR

D. The Key Vault was automatically deleted

Answer: C

Explanation

Defender for Key Vault can generate alerts when a Key Vault is accessed from a known TOR exit node.

TOR can be used to obscure the source of network traffic, so access from a TOR exit node can represent a potential threat indicator.

The alert does not itself prove that the account was compromised, but it should be investigated.


Question 8

A security engineer is explaining the difference between Azure Key Vault diagnostic logging and Microsoft Defender for Key Vault to a new administrator.

Which statement is correct?

A. Diagnostic logging provides activity information, while Defender for Key Vault provides specialized threat detection

B. Diagnostic logging replaces the need for Defender for Key Vault

C. Defender for Key Vault is responsible for assigning RBAC permissions

D. Defender for Key Vault replaces Key Vault network controls

Answer: A

Explanation

Key Vault diagnostic logging provides information about operations performed against the vault and supports auditing and investigation.

Defender for Key Vault adds specialized threat-detection capabilities designed to identify unusual and potentially malicious access patterns.

These capabilities are complementary.

Defender for Key Vault does not assign RBAC permissions or replace network controls.


Question 9

A security team wants to investigate whether a suspicious Key Vault access event is related to other identity and security events across the organization.

Which service would provide the strongest centralized SIEM/SOAR capability for correlating these events?

A. Azure Resource Manager

B. Azure Key Vault

C. Microsoft Sentinel

D. Azure Policy

Answer: C

Explanation

Microsoft Sentinel provides SIEM/SOAR capabilities that can be used to collect, correlate, investigate, and respond to security events from multiple sources.

For example, a Defender for Key Vault alert could be correlated with Microsoft Entra sign-in activity and other security signals to determine whether an identity may have been compromised.

Azure Key Vault is the protected service, Azure Resource Manager manages Azure resources, and Azure Policy provides governance.


Question 10

A developer reports that a Key Vault application is generating thousands of operations in a short period. The application normally performs only a small number of operations each day.

Which Defender for Key Vault capability could identify this behavior?

A. Detection of expired Key Vault certificates

B. Detection of anomalous Key Vault operation volume

C. Detection of Azure VM configuration drift

D. Detection of missing resource locks

Answer: B

Explanation

Defender for Key Vault can detect anomalous operation volumes involving users, service principals, and Key Vaults.

An unusually high volume of operations could be legitimate—for example, because of a deployment or application change—but it can also indicate credential compromise, automated secret discovery, or another attack.

The alert should therefore be investigated rather than automatically treated as proof of malicious activity.


SC-500 Exam Quick Reference

ConceptWhat to remember
Defender for Key VaultThreat protection for Azure Key Vault
Where enabled?Microsoft Defender for Cloud
Configuration levelDefender for Cloud environment/subscription
Primary purposeDetect suspicious and anomalous Key Vault activity
Detects suspicious IP access?Yes
Detects TOR access?Yes
Detects unusual users?Yes
Detects unusual applications/service principals?Yes
Detects anomalous operation volume?Yes
Detects suspicious secret listing/retrieval patterns?Yes
Detects suspicious permission change + secret retrieval?Yes
Replaces Azure RBAC?No
Replaces Key Vault firewall?No
Replaces diagnostic logging?No
Provides threat alerts?Yes
Can work with broader security operations workflows?Yes
Azure Policy’s roleGovernance/auditing of configuration
Microsoft Sentinel’s roleSIEM/SOAR, correlation, investigation, response

The Big Exam Takeaway

When an SC-500 question describes unusual, anomalous, or potentially malicious access to Azure Key Vault, think:

Microsoft Defender for Key Vault

When the question instead asks you to control who can access Key Vault, think:

Microsoft Entra ID + Azure RBAC/Key Vault permissions

When it asks you to restrict where Key Vault can be accessed from, think:

Network rules, firewall settings, and/or Private Endpoint

When it asks you to record and audit Key Vault operations, think:

Diagnostic logging

When it asks you to enforce organizational configuration requirements, think:

Azure Policy

And when it asks you to correlate Key Vault security events with identity, endpoint, and other security signals, think:

Microsoft Sentinel

That distinction between preventive controls, governance controls, logging, and threat detection is one of the most important concepts to retain for this SC-500 topic.


Go to the SC-500 Exam Prep Hub main page

Secure secrets by using Azure Key Vault, including rotation and retrieval (AI-200 Exam Prep)

This post is a part of the AI-200: Developing AI Cloud Solutions on Azure  Exam Prep Hub.
This topic falls under these sections:
Secure, monitor, and troubleshoot Azure solutions (20–25%)
   --> Implement secure Azure solutions
      --> Secure secrets by using Azure Key Vault, including rotation and retrieval


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Overview

Applications frequently need credentials, API keys, connection strings, passwords, certificates, and other sensitive values to communicate with external services. Storing these values directly in source code, configuration files, or deployment scripts creates unnecessary security risk.

Azure Key Vault provides a centralized service for securely storing and managing secrets, keys, and certificates. For the AI-200 exam, developers should understand how applications authenticate to Key Vault, retrieve secrets, implement least-privilege access, and support secret rotation without unnecessarily interrupting application operations.

A particularly important principle is:

Avoid secrets whenever Azure managed identities can provide passwordless authentication.

When a secret is unavoidable, store it in Key Vault and allow the application to retrieve it securely at runtime.


1. What Is Azure Key Vault?

Azure Key Vault is a managed service designed to protect and manage sensitive information used by applications and Azure services.

Key Vault can store three major types of security objects:

ObjectPrimary purpose
SecretsPasswords, API keys, connection strings, tokens, and other sensitive values
KeysCryptographic keys used for encryption, signing, and related cryptographic operations
CertificatesX.509 certificates and their associated lifecycle management

For AI applications, secrets might include:

  • Third-party API keys
  • Database passwords
  • Service credentials
  • Storage access credentials
  • Application-specific secrets
  • Credentials for systems that don’t support Microsoft Entra authentication

A secret should generally be treated as a value that the application needs to retrieve and use, whereas a key is often used by a cryptographic operation.


2. Why Applications Should Not Store Secrets Directly

Consider an application containing:

API_KEY = "abc123..."

Even if the value is stored in an environment variable rather than source code, it can still create security and operational problems.

Potential issues include:

  • Accidental exposure through source control
  • Exposure through configuration backups
  • Difficulty rotating credentials
  • Credentials being copied between environments
  • Excessive access by developers or deployment systems
  • Difficulty auditing access
  • Credentials remaining valid longer than necessary

A better architecture is:

Application
|
| Microsoft Entra authentication
v
Managed Identity
|
| authorized to read specific secret
v
Azure Key Vault
|
v
Secret value

The application doesn’t need to know a Key Vault password or store another credential simply to authenticate to Key Vault.

Microsoft recommends using managed identities for applications and services accessing Key Vault because they eliminate the need to embed credentials in the application.


3. Authentication vs. Authorization

A common AI-200 exam distinction is the difference between authentication and authorization.

Authentication

Authentication answers:

Who are you?

For example, an Azure Function can authenticate to Azure using its managed identity.

Authorization

Authorization answers:

What are you allowed to do?

After the Function has authenticated, Azure must determine whether that identity is allowed to retrieve a particular Key Vault secret.

Therefore:

Managed Identity
|
| Authentication
v
Microsoft Entra ID
|
| Authorization
v
Azure Key Vault

Both concepts are necessary.

Simply giving an application a managed identity does not automatically give it access to secrets.

The identity must also have appropriate Key Vault data-plane permissions.


4. Managed Identities

A managed identity provides an Azure-managed identity that applications can use to authenticate to services that support Microsoft Entra authentication.

There are two primary types.

System-assigned managed identity

A system-assigned identity is tied to a specific Azure resource.

For example:

Azure Function App
|
+-- System-assigned managed identity

If the Function App is deleted, its system-assigned identity is also deleted.

User-assigned managed identity

A user-assigned identity is a separate Azure resource that can be assigned to multiple Azure resources.

For example:

User-assigned identity
|
+---- Function App A
|
+---- Function App B
|
+---- Container App

This can be useful when multiple applications need to use the same identity and permissions.

For many application scenarios, either type can provide passwordless authentication to Key Vault.


5. Azure RBAC for Key Vault

Azure Key Vault supports authorization through Azure role-based access control (RBAC), as well as the older access-policy model.

For new solutions, Azure RBAC is the preferred authorization model.

Key Vault separates management operations from operations involving the actual data stored in the vault.

Control plane

The control plane manages the Key Vault resource itself.

Examples include:

  • Creating a vault
  • Deleting a vault
  • Configuring vault properties
  • Managing certain resource-level settings

Data plane

The data plane operates on the contents of the vault.

Examples include:

  • Reading secrets
  • Creating secrets
  • Updating secrets
  • Deleting secrets
  • Reading keys
  • Performing cryptographic operations

This distinction is important because an identity that can manage a Key Vault resource does not necessarily need permission to read secret values.


6. Least Privilege

Applications should receive only the permissions they actually require.

For example, suppose an application only needs to retrieve a secret.

It should not receive permissions to:

  • Delete secrets
  • Create secrets
  • Manage keys
  • Manage certificates
  • Change Key Vault permissions

With Azure RBAC, the Key Vault Secrets User role provides access to read secret contents. The Key Vault Secrets Officer role provides much broader permissions to manage secrets.

Exam tip

If an application only needs to read secret values, think:

Key Vault Secrets User

If an application needs to manage secrets, a broader role such as:

Key Vault Secrets Officer

may be appropriate.

Don’t automatically choose a highly privileged role simply because it makes the application work.


7. Retrieving Secrets from Key Vault

Applications should normally retrieve secrets programmatically using the Azure SDK.

A common .NET pattern uses:

  • SecretClient
  • DefaultAzureCredential

Conceptually:

Application
|
+-- DefaultAzureCredential
|
+-- SecretClient
|
v
Azure Key Vault
|
v
Secret

For example, a .NET application might use:

var credential = new DefaultAzureCredential();
var client = new SecretClient(
new Uri(keyVaultUrl),
credential);
KeyVaultSecret secret =
await client.GetSecretAsync("MySecret");
string value = secret.Value;

The important architectural point is that the application doesn’t contain a Key Vault password.

DefaultAzureCredential can use an appropriate Microsoft Entra credential depending on the environment. During local development, it can use developer credentials, while an Azure-hosted application can use its managed identity.


8. Secret Versions

Key Vault supports versioning for secrets.

Suppose an application has:

DatabasePassword

The secret might have:

DatabasePassword
├── Version 1
├── Version 2
└── Version 3

When a new value is stored, Key Vault creates a new version rather than simply overwriting the existing version in place.

This is extremely useful for rotation.

Versionless retrieval

An application can retrieve the current version of a secret by requesting the secret without specifying a version.

Conceptually:

GetSecret("DatabasePassword")

This allows the application to receive the current version.

Version-specific retrieval

An application can also request a specific version.

Conceptually:

GetSecret("DatabasePassword", "specific-version")

This can be useful when an application intentionally needs a known version.

However, hard-coding a secret version can prevent the application from automatically receiving the newest rotated credential.


9. Secret Rotation

Secret rotation means periodically replacing an existing credential with a new credential.

For example:

Old password
|
| rotation
v
New password

Regular rotation limits the amount of time a compromised credential remains useful.

Rotation is especially important for:

  • Database passwords
  • API keys
  • Service credentials
  • Application passwords
  • Other long-lived secrets

Azure’s guidance emphasizes minimizing secrets and rotating credentials when they are required.


10. Secret Rotation vs. Key Rotation

Don’t confuse secret rotation with cryptographic key rotation.

Azure Key Vault provides specific automatic rotation capabilities for cryptographic keys.

For secrets, rotation commonly involves an automation process that:

  1. Generates or obtains a new credential.
  2. Updates the target service.
  3. Stores the new credential as a new Key Vault secret version.
  4. Causes applications to retrieve the updated value.
  5. Eventually invalidates the old credential.

For example:

                +----------------------+
                | Credential Provider  |
                +----------+-----------+
                           |
                           v
                  Generate new secret
                           |
              +------------+------------+
              |                         |
              v                         v
       Target service             Azure Key Vault
       gets new password          stores new version
              |                         |
              +------------+------------+
                           |
                           v
                     Application
                     retrieves new
                        version

Key Vault’s automatic rotation capabilities vary by object type. For secrets, rotation commonly requires integration with the systems that use those credentials rather than simply turning on the same type of automatic key-rotation policy used for cryptographic keys.


11. Zero-Downtime Secret Rotation

A major concern with rotation is avoiding application outages.

Imagine:

Application ---> Database
password = OLD

If you immediately disable the old password before the application has started using the new password, requests can fail.

A safer approach is a coordinated rotation process.

Example

Suppose the database supports two valid credentials temporarily.

The rotation process can be:

Step 1 — Create new credential

Database:
OLD credential
NEW credential

Step 2 — Store new credential

Key Vault:
DatabasePassword
├── Version 1 = OLD
└── Version 2 = NEW

Step 3 — Application retrieves the new version

New application instances begin using the new credential.

Step 4 — Verify

Confirm that applications are successfully authenticating.

Step 5 — Revoke old credential

Only after applications have migrated should the old credential be invalidated.

This approach reduces the risk of downtime.


12. Event-Driven Secret Rotation

Polling Key Vault continuously to determine whether a secret needs to be updated is generally inefficient.

Azure Key Vault can integrate with Azure Event Grid to publish events associated with secret lifecycle changes.

Events include notifications related to:

  • A new secret version
  • A secret approaching expiration
  • A secret expiring

For example:

Azure Key Vault
|
| SecretNearExpiry
v
Azure Event Grid
|
v
Azure Function
|
+--> Generate new credential
|
+--> Update target service
|
+--> Store new Key Vault version

This event-driven pattern can automate credential rotation workflows.


13. Secret Expiration

Secrets can have expiration information.

An application should not assume that a secret remains valid indefinitely.

Key Vault can produce lifecycle-related events such as:

  • SecretNearExpiry
  • SecretExpired
  • SecretNewVersionCreated

These events can be used to trigger monitoring, notification, or automated rotation processes.

Important exam concept

A near-expiry event is not the same thing as automatic secret rotation.

The event can notify or trigger another component, such as an Azure Function, which then performs the appropriate rotation workflow.


14. Retrieving Secrets Efficiently

Applications shouldn’t necessarily call Key Vault every time they need a secret.

For example, consider an API receiving 10,000 requests per minute.

Doing this for every request:

Request
|
v
Key Vault
|
v
Secret

can create unnecessary network calls and dependency on Key Vault availability.

A better pattern is to retrieve the secret and cache it for an appropriate period.

Application
|
+-- Local/in-memory cache
|
+-- Secret available?
| |
| YES ---> use cached value
|
+-- NO ---> retrieve from Key Vault

The cache lifetime should be balanced against security requirements and rotation frequency.

A very long cache lifetime could cause the application to continue using an old credential after rotation.

Microsoft’s AI-200 training specifically emphasizes caching patterns that reduce Key Vault API calls while maintaining credential freshness.


15. Handling Rotation with Caching

Suppose:

10:00 AM -> Application retrieves Version 1
10:15 AM -> Secret is rotated to Version 2

If the application caches Version 1 for several hours, it may continue using the old credential.

Therefore, applications should have a strategy for detecting or recovering from credential changes.

Possible approaches include:

Short-lived cache

Refresh the secret periodically.

Event-driven refresh

Use an event such as SecretNewVersionCreated to initiate a refresh.

Retry and refresh

If authentication fails because a credential may have changed:

  1. Refresh the secret from Key Vault.
  2. Retry the operation.
  3. Avoid repeatedly retrying a permanently invalid credential.

The appropriate strategy depends on the application’s requirements.


16. Key Vault Networking

Security isn’t limited to identity and permissions.

Key Vault access can also be restricted through network controls.

Depending on the architecture, you may use mechanisms such as:

  • Public network access restrictions
  • Firewall rules
  • Virtual network integration
  • Private endpoints

The goal is to reduce unnecessary network exposure while ensuring authorized applications can reach the vault.

A secure architecture can therefore involve multiple layers:

Application
|
| Managed Identity
v
Microsoft Entra ID
|
| Authorization
v
Azure Key Vault
|
| Network controls
v
Secret

17. Monitoring Key Vault Access

Key Vault operations can be logged.

Examples include operations such as:

  • Secret get
  • Secret update
  • Secret delete
  • Secret list
  • Secret version listing

These logs can help organizations determine:

  • Who accessed a secret
  • When it was accessed
  • What operation was performed
  • Whether suspicious access patterns occurred

Key Vault diagnostic logging can capture secret-related operations, including SecretGet and SecretUpdate.

For security-sensitive applications, logging and monitoring should be part of the overall secret-management strategy.


18. Common Design Pattern

A strong AI application architecture might look like this:

                         +----------------------+
                         |    Azure Key Vault   |
                         |                      |
                         | API credentials      |
                         | DB credentials       |
                         | Other secrets        |
                         +----------+-----------+
                                    ^
                                    |
                              Microsoft Entra ID
                                    ^
                                    |
                           Managed Identity
                                    ^
                                    |
+----------------+          +-------+-------+
| Azure Function |          | Container App |
+----------------+          +---------------+
          \                         /
           \                       /
            +---------------------+
                  AI solution

The application:

  1. Uses a managed identity.
  2. Authenticates through Microsoft Entra ID.
  3. Receives authorization through Azure RBAC.
  4. Retrieves only the secrets it needs.
  5. Caches values appropriately.
  6. Handles secret rotation.
  7. Avoids exposing secret values in logs.

19. Common Mistakes to Avoid

Mistake 1: Storing secrets in source code

Avoid:

string apiKey = "secret-value";

Use Key Vault instead.

Mistake 2: Using a client secret just to access Key Vault

If the workload supports managed identity, use it rather than creating another credential that must itself be protected.

Mistake 3: Giving applications excessive permissions

If an application only needs to read secrets, don’t give it administrative access to the vault.

Mistake 4: Confusing control-plane and data-plane permissions

Being able to manage the Key Vault resource does not necessarily mean an identity can retrieve secret values.

Mistake 5: Hard-coding secret versions

This can prevent applications from automatically seeing a newly rotated version.

Mistake 6: Rotating credentials without updating dependent services

Changing the value in Key Vault alone doesn’t necessarily change the credential accepted by the target system.

Mistake 7: Immediately revoking the old credential

Doing so can cause downtime if applications have not migrated.

Mistake 8: Logging secret values

Never write secret values to:

  • Application logs
  • Console output
  • Error messages
  • Telemetry
  • Exceptions
  • Debug traces

Mistake 9: Excessive Key Vault calls

Retrieve and cache secrets appropriately rather than unnecessarily querying Key Vault for every operation.

Mistake 10: Assuming Event Grid performs the entire rotation

Event Grid provides event delivery. Your automation or application must perform the appropriate response.


20. AI-200 Exam Takeaways

For the exam, remember these relationships:

ConceptRemember
Azure Key VaultSecurely stores secrets, keys, and certificates
Managed identityEnables passwordless Azure authentication
Microsoft Entra IDProvides authentication
Azure RBACControls authorization
Key Vault Secrets UserRead secret contents
Key Vault Secrets OfficerManage secrets
Secret versionRepresents a particular version of a secret
Versionless retrievalRetrieves the current secret version
RotationReplaces credentials periodically
Event GridCan notify applications about secret lifecycle events
CachingReduces Key Vault calls but must account for rotation
Least privilegeGive applications only required permissions
Zero-downtime rotationUpdate consumers before revoking old credentials
LoggingMonitor access without exposing secret values

The most important mental model is:

Authenticate with managed identity → authorize with least-privilege Key Vault permissions → retrieve secrets securely → cache appropriately → rotate safely → monitor access.


Practice Exam Questions

Question 1

An Azure Function needs to retrieve the value of a database password stored in Azure Key Vault. The Function App has a system-assigned managed identity. The application must not store any credentials for accessing Key Vault.

What should you configure?

A. Assign the Key Vault Secrets User role to the Function App’s managed identity.

B. Store a Key Vault administrator password in the Function App settings.

C. Assign the Owner role to the Function App’s managed identity.

D. Create a client secret for the Function App and store it in Azure App Configuration.

Answer: A

Explanation:
The Function’s managed identity can authenticate to Azure without storing credentials. The Key Vault Secrets User role allows the identity to read secret contents. Owner is unnecessarily privileged, and storing another credential defeats the purpose of managed identity.


Question 2

An organization wants to rotate a database password stored in Azure Key Vault. The application must continue operating while the password is changed.

Which approach provides the best zero-downtime strategy?

A. Delete the existing secret before creating the new password.

B. Disable the application’s managed identity during rotation.

C. Replace the Key Vault with Azure App Configuration.

D. Create the new credential, update the target database, store the new secret version, allow applications to transition, and revoke the old credential afterward.

Answer: D

Explanation:
A coordinated rotation allows both the old and new credentials to coexist temporarily. The new credential is deployed and verified before the old credential is revoked. This reduces the likelihood of authentication failures during rotation.


Question 3

An application currently retrieves a Key Vault secret by explicitly specifying Version 4. Version 5 has now been created as part of a credential rotation. The application continues using Version 4.

What is the most likely reason?

A. Key Vault cannot contain multiple versions of a secret.

B. Azure RBAC prevents version changes.

C. The application explicitly requested Version 4 instead of retrieving the current version.

D. Managed identities can only access the first version of a secret.

Answer: C

Explanation:
A version-specific request intentionally retrieves that particular version. If an application needs to follow the current secret version, it should retrieve the secret without hard-coding a specific version.


Question 4

A company wants to automatically detect when an Azure Key Vault secret is approaching expiration and start a rotation workflow.

Which service is most appropriate for detecting and routing the lifecycle event?

A. Azure Load Balancer

B. Azure DNS

C. Azure Storage Queue

D. Azure Event Grid

Answer: D

Explanation:
Azure Key Vault integrates with Event Grid and can emit events associated with secret lifecycle changes, including near-expiry and expiration events. Event Grid can route those events to handlers such as Azure Functions.


Question 5

An application only needs to read the value of a secret from a Key Vault that uses the Azure RBAC permission model.

Which built-in role is the most appropriate?

A. Key Vault Secrets User

B. Owner

C. Key Vault Contributor

D. Key Vault Secrets Officer

Answer: A

Explanation:
Key Vault Secrets User provides read access to secret contents. Secrets Officer is intended for managing secrets and therefore grants broader permissions than the application requires.


Question 6

An AI application makes thousands of requests per minute. Each request currently retrieves the same API key from Azure Key Vault. The API key changes infrequently.

What should the developer consider to reduce unnecessary Key Vault calls?

A. Grant the application Owner permissions.

B. Copy the API key into source code.

C. Cache the secret for an appropriate period while implementing a strategy to refresh it when necessary.

D. Disable Key Vault logging.

Answer: C

Explanation:
Caching can substantially reduce unnecessary Key Vault calls. However, the cache lifetime must be selected carefully because an excessively long cache can cause the application to continue using an old secret after rotation.


Question 7

An administrator grants an application’s managed identity the Azure Key Vault Contributor role. The application still cannot retrieve a secret’s value.

What best explains this behavior?

A. Managed identities cannot access Key Vault.

B. Key Vault Contributor is a control-plane management role and does not provide access to secret contents.

C. Key Vault requires a storage account before secrets can be retrieved.

D. The application must use a user-assigned managed identity.

Answer: B

Explanation:
Key Vault separates management of the vault from access to data stored within it. Key Vault Contributor allows management of the Key Vault resource but does not grant access to secret contents. A suitable data-plane role, such as Key Vault Secrets User, is required.


Question 8

A security team wants applications to authenticate to Azure Key Vault without storing usernames, passwords, client secrets, or certificates in application configuration.

Which solution should the developer use?

A. Store a service principal secret in Azure App Configuration.

B. Embed an administrator credential in the application.

C. Use a shared Key Vault access password.

D. Use an Azure managed identity with Microsoft Entra authentication.

Answer: D

Explanation:
Managed identities provide Azure-managed identities that applications can use to authenticate to supported Azure services without embedding credentials in application code or configuration.


Question 9

A developer implements an automated secret-rotation process. The process receives a SecretNearExpiry event from Azure Event Grid.

What should the developer understand about this event?

A. The event itself automatically replaces the secret in every dependent system.

B. The event means the secret has already expired.

C. The event can trigger automation that performs the required rotation workflow.

D. The event permanently disables the existing secret.

Answer: C

Explanation:
Event Grid provides event delivery. A receiving service, such as Azure Functions, can respond by performing the rotation workflow. A near-expiry event does not itself rotate credentials in every system.


Question 10

A developer needs to secure an AI application’s API credential stored in Azure Key Vault. The developer wants to follow least-privilege principles.

Which design is best?

A. Give the application’s managed identity Owner access to the subscription.

B. Store the API key in the application’s source code and restrict repository access.

C. Give the application’s managed identity Key Vault Secrets Officer permissions even though it only reads the secret.

D. Give the application’s managed identity only the Key Vault data-plane permissions required to retrieve the secret.

Answer: D

Explanation:
Least privilege means granting only the permissions necessary for the workload. If the application only needs to retrieve a secret, it should receive a read-oriented Key Vault role rather than Owner or a broader secret-management role.


Final Study Summary

For “Secure secrets by using Azure Key Vault, including rotation and retrieval,” focus especially on these exam relationships:

Managed Identity → Microsoft Entra authentication → Azure RBAC authorization → Key Vault secret retrieval → versioning → caching → rotation → Event Grid notifications.

A particularly important exam distinction is that storing a new secret version does not automatically mean every application has switched to the new credential. Applications and the systems they connect to must be designed to recognize and safely adopt rotated credentials.

Likewise, Event Grid can notify or trigger a rotation workflow, but it isn’t itself the complete rotation mechanism. A Function, automation process, or other handler may need to update the target resource and Key Vault.

Finally, favor managed identities and least-privilege Azure RBAC over embedded credentials and excessive permissions. These patterns reduce secret exposure and make AI workloads easier to operate securely.


Go to the AI-200 Exam Prep Hub main page