![]()
In this “Get Azure Access Token” tutorial, we will learn about how to Get Azure Access Token from Copilot Studio Step by Step. In today’s digital landscape, secure API authentication is crucial for seamless integration between Microsoft services. Microsoft Copilot Studio allows us to automate processes and interact with various APIs, but to authenticate and access secured resources, we need an Azure Access Token.
In this article, we will walk you through the step-by-step process to get an Azure Access Token dynamically in Copilot Studio, using Power Automate and Microsoft Graph API authentication. This method ensures secure API authentication in Microsoft Copilot while enabling automation with Azure AD OAuth 2.0 tokens.
Prerequisites
Before proceeding, ensure you have the following:
- A Microsoft Azure account
- Azure AD App Registration with API permissions
- Copilot Studio access
- Power Automate license
Step 1: Register an App in Azure AD
To generate an access token, you need to register an application in Azure Active Directory (Entra ID).
Steps:
- Go to Azure Portal (Microsoft Azure Portal)
- Navigate to Azure Active Directory → App Registrations
- Click on New Registration
- Enter a name (e.g., “CopilotAPIAuth”)
- Choose Accounts in this organizational directory only
- Click Register
Example of App registration in Azure:

For the detailed step, refer to this article: App Registration in Azure: Quickly How Do I Register an Application Step by Step?
Step 1.1: Configure API Permissions
- Open your newly registered app
- Go to API Permissions → Add a permission
- Select Microsoft Graph → Application Permissions
- Add the required permissions (e.g.,
User.Read,Files.ReadWrite) - Click Grant admin consent
Example of Graph API Permissions in Azure portal:

Step 1.2: Generate Client Secret
- Navigate to Certificates & Secrets → New Client Secret
- Enter a name and set the expiration period
- Click Add and copy the generated secret (store it securely)
Example Client Secret in Azure Portal:

Step 2: Create Power Automate Flow for Token Generation
Since Copilot Studio does not support direct OAuth authentication, we use Power Automate to fetch the Azure AD OAuth 2.0 token.
Steps:
- Open Power Automate (Power Automate Maker Portal)
- Click on Create → Instant Cloud Flow
- Choose Manually trigger a flow → Click Create
- Add a new HTTP Action with the following details:
- Method:
POST - URL:
https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token - Headers:
Content-Type: application/x-www-form-urlencoded - Body:
client_id={client_id}&client_secret={client_secret}&grant_type=client_credentials&scope=https://graph.microsoft.com/.default
- Method:
- Parse the response to extract the access_token
- Add a Respond to Copilot action to return the access token
Step 3: Call Power Automate Flow from Copilot Studio
Now, integrate this flow into Copilot Studio:
Steps:
- Open Copilot Studio → Select your bot
- Create a new topic (e.g., “Get Azure Access Token”)
- Add a Trigger Phrase (e.g., “Generate Access Token”)
- Add Call an Action → Select Power Automate Flow
- Map the output to store the access token
- Use the token to call Microsoft Graph API or other secured endpoints
Or you can skip the Power Automate steps; you can directly generate an Azure Access token from the Copilot Studio topic using the HTTP request action.
Get Azure Access Token using Copilot Studio Directly
Create a custom topic in Copilot Studio.
Add an HTTP Request action from the advanced menu.

For the URL, pass the below end point:
Syntax: https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token
Example: https://login.microsoftonline.com/f10e1e03-fffa-47d0-86f4-d0e3c317c65d/oauth2/v2.0/token
Headers and Body Configuration:
Headers:
Content-Type: application/x-www-form-urlencoded
Body (x-www-form-urlencoded):
Syntax: client_id={client_id}&client_secret={client_secret}&grant_type=client_credentials&scope=https://graph.microsoft.com/.default
Example: client_id=11d4ceed-218f-4ab4-8e16-afa3573c369a&client_secret=HN88Q~hbPWNTCOxRDLtb-Ax67iXpYdES.yrkfdkm&grant_type=client_credentials&scope=https://graph.microsoft.com/.default

✅ Expected JSON Response: You will receive a JSON response with the access token:
{
"token_type": "Bearer",
"expires_in": 3600,
"access_token": "eyJ0eXAiOiJKV1Qi..."
}
You can use the above sample JSON for the API End point. Response data type select as “From sample data”, then click on the “Get schema from sample JSON”. In the box, paste the above JSON.

Once you save the schema, automatically record type will be changed to record as shown below.

Now, the API output is stored in a record variable, which I created. Now, we can extract the token type and access token value from this record type variable.
See the below example, I have extracted access token value from the API output and displayed in the message node.

Testing & Validation
- Trigger the Copilot topic → The Power Automate flow should execute
- Verify the response → Ensure the access token is generated successfully
- Use Postman or Graph Explorer to test API calls with the token
I have triggered my topic in Copilot Studio and got the access token along with its type from the Azure portal dynamically.

How to Debug API Access Token Value?
If you want to debug the above access token value in the human readable format, you can use this tool – jwt.ms
Best Practices for Secure API Authentication
- Use Managed Identity if available, instead of client secrets
- Store credentials securely in Azure Key Vault
- Rotate client secrets regularly
- Grant minimal required API permissions to the app
Conclusion
By following these steps, you can dynamically generate an Azure Access Token in Copilot Studio using Power Automate authentication. This method ensures secure API authentication while enabling seamless integration with Microsoft Graph API and other services.
🔹 Now it’s your turn! Try implementing this setup and enhance your automation workflows with Copilot Studio and Azure AD OAuth 2.0 tokens.
📢 Did you find this guide helpful? Share your thoughts in the comments and don’t forget to subscribe to our YouTube channel Power Platform Maven for more Microsoft Copilot Studio tutorials! 🚀
YouTube Video Demo