Microsoft Azure Developer Associate AZ-204 Practice Question
An Azure Function app needs to retrieve a database password that is stored as a secret in Azure Key Vault during execution. You must avoid storing any credentials in code or app settings and follow the principle of least privilege. What should you do to allow the function to access the secret?
Add the Key Vault access key to the Function app's application settings and read it at runtime.
Generate a user delegation SAS for the Key Vault and embed it in an environment variable.
Create a service principal, store its client secret in Azure App Configuration, and reference it from code.
Enable a system-assigned managed identity on the Function app and assign that identity the Key Vault Secrets User role on the vault.
Enabling a system-assigned managed identity on the Function app gives Azure AD automatically managed credentials that are never visible to developers. After the identity exists, granting it the built-in Key Vault Secrets User role (or equivalent secret-get permission through an access policy) lets the code read, but not write or manage, secrets-satisfying least-privilege requirements. Key Vault exposes no "access key", and it does not support shared access signatures. Using a service principal with a client secret still requires you to store credentials somewhere, defeating the requirement to avoid stored secrets.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a system-assigned managed identity in Azure?
Open an interactive chat with Bash
What is the Key Vault Secrets User role in Azure?
Open an interactive chat with Bash
How does Azure Key Vault ensure secure storage for secrets?
Open an interactive chat with Bash
Microsoft Azure Developer Associate AZ-204
Implement Azure security
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .