Power Automate + SharePoint HTTP: Registering an Azure App and Getting an Access Token

Power Automate flows often rely on the logged-in user’s SharePoint connection, which can be limiting for shared or enterprise-level solutions. When automations need to run independently of a specific user, a better approach is to authenticate using an Azure Entra app registration. This allows Power Automate to request access tokens and securely interact with SharePoint without relying on individual user credentials.

In this post, I’ll walk through how to register an Azure Entra app, create and securely store a client secret, and use it in Power Automate to retrieve an access token. This sets the foundation for app-based authentication with SharePoint and prepares you to start making authenticated HTTP calls.

Step 1: Create the Azure App Registration

  1. Go to Azure Portal ( https://portal.azure.com/ ) —> App Registration

App Registration

2. Select New Registration

New Registration

3. Register the app with a Name, Account type for Single tenant, and leave the Redirect URL blank

Register Application

4. Document the Application (client) ID and the Directory (tenant) ID. These will be used later when accessing your SharePoint site.

App IDs

5. Select API permissions to allow the app to access SharePoint

API Permissions

6. Select SharePoint —> Application Permissions —> Select Permissions: Sites.FullControll.All

SharePoint App Permissions

7. Grant admin consent for the new permission. NOTE: you need admin level access in Azure to do this. If you don’t have this access ask your Azure admin to complete this part.

Grant Consent

8. Select Certificates & secrets

Certificates & secrets

9. Select New client secret and add a description for your secret. Select the expiration date for your secret. Typically, I select 24 months.

Create Client Secret

10. Record the Secret value immediately after the secret is added. This value will not display again. NOTE: if you make a mistake and forget to select it you can always create a new secret.

Copy Secret Value

Step 2: Secret Key Vault

  1. Go back to the Azure home page and select Key Vault

Key Vault

2. Select Create to create you vault

Create Key Vault

3. Select the Subscription and Resource Group you want to utilize, give the vault a Name, select the Region, and pricing tier you want to use.

Create a key vault

4. Add Access control (IAM). This allows you and your desired users to access the Key Vault

Add Access Control

5. Search for the role Key Vault Administrator and add that to yourself and anyone else who needs to access the key.

Key Vault Administrator
Add Members to Admin Role

6. Select Secrets and Generate/Import

Generate Import Secret

7. Give your secret a name and enter in the Secret Value that you copied earlier from you app.

Create Secret

8. Check to make sure your secret has been created. If you don’t have the correct Admin permissions for this specific vault you will not be able to create the secret.

Check Secret has been created

Step 3: Access SharePoint Token in Power Automate

  1. Create Power Automate Flow and select Azure Key Vault to access your secret key

Create Power Automate Flow

2. Create a connection to Azure. The option I used for this instance weas Authentication Type: Default Microsoft Entra ID application for OAuth. The Key vault name you previously created is utilized for the login.

Azure Connection

3. Create HTTP call utilizing the following details:

Method: POST

URI: https://login.microsoftonline.com/<TENANTID>/oauth2/v2.0/token (NOTE: TENANT_ID is the Directory ID from your app)

Headers: Content-Type : application/x-www-form-urlencoded

Body:

clientid=<CLIENTID> (NOTE: CLIENT_ID is the Application ID from your app)

&client_secret=<SECRET_FROM_KEYVAULT> (NOTE: this comes from the value of your Get Secret step)

&grant_type=client_credentials

&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default

Get SharePoint Token

4. Test your flow to check that you are getting a token value from the http call

Access Token

Conclusion

Setting up app-based authentication with Azure Entra can feel a little intimidating at first, especially if you don’t spend all your time working in Azure. While the steps themselves are very doable, the biggest source of friction is often permissions rather than the technical configuration. Throughout this process, it’s important to make sure you either have the required Azure roles or know exactly who on your team does. Even with full admin access in Power Automate and SharePoint, missing or misaligned Azure permissions can quickly stall progress — something I ran into myself the first time I worked through this setup. Keeping permissions in mind from the start can save a lot of time and frustration and make this approach much smoother to implement.

Previous
Previous

Automating Daily Power BI Dataset Exports to Excel with Power Automate

Next
Next

How to Create a Gallery in Canvas Apps with Filters Across Different Column Types (Dataverse)