With Azure Managed Identity, apps and VMs can authenticate to Vault without storing any secrets. You reduce leak risk while cutting operational overhead at the same time.
This article covers the official-doc-aligned concepts you need for the Vault Associate exam, along with a minimal setup procedure you can drop straight into a real environment.
A Managed Identity (MI) is an identity managed automatically by Azure AD — you do not create, store, or rotate any credentials yourself. Combined with Vault's Azure Auth Method, the workload logs into Vault using an access token obtained from Azure AD.
From an exam perspective, common topics include the separation between authentication (Auth Method) and authorization (Policy), role-level bind conditions (which MI or resource the request originates from), and the basics of token TTL, Max TTL, and re-authentication.
| Aspect | Managed Identity (Recommended) | Service Principal (Client Secret) | Manually Stored Static Secret |
|---|---|---|---|
| Secret management | Not needed (Azure handles it) | Required (storage and rotation needed) | Required (high risk of human error) |
| Leak risk | Low (no secret material on the host) | Medium (a leak enables lateral movement) | High (risk of exposure and reuse) |
| Rotation | Automatic (transparent to consumers) | Required (CI/CD integration and expiry management are overhead) | Mostly manual (high operational cost) |
| Vault role conditioning | Supported (constrain by subscription, resource group, VM/VMSS, etc.) | Supported (constrain by SPN ID) | Not supported (issuer tends to be ambiguous) |
| Auditability | High (token issuer ties cleanly to the workload) | Medium (shared SPNs are a concern) | Low (hard to trace which actor used the secret) |
Vault's Azure Auth Method accepts an access token signed by Azure AD (obtained via an MI or Service Principal) and performs signature validation and claim inspection. When the role's bind conditions — such as subscription ID, resource group, or VM/VMSS name — are satisfied, Vault issues a client token with the associated policies attached.
The key requirements are: a matching Audience (resource), a token within its validity period, and the role's bind constraints being satisfied.
Vault authentication flow with Managed Identity
First, enable the Azure Auth Method and configure the tenant information and resource (audience). Next, define which Azure resources are allowed to present tokens via a role, and finally attach the Vault policy that grants the actual access.
The example below is a minimal configuration. Replace constraints — subscription, resource group, VM name, etc. — with your real resource IDs to match your environment and requirements.
Vault configuration example (CLI and HTTP API)
# 1) Azure 認証メソッドの有効化
vault auth enable azure
# 2) テナントと audience(resource) の設定
vault write auth/azure/config \
tenant_id="00000000-0000-0000-0000-000000000000" \
resource="https://management.azure.com/"
# 3) ロール定義(例)
# - 実運用では、サブスクリプション/リソースグループ/VM(SS)名などで厳格に縛る
# - token_policies で付与するポリシーを指定
vault write auth/azure/role/app-role \
bound_subscription_ids="11111111-1111-1111-1111-111111111111" \
bound_resource_groups="rg-app-prod" \
# 必要に応じて VM/VMSS 名、スケールセット、SPN ID などの制約を追加 \
token_policies="app-kv-read" \
token_ttl=1h token_max_ttl=4h
# 4) 最小権限ポリシー例(読み取りのみ)
tee /tmp/app-kv-read.hcl <<'POLICY'
path "kv/data/app/*" {
capabilities = ["read"]
}
POLICY
vault policy write app-kv-read /tmp/app-kv-read.hcl
# 参考: HTTP API でのログイン例(後述のワークロード側で実行)
# curl --request POST \
# --data '{"role":"app-role","jwt":"<AAD_access_token>"}' \
# http://<vault_addr>/v1/auth/azure/loginThe workload obtains an Azure AD access token via Azure IMDS. The resource must match the value configured in Vault's auth/azure/config (typically https://management.azure.com/). If it does not match, the request fails with an Audience mismatch.
For a System-assigned MI, no extra parameters are needed. For a User-assigned MI, supply client_id to IMDS to fetch that specific MI's token. Then send the resulting jwt to Vault's /auth/azure/login to receive a Vault token, which you use to retrieve secrets from kv/ or other secrets engines.
A role is the boundary for who is allowed into Vault, while a policy defines what they can do once they get in. Keeping these two concerns clearly separated is the key to stable operations.
Even for the same application, split roles and policies per environment (dev/stg/prd) to shrink the attack surface and blast radius.
Audience mismatch: the resource of the token obtained from IMDS does not match the resource in Vault's auth/azure/config. The safest approach is to align both to https://management.azure.com/.
User-assigned MI: failing to specify client_id when fetching the token from IMDS results in a 403. Use the correct client_id for the intended MI.
Clock skew: AAD token validation is strict about expiry and issuance time. Keep NTP healthy.
Associate
問題 1
Which option best describes the minimal flow for authenticating to Vault from a Managed Identity using the Azure Auth Method?
正解: A
The Azure Auth Method authenticates by passing an Azure AD-signed token (typically obtained from IMDS, with a resource that matches the Vault-side configuration) to /auth/azure/login. B skips authentication entirely and is invalid. C describes a different method and does not involve an MI. D confuses the Secrets Engine (dynamic credential issuance) with the Auth Method.
What is the difference between the Azure Auth Method and the Azure Secrets Engine?
The Auth Method handles authentication into Vault by validating Azure AD tokens. The Secrets Engine controls what you can do once you are in, issuing dynamic Azure credentials such as ephemeral Service Principal secrets. The Auth Method proves identity; the Secrets Engine grants access.
Can Pods on AKS authenticate with Managed Identity too?
Yes. The modern pattern uses Azure AD Workload Identity (OIDC federation), where the Pod obtains an AAD token and passes it to the Azure Auth Method. Behavior depends on cluster and app versions, so watch out for mixing direct IMDS calls with the legacy AAD Pod Identity.
How do you handle endpoints for China or government clouds?
Configure the resource and environment (anything other than AzurePublicCloud) appropriately in Vault's auth/azure/config. Always confirm that the resource of the token the workload retrieves from IMDS matches the Vault-side configuration.
Practice with certification-focused question sets
無料で問題を解いてみるNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Vault Core Concepts: Sealed/Unsealed, Auth, Secrets (2026)
Vault fundamentals — sealed/unsealed state, auth methods, se...
Vault Operations Professional (VOP-003): Complete Guide (2026)
Pass the Vault Operations Professional exam — enterprise pat...
Vault Path-Based Routing: API URL Structure (2026)
How Vault's path-based routing works — mount points, sub-pat...
Vault Tokens: Auth Token Mechanics (2026)
Token fundamentals — service vs. batch tokens, accessor, ren...
Vault Token Types: Service, Batch, Periodic (2026)
Service vs. batch tokens compared — performance, ACL behavio...