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

- 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.
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.
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.
Log into the Azure portal, navigate to Microsoft Entra ID, select 'App registrations', and register a new application to represent your managed identity.
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.
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'.
Once the permissions are added, click the 'Grant admin consent for [Your Organization]' button to authorize the application to use the requested SharePoint permissions.

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. Download the Installer: Visit the official WPS Office website and download the installation package for your operating system.
- 2. Install the Software: Run the installer and follow the on-screen instructions to complete the setup in minutes.
- 3. Open Your Office Documents: Launch WPS Office and seamlessly open your existing Word, Excel, PowerPoint, or PDF files without losing formatting.

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).




