Microsoft Azure Developer Associate AZ-204 Practice Question
You are building an Azure Function that runs on a timer trigger and produces a weekly CSV list of every guest user in the Microsoft Entra tenant. The function executes without any interactive user or front-end and must access Microsoft Graph with the least possible privileges to read the entire user collection. How should you configure authentication and authorization for the function?
Grant the delegated permission User.ReadWrite.All and have the function acquire tokens through the on-behalf-of flow when it starts.
Grant the application permission Directory.Read.All and acquire tokens by using the authorization code flow during the function's startup.
Register an app for the function, grant it the application permission User.Read.All, administer tenant consent, and acquire tokens with the client-credentials flow.
Grant the delegated permission User.Read to the app and retrieve tokens by using the authorization code flow with an Azure managed identity.
Because the function runs as a background (daemon) process, it must use the client-credentials flow to obtain an app-only access token-no delegated (user) context is available. The least-privileged Microsoft Graph scope that grants read access to the full set of user objects is the application permission User.Read.All. Directory.Read.All would also work but exposes additional directory data, so it is not the least-privileged choice. Delegated permissions or on-behalf-of flows require a signed-in user and are therefore unsuitable for this scenario.
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 the client-credentials flow in Azure authentication?
Open an interactive chat with Bash
What is the difference between application permissions and delegated permissions?
Open an interactive chat with Bash
What is the purpose of the User.Read.All permission in Microsoft Graph?
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 .