The AI-102 exam has been retired
It was retired on June 30, 2026. It was replaced by AI-103 (Microsoft Azure AI Apps and Agents Developer Associate). Go to the AI-103 study guide →
Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.
2.3.1. Authentication Methods
The choice between API keys and managed identities has significant implications for credential management and compliance. Managed identity eliminates secrets from your code.
Authentication Methods:
| Method | Use Case | Header |
|---|---|---|
| API Key | Development | Ocp-Apim-Subscription-Key: {key} |
| Managed Identity | Production | Authorization: Bearer {token} |
🔧 Implementation Reference: Authentication
The following packages and classes are used for each authentication method.
| Item | API Key | Managed Identity |
|---|---|---|
| Package | azure-core | azure-identity |
| Class | AzureKeyCredential | DefaultAzureCredential |
Testable Pattern:
# API Key
from azure.core.credentials import AzureKeyCredential
credential = AzureKeyCredential("your-key")
# Managed Identity
from azure.identity import DefaultAzureCredential
credential = DefaultAzureCredential()
How Managed Identity Authentication Works:
Enroll to unlock the 21 practice questions written for this section, so you can test what you just read while it is fresh.
Enroll to unlock the 5 flashcards for this section and review them on a spaced-repetition schedule.
Written byAlvin Varughese
Founder•18 professional certifications