Set up the app registration
Document Intelligence uses one Microsoft Entra app registration in your tenant for two things:
- Scanning. The scanner reads SharePoint through Microsoft Graph as this app (application permission, no signed-in user).
- Signing in to the dashboard. People sign in to the web app with their work accounts through this app.
You need a role that can create app registrations and grant admin consent for Microsoft Graph application permissions, such as Privileged Role Administrator or Global Administrator. It takes about ten minutes.
Before you deploy
1. Register the app
- In the Microsoft Entra admin center, go to Applications > App registrations > New registration.
- Name it, for example
Document Intelligence. - Supported account types: Accounts in this organizational directory only (single tenant).
- Leave the redirect URI empty for now; you add it after deployment.
- Select Register, then copy the Application (client) ID and Directory (tenant) ID from the Overview page.
2. Give it read access to SharePoint
Under API permissions > Add a permission > Microsoft Graph > Application permissions, add one of:
| Permission | Choose it when | In the deployment wizard |
|---|---|---|
Sites.Read.All | You want to scan every site, or several sites, without granting each one | Leave Site URLs empty to scan every site, or list the sites to scan |
Sites.Selected | You want the app to see only the sites you grant it | List every granted site in Site URLs (the app can't discover sites itself) |
Then select Grant admin consent for <your organisation> and check the status shows as granted.
The scanner only reads. It never changes, moves or deletes anything in SharePoint.
With Sites.Selected, grant each site separately, for example with Microsoft Graph PowerShell:
Connect-MgGraph -Scopes "Sites.FullControl.All"
$site = Get-MgSite -SiteId "contoso.sharepoint.com:/sites/finance"
New-MgSitePermission -SiteId $site.Id -BodyParameter @{
roles = @("read")
grantedToIdentities = @(@{ application = @{ id = "<application-client-id>"; displayName = "Document Intelligence" } })
}
3. Create a client secret
- Go to Certificates & secrets > Client secrets > New client secret.
- Choose an expiry that fits your policy, and note the date.
- Copy the secret's Value (not its ID) straight away; it is shown only once.
The deployment stores the secret in a Key Vault inside the managed resource group. Nothing else holds it.
4. Turn on ID tokens for sign-in
Under Authentication, in Implicit grant and hybrid flows, tick ID tokens and save. The dashboard's sign-in (Azure Container Apps authentication) needs it.
Deploy
In the Azure Marketplace wizard, enter the tenant ID, client ID and secret, and choose which sites to scan. The optional AI step is described in Data handling.
After you deploy
5. Add the dashboard's redirect URI
- In the Azure portal, open the managed application, then Parameters and Outputs, and copy webAppHostName.
- On the app registration, go to Authentication > Add a platform > Web and add:
https://<webAppHostName>/.auth/login/aad/callback - Save. Browse to
https://<webAppHostName>and sign in.
6. Decide who can sign in and who is an Admin
By default, anyone in your organisation who can sign in can view the dashboard: findings, document names and scan status. Document text is never shown on these pages.
The Admin role is needed to change a finding's status and to use Ask (chat), because chat answers quote document text. To set it up:
- On the app registration, go to App roles > Create app role: display name
Admin, allowed member types Users/Groups, valueAdmin. - In Enterprise applications, open the app, go to Users and groups > Add user/group, and assign the role.
- To limit sign-in to assigned people only, set Properties > Assignment required? to Yes on the same enterprise application.
Role changes apply the next time the person signs in.
Rotating the secret
When the secret expires, scanning and sign-in stop. Set a reminder a few weeks ahead.
You rotate the secret yourself. The managed resource group is locked against other changes, but it lets you grant yourself access to its Key Vault, write a new secret, and restart the two apps.
-
On the app registration, create a new client secret and copy its Value.
-
Open the managed application in the Azure portal and note its Managed resource group. In that group, find the Key Vault (
kv-di-…) and the two container apps (ca-scanner-…andca-web-…). -
Give yourself permission to write secrets in that Key Vault (once per person):
az role assignment create --assignee <your-user-object-id> \ --role "Key Vault Secrets Officer" \ --scope $(az keyvault show -n <key-vault-name> --query id -o tsv) -
Write the new secret. The apps always read the latest version.
az keyvault secret set --vault-name <key-vault-name> -n graph-client-secret --value '<new secret value>' -
Restart both apps so they pick it up:
for app in <scanner-app-name> <web-app-name>; do az containerapp revision restart -g <managed-resource-group> -n $app \ --revision $(az containerapp show -g <managed-resource-group> -n $app --query properties.latestRevisionName -o tsv) done -
Sign in to the dashboard to check it works, then delete the old secret from the app registration.
The model endpoint's API key (inference-api-key, only present with AI on) is rotated the same way.
Troubleshooting
| Symptom | Likely cause |
|---|---|
Scanning page stays empty; scanner logs show 403 or Authorization_RequestDenied | Admin consent missing, or Sites.Selected without a grant for that site |
| Scanner logs say it couldn't list sites | Sites.Selected with Site URLs left empty: list the granted sites |
Scanner logs show AADSTS7000215 | The secret is wrong, expired, or its ID was entered instead of its Value |
Sign-in shows AADSTS50011 (redirect URI mismatch) | Step 5 not done, or a typo in the host name |
| Sign-in fails with a message about ID tokens or the response type | Step 4 not done |
| Signed in, but there's no way to change a finding or use Ask | The person doesn't have the Admin app role, or hasn't signed in again since getting it |
Scanner logs are in the Log Analytics workspace in the managed resource group (container app ca-scanner-…).