AI-901 practice question: Chat client apps with the Foundry SDK (4 of 4)
Implement AI solutions by using Microsoft Foundry A free question from our original AI-901 practice exam. Try it, then open the answer to see why each option is right or wrong.
A regional clinic network is building an app that calls a Foundry agent. The app runs on developers' laptops during testing and on an Azure virtual machine in production. The security team forbids storing secret keys in source code, configuration files or environment variables.
The agent client requires Microsoft Entra sign-in.
Which authentication approach meets these requirements?
Choose one answer.
AA. A resource key pasted into the client constructor, which the team rotates every quarter
BB. An API key stored in an environment variable and read by AzureKeyCredential
CC. DefaultAzureCredential, which uses az login locally and the VM's managed identity in Azure
DD. Anonymous access, with the agent endpoint left open so that no sign-in is needed
Show the answer and explanation
Answer: C
A. Wrong: A resource key is a shared secret, and the agent client needs a Microsoft Entra identity rather than a key. Pasting the key into code also breaks the security rule.
B. Wrong: An environment variable is still a stored secret, which the security team forbids. Key-based credentials also fail the agent client's Microsoft Entra requirement.
C. Right: Correct. DefaultAzureCredential tries a chain of credentials, using the developer's az login session on a laptop and a managed identity when the app runs on an Azure host with one enabled. No secret is stored, and the agent client gets the Entra sign-in it requires. Learn more: Credential chains in the Azure Identity library for Python (opens in a new tab)
D. Wrong: Removing sign-in would let any caller reach the agent and its tools, which the security team cannot accept. The agent client expects a Microsoft Entra identity, so this option fails both needs.
Explanation
Agent clients in Foundry require Microsoft Entra ID rather than keys. DefaultAzureCredential picks up the developer's az login session during testing and the VM's managed identity in production, so no secret is stored anywhere.
Want more on Chat client apps with the Foundry SDK? The 5 full-length practice sets have 20 more Chat client apps with the Foundry SDK questions, 225 in all, none of them in the free exam. One payment of $9.99 $6.99, no subscription. Get the practice sets →
✓ Every exam starts with free questions. No account needed.
Can we use Google Analytics cookies to see which pages help people? No ads, and we never sell data. Privacy