Command · Connector setup
Set up the Microsoft SharePoint Connector with Sites.Selected
Connect raia Command to SharePoint using the Sites.Selected permission so the connector can only read the specific sites you explicitly share with it — not the entire tenant. This guide walks through the full flow: Azure app registration, permission grant, client secret, per-site authorization via Microsoft Graph, and verification inside Command.
Video walkthrough is available in English.
Overview
Sites.Selected is a Microsoft Graph permission: with the application version, the app can reach only sites where it has been granted access, after admin consent and with a valid token for that scope. Other consented permissions on the same app still apply, so review the app's full grant set.
When it is the only SharePoint permission granted to the app, it is a least-privilege option for enterprise deployments. It is easier to justify in security reviews than the tenant-wide reach of Sites.Read.All or Sites.FullControl.All.
| Permission | Scope |
|---|---|
Sites.Selected | Application permission: access only the sites an administrator explicitly grants to the app (read or write is set per site). Recommended. |
Sites.Read.All | Read every site in the tenant. Broad, hard to defend in security reviews. |
Sites.FullControl.All | Full control of every site. Never add it to the connector app. Separately, the admin who creates the per-site grant in Step 05 consents to the delegated version in Graph Explorer. |
Register the Azure AD app
Create a dedicated app registration for the raia SharePoint connector. Single tenant is the right choice for most deployments.
- 01
Sign in to the Azure Portal and open Microsoft Entra ID → App registrations.
- 02
Click New registration. Give it a clear name (for example, raia SharePoint Connector) and pick Single tenant. Leave the redirect URI empty.
- 03
After the app is created, copy the Application (client) ID and the Directory (tenant) ID from the Overview page — you'll paste these into Command later.
- 04
Keep the Overview tab open; you'll need the display name in Step 05.
Add the Sites.Selected Graph permission
Grant the app the narrowest SharePoint permission Microsoft supports, then have an admin consent to it.
- 01
In the app registration, open API permissions → Add a permission → Microsoft Graph → Application permissions.
- 02
Search for Sites.Selected, check it, and click Add permissions.
- 03
Back on the API permissions page, click Grant admin consent for <your tenant>. Confirm the status turns to Granted.
- 04
Do not add Sites.Read.All or Files.ReadWrite.All — those defeat the purpose of Sites.Selected.
Admin consent is required
Create a client secret
Generate a secret so raia can authenticate as the app, then paste it into the SharePoint connector form in Command.
- 01
In the app registration, open Certificates & secrets → Client secrets → New client secret.
- 02
Give it a description (for example, raia connector) and pick an expiry that matches your rotation policy.
- 03
Immediately copy the Value column — not the Secret ID. The Value is only shown once and cannot be retrieved later.
- 04
Open raia Command → Connectors → Microsoft SharePoint and paste the Tenant ID, Client ID, and Client Secret into the connector form.
- 05
Save the form. If a connection test is offered, a pass only confirms the app credentials; individual sites still fail until you complete Step 05.
- Highlight 1: Setup instructions for the provider side
- Highlight 2: Add connection starts a new connection
Store the secret immediately
Grant the app access to a specific site
Sites.Selected only unlocks the mechanism — it does not grant access to any site. For each SharePoint site you want the connector to read, you have to explicitly grant the app permission using Microsoft Graph.
A SharePoint site is identified by a composite ID with three comma-separated parts: {hostname},{site-collection-id},{site-id}. The easiest way to get it — and to run the grant — is Microsoft Graph Explorer at developer.microsoft.com/graph/graph-explorer.
Step A — resolve the site ID
Sign in to Graph Explorer with a tenant admin account and run a GET to look up the site by its server-relative path:
GET https://graph.microsoft.com/v1.0/sites/{hostname}:/sites/{site-name}For example, if the site URL is https://contoso.sharepoint.com/sites/ThomasTestSite1:
GET https://graph.microsoft.com/v1.0/sites/contoso.sharepoint.com:/sites/ThomasTestSite1The response's id field is the composite site ID. Copy the full string — you'll need it in Step B.
Step B — grant read access to the app
Change the method to POST, paste the URL below (substituting the site ID from Step A), and send the JSON body:
POST https://graph.microsoft.com/v1.0/sites/{site-id}/permissions
Content-Type: application/json{
"roles": ["read"],
"grantedToIdentities": [
{
"application": {
"id": "{APPLICATION_CLIENT_ID}",
"displayName": "{APPLICATION_DISPLAY_NAME}"
}
}
]
}Expect a 403 on your first attempt
Repeat Step 05 for every SharePoint site you want the connector to read. Remove access at any time by DELETEing the permission from the same endpoint.
Verify in raia Command
Confirm the connector can now see the site you just authorized.
- 01
Return to Command → Connectors → Microsoft SharePoint.
- 02
Enter the site URL (or path) into the Test permissions field.
- 03
The site should resolve successfully. If it still fails, wait a minute for the Graph permission to propagate, then re-check the permission was created against the correct site ID.