Instructor-Led Training Course
Microsoft Entra & Azure Security Series
Course Guide

Developing and Securing
Microsoft Cloud Applications
and Automation

Identity, Permissions, Tokens, and Automation for Infrastructure Administrators


Target Audience
Infrastructure and security administrators
Format
Instructor-led, full day with guided labs
Prerequisites
Entra/Azure portal familiarity, basic PowerShell, Active Directory concepts
Content Validated
May 2026 - current Microsoft documentation
Table of Contents
Prerequisites & Overview
Part 1 - Securing Applications and Automation
Part 2 - Building Applications and Automation

Prerequisites and Audience

This course is designed for infrastructure and security administrators who manage Microsoft cloud environments. The focus is on architecture, capabilities, and controls - with enough developer context (token structure, OAuth flows, REST APIs) to reason about security without requiring a development background.

Participants leave with an understanding of how service principals and permissions work under the hood, how to write or evaluate automation using modern credential-free patterns, and practical deployable tools for their own environments.

Expected Prerequisites

Attendee Machine Requirements

For the hands-on labs, the attendee machine should have the following tools installed in advance:

Base attendee machine

Microsoft Graph PowerShell

Either of the following approaches is acceptable:

Az PowerShell modules

Lab Environment Options

EnvironmentAccess ProvidedRecommended For
Provided training environment Application Administrator in shared Entra training tenant; Contributor on a dedicated Azure resource group; Global Administrator available for consent approvals Most participants - quickest setup, no risk to personal resources
Personal dev/test tenant Self-managed, M365 Developer Program, or Entra ID P2 Trial tenant with an Azure trial subscription Participants who want to retain lab artifacts after class; must use a non-production tenant
Licensing Note

No specific Microsoft 365 license tier is required. Features requiring premium licensing - Workload Identities Premium, Entra ID Governance, and Defender for Cloud Apps App Governance - are clearly noted inline where they appear throughout the course.

Part One

Securing Applications
and Automation

Build a modern foundation for service identity, permissions, and token-based authentication in Microsoft cloud environments. Understand what goes wrong with legacy patterns - and how to fix it.

Understanding Modern Service Principals

Microsoft Entra Applications, Managed Identities, and Workload Authentication

📋 Learning Objectives
Explain why legacy service accounts remain a major risk pattern
Distinguish between app registrations, service principals, enterprise applications, and managed identities
Compare secrets, certificates, federated credentials, and managed identities
Read the key claims in delegated and app-only tokens
Identify where permissions, consent, and Conditional Access actually apply

Traditional Service Accounts in Active Directory

Organizations built around Active Directory typically used ordinary user accounts for service identities - with static passwords, no MFA support, and broad group memberships accumulated over time. Real-world examples still common in enterprise environments: SQL Server service accounts, IIS application pool identities, scheduled tasks, DFS replication, backup agents (Veeam, Commvault), and vulnerability scanners (Tenable, Qualys).

Managed Service Accounts are introduced as the bridge concept: they reduce password management on-premises, but the larger transition is toward workload identities that avoid stored credentials entirely.

Service Principals and Authentication Methods

Service Principals are the cloud-native equivalent of service accounts in Microsoft Entra. They are not subject to MFA or Conditional Access by default - but they offer authentication methods that are fundamentally stronger than any password-based account.

The section compares the main authentication patterns for service principals: client secrets, certificates, workload identity federation, and managed identities. The emphasis is simple: managed identity is preferred for Azure workloads, workload identity federation is preferred for CI/CD, certificates are situational, and secrets are the weakest option.

When a credential cannot be eliminated, the guidance stays high level: store it in Key Vault, retrieve it at runtime, and treat sign-in logs, credential rotation, and compromise response as separate governance tasks.

Enterprise Applications, IDs, and Token Types

The App Registration / Enterprise Application split is a persistent source of confusion - and the wrong ID in a Graph query is a common bug.

ConceptWhere It LivesWhat It ControlsCommon Use
App Registration Home tenant only App identity, redirect URIs, credentials, exposed APIs, app roles Developer/admin who owns the application
Enterprise Application
(Service Principal)
Every consuming tenant Local consent grants, sign-in logs, Conditional Access targeting, ownership, provisioning Admin revoking permissions, reviewing sign-ins
Application (Client) ID Shared across both objects Identifies the app globally Use in authentication flows; same value in both App Reg and EA
Object ID Different for each object Identifies a specific tenant object Use when targeting a specific object in Graph API queries
Token Lifetime Note

Service Principals receive access tokens only - no refresh tokens. Access tokens last approximately 1 hour. This limits token theft blast radius but means automations must cache tokens and handle expiry. Never authenticate on every API call - cache the token and refresh only when it approaches expiry.

Privileged Role Escalation Path

Application Administrator can add new credentials to any existing service principal in the tenant - including SPs that already hold permissions granted by a Global Administrator. An App Administrator who adds a credential to an SP holding RoleManagement.ReadWrite.Directory gains effective Global Admin-equivalent access. Treat Application Administrator as a highly privileged role, assign only via PIM with JIT activation, and monitor credential additions in Entra audit logs.


Permissions and Scopes

OAuth Permissions, Admin Consent, and Security Attacks

📋 Learning Objectives
Distinguish delegated and application permissions by blast radius and consent requirement
Trace the OAuth consent flow and identify where illicit consent grant attacks exploit it
Explain why Application Administrator is a privilege escalation path
Describe device code phishing, token theft, refresh token abuse, and over-permissioned lateral movement
Use Entra, App Governance, and PowerShell to audit and reduce permission grants

Delegated vs. Application Permissions

The distinction maps to a familiar concept: delegated permissions are like Kerberos constrained delegation - the app acts on behalf of a signed-in user and cannot exceed what that user is allowed to do. Application permissions are like an unconstrained service account - the app acts as itself with no user context, accessing data across the entire tenant.

AttributeDelegated (OAuth2 Scopes)Application (App Roles)
User contextAlways - limited by signed-in user's accessNone - app acts independently
Admin consent required?Depends on scope sensitivityAlways
Blast radiusScoped to user's permissionsTenant-wide - all data the scope covers
Graph objectOAuth2PermissionGrantappRoleAssignment
Least-privilege exampleMail.Read (user's mail only)Mail.Read reads all tenant mailboxes
Example high-risk scopeFiles.ReadWrite.AllDirectory.ReadWrite.All
User/Browser App Entra ID Consent UI Resource API ① visit app ② redirect + scopes ③ consent prompt ④ auth code ⑤ code → access token ⑥ bearer token call Browser redirect flow Server-to-server (token) API call

Figure 3 - OAuth 2.0 authorization code flow with admin consent

Attack Patterns and OAuth Exploitation

Illicit Consent Grant Attacks

An attacker registers a malicious multi-tenant app and tricks a user into consenting to it - granting persistent, MFA-bypassing access without stealing a password. Unlike credential theft, revoking access requires explicitly revoking the consent grant.

Defenses: Restrict user consent to verified publishers and low-risk permissions only (or disable entirely). Enable the admin consent workflow. Deploy App Governance anomaly detection in Defender for Cloud Apps.

Device Code Flow Phishing

The attacker initiates a device code authentication request and sends the resulting code to the victim. When the victim enters it at microsoft.com/devicelogin, the attacker receives valid tokens without needing the victim's password or MFA. Microsoft Threat Intelligence has tracked active campaigns (Storm-2372) using this technique since 2024.

Active Threat - Device Code Flow

If your tenant's Conditional Access policies do not explicitly block device code flow, every user is potentially targetable with no password or MFA required. Block device code flow via Conditional Access authentication flow restrictions for all users except specific named scenarios (e.g., conference room devices on a specific network).

Non-Graph API Permissions - The Auditing Blind Spot

The most dangerous example: the Azure Service Management API (https://management.azure.com/) - the user_impersonation delegated scope grants an application the same Azure subscription management rights as the signed-in user, including RBAC modification, Key Vault secret access, and compute creation. Most permission reviews focus on Graph and miss this entirely.

Security Risk

An application with Azure Service Management / user_impersonation consent from a Global Administrator can manage the organization's entire Azure environment on behalf of that admin. This permission is rarely audited because most tooling focuses on Graph.

End-to-End Attack Chain Scenario

A representative attack chain ties the section together: a forgotten application with excessive permissions, a leaked credential, weak ownership, and poor monitoring. The section uses that scenario to show how silent access happens, why Application Administrator is a serious escalation path, and which controls break the chain early.

Permission Hardening and Governance


Tokens and APIs

Token Acquisition, IMDS, Microsoft Graph, and Azure Resource Manager

📋 Learning Objectives
Explain how Managed Identity authentication works and what the IMDS endpoint does
Describe Azure IMDS request protections and why least privilege still matters for SSRF defense
Acquire tokens for any Azure service using Az PowerShell, Azure CLI, or IMDS directly
Decode a JWT in PowerShell and identify the claims relevant to permission diagnosis
Write a correct paginated Graph API call that handles @odata.nextLink
Distinguish Graph consent-based authorization from ARM RBAC authorization

Token Acquisition and IMDS

This section walks through token acquisition with managed identities, including the IMDS endpoint used on Azure compute. The focus is practical troubleshooting: request the right token for the right resource, understand the IMDS protections that matter for SSRF, and use token claims to explain why an API call succeeds or fails.

Reading JWT Claims for Debugging

When automation fails with a 403, inspect the token before anything else. The two critical claims:

Microsoft Graph, ARM, and Other APIs

The outline also briefly distinguishes supported APIs from internal browser-discovered endpoints: Graph, ARM, and supported service tooling are the production surfaces, while undocumented endpoints are useful for investigation but not for durable automation.

Microsoft Graph API

Graph is the unified REST API for Microsoft 365 and Entra. Key operational concepts:

Azure Resource Manager vs. Microsoft Graph

Microsoft GraphAzure Resource Manager
Base URLhttps://graph.microsoft.com/https://management.azure.com/
GovernsMicrosoft 365, Entra, Teams, SharePointAzure infrastructure resources
Access controlOAuth consent (delegated + application)Azure RBAC (role assignments)
Entra SPs interact viaApp role assignments + consent grantsRBAC role assignments at subscription/RG/resource scope

Part Two

Building Applications
and Automation

Apply the identity and permission foundation from Part 1 to real automation workloads - choosing the right platform, writing maintainable code, and deploying solutions as reproducible packages.

Automation Tools

Automation Accounts, Logic Apps, Function Apps, and CI/CD

📋 Learning Objectives
Select the right Azure automation platform for a given scenario
Migrate Automation Accounts from Run As Account to managed identity
Configure Workload Identity Federation for GitHub Actions and Azure DevOps
Identify Logic App connection objects as a credential governance concern
Apply vNet integration and Private Endpoints for network security
Match trigger types to business events

Azure Automation Platforms

Azure automation platform comparison - choosing the right tool

Platform Best For Auth Pattern Code Required? On-Prem Support? Event-Driven?
Automation Accounts Scheduled/on-demand PowerShell & Python runbooks; hybrid on-prem automation Managed Identity Preferred Yes - PS/Python Yes - Hybrid Worker Webhook only
Logic Apps Low-code orchestration across managed connectors; alert/webhook triggers Managed Identity Preferred Optional Standard tier only Yes - hundreds of triggers
Function Apps Custom code logic, complex data transformation, high-frequency events Managed Identity Preferred Yes - C#/Python/JS/PS No Yes
Azure DevOps Pipelines CI/CD for code and infrastructure deployments WIF Now Default YAML required Self-hosted agents Code events only
GitHub Actions CI/CD and automation workflows; broad trigger support WIF OIDC Preferred YAML required Self-hosted runners Yes - push/PR/schedule/webhook
Retired - Run As Accounts

The legacy Automation Account Run As Account (certificate-based service principal) was retired September 30, 2023. Any remaining automation using Run As accounts must be migrated to managed identities immediately. Use system-assigned managed identity for single-account scenarios; user-assigned managed identity where the identity is shared across runbooks or accounts.

Workload Identity Federation - CI/CD Authentication

WIF is presented as the preferred CI/CD authentication pattern: no stored secrets, a federated trust to GitHub Actions or Azure DevOps, and tightly scoped subject claims so only expected repositories and branches can exchange tokens. The section also calls out Logic App connection objects as credentials to govern and vNet integration plus Private Endpoints as the main network controls for private-resource scenarios.

Triggers and Event Patterns

Trigger TypeBest PlatformsCommon Use Cases
Scheduled Automation Accounts, Logic Apps, Function Apps, GitHub Actions Regular reports, compliance scans, cleanup jobs, daily sync operations
Alert & Incident Logic Apps (Sentinel playbooks), Automation webhooks Security response automation; Sentinel NRT analytics rules → playbooks within minutes
Event-Driven Logic Apps, Function Apps (Event Grid / Service Bus) Key Vault expiry notifications, Entra audit events, storage blob created
CI/CD Pipeline Azure DevOps, GitHub Actions Deploy runbooks, Bicep templates, and policy configurations on code merge
HTTP / Webhook Logic Apps, Function Apps ITSM integrations, external ticketing systems, consent workflow callbacks

Maintenance and Management

Source Control, Observability, AI-Assisted Development, and Service Principal Hygiene

📋 Learning Objectives
Configure source control integration and CI/CD deployment for Azure Automation Accounts
Identify and remediate common security issues in AI-generated automation code
Set up Log Analytics queries and Azure Monitor alerts for automation failure detection
Query Graph API for service principal credential expiry and orphan detection
Define a service principal naming convention and explain what it must encode

Source Control and CI/CD for Automation

All runbooks, Logic App definitions, Function App code, and pipeline YAML should live in a Git repository. Never edit runbooks directly in the Azure portal for production systems - treat the portal as read-only for production code.

The point is straightforward: source control and CI/CD are treated as security requirements, not convenience features, because portal-only edits remove review, testing, and history.

AI-Assisted Development - Security Review Checklist

AI-assisted development is covered from a review perspective: remove hardcoded secrets, reduce scopes, add error handling, avoid logging tokens, and request only the Graph fields you actually need.

Monitoring, Observability, and Service Principal Hygiene

This section explicitly adds monitoring and alerting so failed jobs, broken permissions, and automation drift surface quickly through Log Analytics, Azure Monitor, and platform-native telemetry.

It closes with service principal hygiene: naming conventions, owners, credential expiry tracking, orphan detection, and inactivity review so automation remains understandable and supportable over time.


Packaging Tools and azd

ARM Templates, Bicep, and the Azure Developer CLI

📋 Learning Objectives
Explain what Azure Resource Manager is and how Azure management and deployment operations use it
Describe four core authoring sections in an ARM JSON template
Explain what Bicep compiles to and identify three advantages over ARM JSON
Describe the structure of an azd template: azure.yaml, /infra, and /src
Deploy a complete security tool using a single azd up command
Explain why the Key Vault in a passkey pattern must be treated as a credential store

ARM Templates and Bicep

Azure portal, Azure CLI, Az PowerShell, Bicep, and ARM templates all rely on Azure Resource Manager for management and deployment operations. Understanding ARM as the underlying control plane explains why tokens scoped to management.azure.com are needed for infrastructure automation, and why Azure RBAC (not OAuth consent) governs Azure resource access.

ARM JSONBicep
SyntaxVerbose JSON with nested resourceId() functionsClean DSL with symbolic names, no resourceId() needed
Line count (typical)~80 lines for a simple Automation Account + MI + role~25 lines for the same
IDE supportBasic JSON completionFull IntelliSense, type-safe property completion in VS Code
ModulesLinked templates (complex)First-class module keyword
CompilationIs the wire formataz bicep build compiles to ARM JSON
Default for azdNoYes

The comparison stays at the authoring level: ARM JSON is the deployment format, while Bicep is the easier authoring layer that compiles to it and is the default fit for azd-based solutions.

Azure Developer CLI (azd)

azd bundles infrastructure-as-code (Bicep), application code, and CI/CD pipeline configuration into a single deployable, shareable template. For IT and security professionals, community-built security tools can be deployed with a single command rather than manual resource creation and permission assignment steps.

The template structure is part of the overview: azure.yaml defines the solution, /infra holds the Bicep deployment layer, /src holds application code, and core commands such as azd up, azd pipeline config, and azd down cover deployment, pipeline setup, and teardown.

Example Solutions and Labs

Representative examples include break-glass Conditional Access exclusion automation, azd-maester as a ready-to-deploy security testing solution, and a Key Vault-backed passkey pattern that reinforces that the vault must be treated as the effective credential store.

Additional lab examples show the same packaging model applied to identity governance, endpoint telemetry, notification workflows, and audit monitoring.


Securing Applications and Automation - Course Outline  ·  Content validated May 2026