Skip to content

ZTA v2.1.0 — Error handling improvements for unlicensed tenants: Issue 1 — PIM endpoints throw raw HTTP 400 errors instead of graceful skip #1021

@varsha123

Description

@varsha123

Summary
Running ZTA v2.1.0 against a tenant without Entra ID P2 produces noisy console errors that are difficult to interpret and don't clearly distinguish between licensing gaps, permission issues, or script bugs. The assessment completes and generates a report, but the error output creates unnecessary confusion. The following improvements would significantly improve the experience.

The script calls PIM Graph endpoints (roleAssignmentScheduleInstances, roleEligibilityScheduleInstances, roleManagementPolicyAssignments) without first checking for P2 licensing, resulting in verbose HTTP 400 AadPremiumLicenseRequired errors dumped to the console.
Suggested fix: Pre-check tenant licenses before calling PIM endpoints and skip gracefully with a user-friendly warning, e.g.:

⚠️ PIM assessment skipped — Entra ID P2 or Governance license not detected

Environment
ZeroTrustAssessment version: 2.1.0
PowerShell version: 7.5.4
Tenant licensing: No Entra ID P2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions