Setup steps in SN / Azure
Flow designer
Script includes

-
Business rule
Auto-route identity tickets via Entragets called oninsertintoINCIDENTStable.- The business rule calls script include
AzureGraphRouter
- The business rule calls script include
-
Script include
AzureGraphRouter- Extracts email from the INCIDENT ticket short description
- Calls
outbound REST message& passes'Graph - sn-ticket-router'and'GetUserByUPN'- REST Message record:
sys_rest_message - HTTP Method record:
sys_rest_message_fn
- REST Message record:
- On return, updates the incident / ticket with the new
assignment group
-
Outbound REST Message
'Graph - sn-ticket-router'andGETmethod in it- Auth type: OAuth 2.0
- OAuth profile
sn-ticket-router-profile - which is linked to the Entra app
sn-ticket-router
- OAuth profile
- HTTP Method
GetUserByUPNpointing at the endpointhttps://graph.microsoft.com/v1.0/users/${upn}?$select=id,displayName,userPrincipalName,department,accountEnabled
- Auth type: OAuth 2.0
-
OAuth profile
sn-ticket-router-profileuses OAuth providerAzure Graph OAuth Clientwith Grant type =Client Credentials- Outh provider is where the Azure app registration setup:

💡 App registration vs service principal
The App registration is the definition (client_id, permissions).
The Service principal (Enterprise App) is the instance in your tenant that actually authenticates and appears in sign-in logs.
Where the “standing authority” lives
In ServiceNow: the OAuth Entity Profile + REST Message config
In Entra: the service principal permissions + admin consent
Tokens are temporary; the authority is standing because it can mint tokens indefinitely.