PIM via Graph on a tenant without Entra ID P2
If your app reads Privileged Identity Management data, expect 400 with code AadPremiumLicenseRequired on tenants without a PIM license (Entra ID P2 or Entra ID Governance) – even after the admin consented to the read scopes. It is not 403, so code that maps "4xx = no permission" shows the wrong message. Treat it as "this tenant has no PIM" and show that as a state.
Bez licence pro PIM (Entra ID P2 nebo Entra ID Governance) vrací PIM endpointy v Graphu 400 AadPremiumLicenseRequired, ne 403 – i se schválenými scopy. Čti to jako „tenant PIM nemá“, ne jako chybu čtení nebo chybějící souhlas.
What was measured
Delegated Microsoft Graph from an SPFx app, signed in as a global admin on a tenant without Entra ID P2 (November 2026). The token scp claim contained RoleManagement.Read.Directory, RoleEligibilitySchedule.Read.Directory and RoleManagementPolicy.Read.Directory.
| Request | Result |
|---|---|
GET /roleManagement/directory/roleAssignments?$top=1 |
200 – permanent role assignments are readable without P2 |
GET /roleManagement/directory/roleEligibilitySchedules?$top=1 |
400 AadPremiumLicenseRequired |
GET /policies/roleManagementPolicies?$filter=scopeId eq '/' and scopeType eq 'Directory' |
400 AadPremiumLicenseRequired |
What it means for an app
- Classify by the error code, not only the status:
AadPremiumLicenseRequired→ "PIM not available on this tenant (needs Entra ID P2 or Entra ID Governance)";403/Authorization_RequestDenied→ missing consent or role. - Consent alone tells you nothing about licensing: the scopes can be granted and visible in the token while the endpoints still refuse.
- Cover the classification with a unit test that uses the real error body – a tenant with P2 will never take this path, and one without P2 will never take the other.
Sources
- Measured live in a production tenant, November 2026 (table above).
- Microsoft Learn, Microsoft Entra ID Governance licensing fundamentals – Privileged Identity Management: PIM needs Entra ID P2 or Entra ID Governance; permanent role assignments are unaffected without the license.
- Microsoft Learn, Troubleshoot Authorization_RequestDenied error with Microsoft Graph:
Authorization_RequestDeniedmeans the user or app lacks permissions.
Not measured
- The exact response on a tenant with P2 but no PIM role configured.
- Whether
roleAssignmentSchedulesbehaves likeroleEligibilitySchedules.