Permission & Access Issues

How to Grant Azure Managed Identity Access to SharePoint Online

Steve KSteve K Oct 20, 2026 868 views

Question details

The user needs to connect an Azure Managed Identity to SharePoint Online and grant it the necessary site access and permissions.

How to Grant Azure Managed Identity Access to SharePoint Online
Product
SharePoint Online
Device & OS
not provided
Scenario
Configuring application authentication to allow an Azure managed identity or registered application to securely interact with a SharePoint Online environment.
Observed behavior
The user is looking for the proper setup sequence for Azure app registration, OAuth 2.0 client credentials flow, and SharePoint API permissions assignment.
Before you start

Ensure you have global administrator or application administrator privileges in Microsoft Entra ID (formerly Azure AD) and administrative access to the target SharePoint Online environment before starting the configuration.

Solution 1Recommended

Configure Application Registration and SharePoint Permissions via Azure Portal

Set up the Azure Managed Identity by registering an application, generating credentials, and assigning API permissions for SharePoint Online.

Connecting an Azure Managed Identity to SharePoint Online requires setting up application authentication using the OAuth 2.0 client credentials flow. This process is fully managed within the Azure portal.

1
Register the Application in Azure

Log into the Azure portal, navigate to Microsoft Entra ID, select 'App registrations', and register a new application to represent your managed identity.

2
Configure OAuth 2.0 Client Credentials

Navigate to the 'Certificates & secrets' section of your registered application. Generate a new client secret or upload a certificate to enable secure OAuth 2.0 authentication.

3
Assign SharePoint API Permissions

Go to 'API permissions' on the left menu, click 'Add a permission', choose 'SharePoint', and select the 'Application permissions' tab. Check the required permissions (such as Sites.Read.All or Sites.Selected) and click 'Add permissions'.

4
Grant Admin Consent

Once the permissions are added, click the 'Grant admin consent for [Your Organization]' button to authorize the application to use the requested SharePoint permissions.

Configure Application Registration and SharePoint Permissions via Azure Portal
Granular Site Permissions: If you are using the 'Sites.Selected' permission to follow the principle of least privilege, you must use Microsoft Graph API or PnP PowerShell to grant the application access to specific SharePoint sites.
Free Microsoft Office alternative

Looking for a Lightweight Document Solution? Try WPS Office

While Microsoft Cloud handles enterprise architecture like Azure and SharePoint, users still need reliable, fast tools for everyday document editing. WPS Office provides a free, lightweight alternative to heavy desktop applications, offering seamless migration and familiar functionality.

  1. 1. Download the Installer: Visit the official WPS Office website and download the installation package for your operating system.
  2. 2. Install the Software: Run the installer and follow the on-screen instructions to complete the setup in minutes.
  3. 3. Open Your Office Documents: Launch WPS Office and seamlessly open your existing Word, Excel, PowerPoint, or PDF files without losing formatting.
Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx).Lightweight architecture ensures fast launch times on Windows, Mac, Linux, and mobile.Familiar tabbed user interface, ensuring zero learning curve for users migrating from Microsoft Office.Advanced PDF toolkit built directly into the suite for managing, converting, and signing documents.
microsoft office alternative - wps office

Frequently Asked Questions

Can I use a System-Assigned Managed Identity directly with SharePoint Online?

Yes, but you cannot assign API permissions to a System-Assigned Managed Identity directly through the Azure portal UI. You must use Microsoft Graph PowerShell or the Azure CLI to map the required Microsoft Graph or SharePoint API roles to the identity.

What is the difference between Sites.Read.All and Sites.Selected in SharePoint permissions?

Sites.Read.All grants the application read access to every site collection across your entire SharePoint tenant. Sites.Selected is much more secure, restricting access so the application can only interact with specific sites that an administrator explicitly approves via the Graph API.

Where can I find my Azure application's Client ID and Tenant ID?

You can find both the Application (Client) ID and Directory (Tenant) ID on the 'Overview' page of your registered application inside the Microsoft Entra ID portal.

Why am I getting a 401 Unauthorized error when connecting to SharePoint via Managed Identity?

A 401 error typically occurs if the identity lacks the necessary SharePoint API permissions, if Admin Consent has not been granted in Azure, or if your access token was requested for the wrong resource scope (e.g., requesting a token for Graph API but using it on a SharePoint endpoint).