Study guide

3.2 Workload Identities and Managed Identities

Microsoft Azure Security Technologies AZ-500

Track your progress as you read

Finished sections get a check mark.

1 Chapter 1: Exam Overview & Azure Security Architecture Foundation

1.1 Azure Security Engineer Role & Exam Logistics 1.2 Microsoft Cybersecurity Reference Architecture & Zero Trust Principles

2 Chapter 2: Secure Identity and Access - Authentication, MFA & PIM

2.1 Microsoft Entra ID Security, Users, and Groups 2.2 Authentication Methods, MFA, and Conditional Access Policy Design 2.3 Microsoft Entra Privileged Identity Management (PIM)

3 Chapter 3: Secure Identity and Access - RBAC & Workload Identity

3.1 Azure RBAC, Custom Roles, and Governance 3.2 Workload Identities and Managed Identities 3.3 External Identities and Cross-Tenant Collaboration

4 Chapter 4: Microsoft Entra Application Access & Consent Governance

4.1 Enterprise Applications, OAuth Permission Grants & Consent Governance 4.2 App Registrations, Permission Scopes & Service Principal Credentials

5 Chapter 5: Secure Azure Networking - Boundary & Perimeter Protection

5.1 Virtual Network Security & Micro-segmentation 5.2 Azure Firewall and Firewall Manager 5.3 Web Application Firewall (WAF) & Azure Front Door

6 Chapter 6: Secure Azure Networking - Private Access & Monitoring

6.1 Private Connectivity with Private Endpoints & Private Link 6.2 Azure Bastion & Remote Management Security 6.3 Network Perimeter Protection & Flow Monitoring

7 Chapter 7: Network Architecture, Routing & Hybrid Connectivity

7.1 Azure Virtual Network Manager, Network Groups & User-Defined Routes 7.2 VPN Gateway, ExpressRoute Encryption & Virtual WAN Secured Hub 7.3 Network Integration for App Service, Functions, App Service Environment & SQL Managed Instance

8 Chapter 8: Public and Edge Access Protection

8.1 Azure Application Gateway Security, TLS Policy & Mutual Authentication 8.2 Azure Front Door, CDN Caching & TLS for App Service and API Management

9 Chapter 9: Compute, Container & Registry Security

9.1 Azure Virtual Machine Hardening & Host Security 9.2 Azure Key Vault Deep Dive & Secrets Lifecycle 9.3 Container & Azure Kubernetes Service (AKS) Security 9.4 Azure Container Instances, Container Apps & Registry Access Control

10 Chapter 10: Storage Security, Access Methods & Data Protection

10.1 Storage Account Security & Access Controls 10.2 Selecting and Configuring Access to Azure Files 10.3 Selecting and Configuring Access to Azure Blob Storage 10.4 Storage Data Protection: Soft Delete, Versioning, Point-in-Time Restore & Backup

11 Chapter 11: Data Platform & Database Security

11.1 Azure SQL Database Security & Always Encrypted 11.2 Database Auditing & Vulnerability Assessment 11.3 Data Discovery, Classification, & Microsoft Purview Integration

12 Chapter 12: Cloud Governance, Key Lifecycle & Asset Protection

12.1 Azure Policy for Security Governance: Definitions, Initiatives, Effects & Remediation 12.2 Key Vault Backup, Recovery & Automated Key Rotation 12.3 Implementing Security Controls to Protect Backups 12.4 Security Controls for Asset Management: Locks, Tags, Resource Graph & Azure Arc

13 Chapter 13: Microsoft Defender for Cloud - Posture & Workload Protection

13.1 Microsoft Defender for Cloud & Secure Score 13.2 Defender Cloud Workload Protection (CWP) Plans 13.3 Defender for Cloud Inventory, Compliance Standards & Custom Standards 13.4 Connecting AWS and GCP Environments to Microsoft Defender for Cloud

14 Chapter 14: External Attack Surface & Vulnerability Management

14.1 Microsoft Defender External Attack Surface Management (EASM) 14.2 Agentless Scanning & Microsoft Defender Vulnerability Management for Azure VMs 14.3 Defender for Cloud DevOps Security: GitHub, Azure DevOps & GitLab

15 Chapter 15: Security Monitoring, Microsoft Sentinel & Automation

15.1 Azure Monitor Data Collection Rules & Network Security Event Monitoring 15.2 Microsoft Sentinel Data Connectors, Content Hub & Normalization 15.3 Microsoft Sentinel Workspace & KQL Threat Hunting 15.4 Sentinel Incident Management & SOAR Automation

3.2 Workload Identities and Managed Identities

Key Takeaways Explain This Topic AI

Workload Identities provide non-human entities with Entra ID identities, replacing hardcoded credentials with Azure-managed authentication mechanisms.

System-Assigned Managed Identities are tied 1:1 to a specific Azure resource lifecycle, whereas User-Assigned Managed Identities are standalone resources shared across multiple workloads.

Managed Identities enable credential-less access to Azure Key Vault by fetching signed OAuth 2.0 bearer tokens from the local Instance Metadata Service (IMDS) endpoint at 169.254.169.254.

Workload Identity Federation uses OpenID Connect (OIDC) to federate external workloads (such as GitHub Actions or Kubernetes) with Entra ID, eliminating external client secrets and key rotation.

Last updated: August 2026

3.2 Workload Identities and Managed Identities

In modern cloud architecture, non-human entities—such as automated deployment scripts, background workers, microservices, container workloads, and Virtual Machines—require access to Azure resources. Traditionally, developers authenticated these workloads using hardcoded credentials, service principal secrets, or certificates, creating severe secret-sprawl and credential rotation risks. Microsoft Entra Workload Identities and Managed Identities eliminate credential management entirely by providing Azure-managed identity lifecycles for workloads.

1. Workload Identity Concepts: Service Principals vs. Managed Identities

A Workload Identity is an identity assigned to a software entity (application, service, container, or script) to enable authentication and authorization against Entra ID and Azure Resource Manager. Workload Identities in Entra ID

  • │
  • ┌─────────────────────┴─────────────────────┐
  • ▼ ▼
  • Service Principals Managed Identities
  • (App Registrations with (Azure Infrastructure
  • Client Secrets / Certificates) Managed Credentials)
  • │ │
  • ┌─────────┴─────────┐ ┌─────────┴─────────┐
  • ▼ ▼ ▼ ▼
  • Manual Secret External App System-Assigned User-Assigned
  • Rotation Needed Authentication (1:1 with Host) (Standalone 1:N)

Service Principals vs. Managed Identities Comparison:

Service Principals : Created when registering an application in Microsoft Entra ID. Authentication requires generating a client secret (symmetric key) or uploading an X.509 certificate. Administrators must manually track, store, and rotate these credentials before expiration.

Managed Identities : A specialized category of Service Principals that are tied directly to Azure resources. Azure infrastructure handles credential provisioning, token acquisition, and key rotation automatically behind the scenes without developer intervention. Managed identities are free of charge.

2. System-Assigned vs. User-Assigned Managed Identities

Azure offers two distinct operational modes for Managed Identities. Understanding their lifecycle and sharing characteristics is essential for proper architecture design:

Architectural Feature System-Assigned Managed Identity User-Assigned Managed Identity

Lifecycle Binding Strictly tied 1:1 to the hosting Azure resource (VM, App Service, Function) Standalone Azure resource created independently in a Resource Group

Shareability Exclusive to 1 resource; cannot be shared across multiple workloads Shared across multiple Azure resources (1:N mapping)

Creation & Cleanup Enabled directly on the host resource; deleted automatically when host is deleted Created explicitly as a Microsoft.ManagedIdentity/userAssignedIdentities resource; persists independently

Primary Use Case Single workloads requiring isolated access (e.g., a specific database maintenance VM) Multi-node VM Scale Sets, container clusters, or multi-region microservices requiring identical permissions

Resource Assignment Limit Maximum 1 System-Assigned identity per resource Up to 1,000 User-Assigned identities per resource

3. Credential-Less Access to Azure Key Vault using Managed Identities

The gold standard for zero-trust application design in Azure is retrieving secrets, keys, or connection strings from Azure Key Vault without storing any credentials in application code, appsettings.json , or environment variables. ┌────────────────────────────────────────────────────────────────────────┐

  • │ Azure VM / App Service │
  • │ │
  • │ ┌────────────────────┐ 1. OAuth Token Req ┌─────────────────────┐ │
  • │ │ Application Code │ ────────────────────> │ Local IMDS Endpoint │ │
  • │ │ (DefaultAzureCred) │ <──────────────────── │ (169.254.169.254) │ │
  • │ └─────────┬──────────┘ 2. Entra ID Token └─────────────────────┘ │
  • └────────────┼───────────────────────────────────────────────────────────┘
  • │
  • │ 3. HTTP Authorization Header (Bearer Token)
  • ▼
  • ┌────────────────────────────────────────────────────────────────────────┐
  • │ Azure Key Vault │
  • │ (Data Plane RBAC: Key Vault Secrets User) │
  • └────────────────────────────────────────────────────────────────────────┘

Authentication Execution Flow:

Enable Identity : Enable System-Assigned (or assign User-Assigned) Managed Identity on the VM, App Service, or Function App.

Assign Data Plane RBAC : Grant the Managed Identity the Key Vault Secrets User role ( 4633005b-24ab-44da-8c2e-9f310fa57263 ) on the target Key Vault scope.

Local Token Acquisition : Application code initializes the Azure Identity SDK (e.g., DefaultAzureCredential() in .NET, Python, or Java).

IMDS Query : The SDK makes a local HTTP GET request to the internal Azure Instance Metadata Service (IMDS) non-routable IP address: http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://vault.azure.net

Bearer Token Usage : IMDS returns an Entra ID OAuth 2.0 access token signed by Entra ID. The application includes this bearer token in the HTTP Authorization header when querying Key Vault data plane APIs ( https://<vault-name>.vault.azure.net/secrets/<secret-name> ).

4. Workload Identity Federation (Secretless External Authentication)

While Managed Identities work seamlessly for workloads hosted inside Azure, external workloads—such as GitHub Actions CI/CD runners, Amazon Web Services (AWS) EC2 instances, or on-premises Kubernetes clusters—historically required storing long-lived Azure Service Principal client secrets in external credential stores.

Workload Identity Federation (WIF) eliminates external client secrets by leveraging OpenID Connect (OIDC) standards to establish a direct trust relationship between an external identity provider and Microsoft Entra ID. ┌────────────────────────┐ ┌────────────────────────┐

  • │ GitHub Actions Runner │ │ Microsoft Entra ID │
  • │ │ 1. Request OIDC │ (Security Token Svc) │
  • │ Obtains OIDC ID Token │ ────────────────> │ │
  • │ from GitHub OIDC Prov │ │ Validates OIDC Claims │
  • └───────────┬────────────┘ │ against Federated Cred│
  • │ └───────────┬────────────┘
  • │ 2. Present OIDC Token │
  • └────────────────────────────────────────────┘
  • │ 3. Issues Short-lived
  • │ Azure Access Token
  • ▼
  • ┌────────────────────────┐
  • │ Azure ARM / Resources │
  • └────────────────────────┐

Configuring Workload Identity Federation for GitHub Actions:

Create App Registration / Service Principal in Entra ID.

Configure Federated Identity Credentials on the Service Principal by defining three parameters:

Issuer : https://token.actions.githubusercontent.com

Subject Identifier : Defines exact repo/environment scoping (e.g., repo:my-org/my-repo:environment:Production or repo:my-org/my-repo:ref:refs/heads/main ).

Audience : api://AzureADTokenExchange

Assign Azure RBAC Role : Assign the Service Principal a role (e.g., Contributor or Website Contributor ) on the target subscription or resource group.

CI/CD Workflow Execution :

The GitHub Actions runner requests a short-lived OIDC token from GitHub's OIDC issuer.

The workflow presents the OIDC token to the Microsoft Entra Security Token Service (STS).

Entra ID validates the signature against GitHub's public keys ( /.well-known/jwks.json ) and verifies that the sub claim matches the configured Federated Credential.

Entra ID exchanges the OIDC token for a short-lived Azure access token (valid for 1 hour).

The pipeline deploys code to Azure securely without any client secret stored in GitHub Secrets .