AI-200 Security And Observability Practice Question
Your Python-based AI service runs on an Azure Virtual Machine and connects to Azure OpenAI. To adhere to security best practices, you decide to eliminate storage of credentials on the VM disk by enabling a system-assigned managed identity on the virtual machine. How does your Python code obtain an access token using this managed identity?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use DefaultAzureCredential from the azure-identity library to automatically authenticate via the VM's IMDS endpoint
Using the `DefaultAzureCredential` or `ManagedIdentityCredential` from the `azure-identity` package allows the Python code to query the local Azure Instance Metadata Service (IMDS) endpoint to obtain access tokens securely.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use static storage account connection strings hardcoded in environment variables
Why it's wrong here
Incorrect. This violates the goal of using a managed identity to eliminate stored credentials.
- ✗
Make an unauthenticated HTTP GET request to the public Azure OpenAI endpoint with no headers
Why it's wrong here
Incorrect. Azure OpenAI requires valid authentication tokens or API keys.
- ✓
Use DefaultAzureCredential from the azure-identity library to automatically authenticate via the VM's IMDS endpoint
Why this is correct
Correct. DefaultAzureCredential queries the local VM managed identity endpoint (IMDS) seamlessly.
- ✗
Read the plain-text password from a file located in /etc/passwd on the virtual machine
Why it's wrong here
Incorrect. /etc/passwd contains user account information, not cloud service credentials, and reading plain-text passwords is insecure.
About these practice questions
This AI-200 question is part of Courseiva's 507-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed August 2026 · checked against the official Microsoft exam blueprint
This AI-200 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AI-200 exam.