Skip to content

Navigating between Azure, Graph, and others

This documentation outlines the three primary API ecosystems within the Microsoft Cloud: Microsoft Graph, Azure Management (ARM), and Microsoft Defender for Endpoint (MDE).

While all three utilize Microsoft Entra ID (formerly Azure AD) for identity, they differ significantly in their resource identifiers, permission models, and configuration workflows.

FeatureMicrosoft GraphAzure Management (ARM)Microsoft Defender (MDE)
Primary FocusIdentity, Productivity, M365Infrastructure & Cloud ResourcesSecurity, EDR, Machine Actions
API Endpointgraph.microsoft.commanagement.azure.comapi.securitycenter.microsoft.com
Auth Resourcehttps://graph.microsoft.comhttps://management.azure.comhttps://api.securitycenter.microsoft.com
AuthorizationOAuth2 Scopes (Additive)Azure RBAC (Hierarchical)OAuth2 Scopes (Specific)
Portal LocationApp Reg -> API PermissionsSubscription -> Access Control (IAM)App Reg -> APIs my org uses

Purpose: The “gateway” to Microsoft 365. It is used to manage the “Software as a Service” (SaaS) layer.

  • Key Entities: Users, Groups, Teams, Outlook, OneDrive, SharePoint, Intune, and Entra ID itself.
  • Permission Model: Scope-based. You define permissions (e.g., User.ReadWrite.All) directly on the App Registration.
  • Token Request:
    • Scope: https://graph.microsoft.com/.default
  • Crucial Step: Most permissions require Admin Consent. Without a global admin clicking “Grant Admin Consent” in the portal, the app will receive a 403 Forbidden despite having the permissions listed.

Purpose: The control plane for Azure Infrastructure. It is used to manage “Infrastructure as a Service” (IaaS) and “Platform as a Service” (PaaS).

  • Key Entities: Virtual Machines, SQL Databases, Resource Groups, Subscriptions, VNETs.
  • Permission Model: Role-Based Access Control (RBAC). * Adding permissions in the App Registration (like user_impersonation) only says “this app is allowed to talk to Azure.”
    • The real permission is granted by going to the Azure Resource (e.g., a Subscription) and assigning a Role (Contributor, Reader, Owner) to the App’s Service Principal.
  • Token Request:
    • Scope: https://management.azure.com/.default

4. Microsoft Defender for Endpoint (MDE) API

Section titled “4. Microsoft Defender for Endpoint (MDE) API”

Purpose: Advanced security operations, threat hunting, and device-level remediation.

  • Key Entities: Machines (endpoints), Alerts, Vulnerabilities, Indicators (IoCs).
  • Permission Model: Hybrid/Scope-based. Like Graph, it uses scopes, but they are found under a different “hidden” API in the portal.
  • The “Hidden” API: To add these, you must search for “WindowsDefenderATP” under the “APIs my organization uses” tab in the App Registration.
  • Key Capabilities: Unlike Graph (which sees alerts), the MDE API allows for Remediation Actions—such as isolating a machine from the network or running a remote antivirus scan.
  • Token Request:
    • Scope: https://api.securitycenter.microsoft.com/.default

You cannot “multi-purpose” an access token. If you get a token for Graph, it will fail if sent to the Azure Management API.

  • Graph/Defender: Defined at the App Level. If the app has Machine.Read.All, it sees every machine in the tenant.
  • Azure ARM: Defined at the Resource Level. If the app is a “Contributor” on Resource Group A, it cannot see anything in Resource Group B.

If you are building an automation script to handle a compromised laptop:

  1. Use Microsoft Graph to reset the user’s password and revoke their O365 sessions.
  2. Use Microsoft Defender API to isolate the laptop from the network and collect a forensic investigation package.
  3. Use Azure Management API to lock down the specific Virtual Desktop (AVD) resource or Network Security Group (NSG) associated with that user.
  • Identify your Audience: Are you touching a User (Graph), a VM (Azure), or an Alert (Defender)?
  • App Registration: Create the registration in Entra ID.
  • Secret/Cert: Generate a Client Secret or upload a Certificate for authentication.
  • Assign Permissions: * For Graph/Defender: API Permissions -> Grant Admin Consent.
    • For Azure: Go to Subscription -> IAM -> Add Role Assignment for the App.
  • Request Token: Use the specific URL for that API in your OAuth2 request.