/entra-id-admin:entra-admin-setup [--tenant <tenant-id>] [--check-only] [--app-id <app-id>]from entra-id-admin
Authenticates to Microsoft Entra ID, verifies Microsoft Graph API access, checks required admin scopes/roles, and detects PIM/Entitlement Management license availability.
Ships in entra-id-admin. Installing the plugin adds it to Claude Code.
Verify the environment is correctly configured for Entra ID administration via Microsoft Graph. This command checks authentication, validates required scopes, and confirms the calling principal has the permissions needed to use all plugin commands.
If --tenant is provided, use it. Otherwise:
AZURE_TENANT_ID environment variable~/.azure/tenantId from az account showaz account show --query tenantId -o tsv via BashRun: az account show --query "{tenantId: tenantId, user: user.name, cloudName: environmentName}" -o json
If this fails (not logged in), show:
Not authenticated. Sign in with:
az login --tenant <tenant-id>
For app-only (service principal):
az login --service-principal -u <app-id> -p <cert-or-secret> --tenant <tenant-id>
Run a lightweight test call:
GET https://graph.microsoft.com/v1.0/organization?$select=id,displayName,verifiedDomains
Authorization: Bearer $(az account get-access-token --resource https://graph.microsoft.com --query accessToken -o tsv)
For delegated access, check me/memberOf for required Entra roles.
For app-only, check the service principal's app role assignments.
Report each scope/role status:
Required Permissions Check
─────────────────────────────────────────────────────────────────
Capability Permission Status
─────────────────────────────────────────────────────────────────
User management User.ReadWrite.All ✓ Granted
Group management Group.ReadWrite.All ✓ Granted
Role assignments RoleManagement.ReadWrite ✓ Granted
PIM PrivilegedAccess.ReadWrite ✗ Missing
Auth methods UserAuthMethod.ReadWrite.All ✓ Granted
Entitlement management EntitlementMgmt.ReadWrite.All ✗ Missing
Licenses LicenseAssignment.ReadWrite ✓ Granted
─────────────────────────────────────────────────────────────────
Test if PIM is available:
GET https://graph.microsoft.com/beta/roleManagement/directory/roleEligibilitySchedules?$top=1
Test if Entitlement Management is available:
GET https://graph.microsoft.com/v1.0/identityGovernance/entitlementManagement/catalogs?$top=1
Entra ID Admin Setup Complete
─────────────────────────────────────────────────────────────────
Tenant: contoso.onmicrosoft.com (<tenant-id>)
Principal: [email protected] (delegated)
Cloud: AzureCloud
Graph API: ✓ Reachable
Features Available
Core admin (users/groups/roles/licenses): ✓ Ready
PIM (eligible assignments/activation): ✓ Ready
Entitlement Management (access packages): ✗ Requires P2 license
Missing permissions (if any):
Add scope 'PrivilegedAccess.ReadWrite.AzureResources' to your app registration
─────────────────────────────────────────────────────────────────
# Check current login context
az account show --query "{tenantId:tenantId, user:user.name, cloud:environmentName}" -o json
# Get a Graph token to verify access
az account get-access-token --resource https://graph.microsoft.com --query accessToken -o tsv
# Quick test: list tenant organization details
az rest --method GET \
--url "https://graph.microsoft.com/v1.0/organization?\$select=id,displayName,verifiedDomains" \
--query "value[0].{Name:displayName, Domains:verifiedDomains[].name}"
# List all app registrations (verifies Entra read access)
az ad app list --query "[].{Name:displayName, AppId:appId}" --output table --all
# List all service principals
az ad sp list --query "[].{Name:displayName, AppId:appId}" --output table --all
| Error | Resolution |
|---|---|
az: command not found | Install Azure CLI: https://learn.microsoft.com/cli/azure/install-azure-cli |
AADSTS700082 | Refresh token expired — run az login again |
| Graph returns 401 | Token expired or wrong resource scope; re-acquire token |
403 on Graph | Principal missing required role or app permission not consented |
Files this command reads when invoked
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
29 commands in this plugin
/entra-access-package-createCreate an entitlement management access package with resources, approval policy, and optional recurring access review/entra-access-review-createCreate a recurring access review for group membership, directory roles, or access package assignments/entra-admin-unit-addAdd a member (user/group) to an admin unit, or assign a scoped admin role within an admin unitnpx claudepluginhub thelobbi/claude-m --plugin entra-id-adminOther plugins' commands for the same job