Application Roles
V2 uses stable application roles for application-only ION API authorization and delegated scopes for user-delegated routes. Azure RBAC remains a separate authorization system.
Prerequisites
- An API/resource owner and security reviewer.
- A defined business resource, operation, callers, and enforcement points.
- An inventory search proving whether an existing role already expresses the permission.
- A migration and revocation plan if an older role overlaps.
- Declarative app-registration and Microsoft Graph assignment automation for every environment.
Canonical vocabulary
Role values use:
Ion.<Resource>.<Operation>[.<Constraint>]
Examples of shape, not automatic grants, are Ion.SecurityIncidents.Read and Ion.RemediationAction.Execute.
<Resource>is a stable business capability, in PascalCase. It is not a microservice, caller, team, environment, or project name.<Operation>is one explicit API-contract capability such asRead,Create,Update,Execute, or a deliberately definedReadWrite.<Constraint>is optional and is used only for a stable authorization distinction such asAllorShared; it is not an environment, customer, caller, or temporary project name.ReadWritegrants only the operations documented by the API contract. It does not implicitly grant delete, administration, consent, or role management.- Dynamic customer, ownership, resource, and business constraints are enforced in the BFF and domain service rather than encoded as proliferating roles.
Select the member type
- Select Applications for managed identities and other application-only callers.
- Select Users/Groups for interactive assignments evaluated as user roles.
- Select Both only when exactly the same permission semantics and enforcement are valid for both caller classes.
- Use a delegated scope, not an application role, when an API acts with a signed-in user’s delegated permission.
Define and deploy a role
- Write the proposed value, display name, precise allowed operations, excluded operations, member type, owning API, and business justification.
- Compare it with the inventory. Reuse an exact semantic match; do not create caller-specific aliases.
- Add the role to the API application’s version-controlled manifest for every required environment. Generate environment object references during deployment; do not publish fixed role or service-principal GUIDs.
- Add enforcement in APIM for route-level application role or delegated scope checks.
- Add enforcement in the BFF for user/customer context and in domain services for caller, resource, tenant/customer, operation, and business rules.
- Deploy the role definition before assignments.
- Assign the role to approved principals through declarative automation using Microsoft Graph
appRoleAssignments(or an approved provider backed by Microsoft Graph). Resolve principals, resource service principals, and role IDs by stable declared names at deployment time. - Use admin consent only for the approved permission set and tenant. Record the approver and consent scope.
- Update the role catalogue, caller-target matrix, owner, review date, assignment justification, and revocation procedure.
Do not use AzureAD PowerShell. Do not make a production portal role or assignment the source of truth.
Additive evolution
- Add a new role when semantics expand beyond an existing role.
- Keep the old role active during a measured migration window.
- Update callers and enforcement, then verify old-role usage is zero.
- Disable new assignment of the old role before removing existing assignments.
- Never rename a published value in place, reuse its immutable identifier for different semantics, or broaden it silently.
Positive validation
- Acquire a token using the intended principal and target audience, then verify the expected role claim by server-side validation without storing the token.
- Call each operation explicitly included in the role contract.
- Confirm APIM accepts the route and the domain service permits only the intended customer/resource context.
- Confirm assignment automation is idempotent in each environment.
Negative validation
Verify denial for:
- caller without the role;
- correct role against the wrong audience or API;
- delegated scope presented where an application role is required, and vice versa;
- correct role attempting an excluded operation;
- correct role attempting another customer or unowned resource; and
- old role after its assignment is revoked.
Record correlation IDs and decisions, never token bodies.
Rollback and revocation
- If a new role is unsafe, stop assigning it and disable affected routes or callers.
- Remove new assignments through the same declarative path.
- Restore prior APIM and service authorization policy without repurposing either role.
- Verify the revoked principal fails and unaffected principals still succeed.
- Remove a role definition only after all assignments, callers, consent dependencies, and telemetry usage are gone.
Ownership and evidence
The API owner owns role semantics and domain enforcement. The identity platform owner owns the catalogue and assignment automation. Security approves broad or customer-impacting permissions. Retain the role proposal, member-type decision, manifest diff, assignment approvals, Graph/provider deployment result, positive/negative tests, usage review, migration evidence, and revocation result.