Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
Hi there!
I am encountering an issue with my code while trying to obtain the access token via the Power BI API. In Azure Directory, everything is configured, and the necessary permissions are in place. In the Power BI admin portal, all settings related to the API are already enabled. I will share my Python code below, where I am encountering a 403 error. I have omitted sensitive information such as Client Secrets, App ID, Tenant ID, Username, and Password for security reasons.
Code:
Hi @Juliana4u ,
Perhaps you can take a look at below article:
Troubleshoot Power BI REST APIs - Power BI | Microsoft Learn
A 403 error can occur for any of the following reasons. A Fiddler capture might be required to investigate further.
In addition, the following link had the similar problem as yours. Please refer to it and see if it helps you.
Solved: 403 error Power BI rest API - Microsoft Fabric Community
Best Regards,
Yulia Yan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 22 | |
| 22 | |
| 18 | |
| 16 | |
| 13 |
| User | Count |
|---|---|
| 63 | |
| 41 | |
| 40 | |
| 39 | |
| 38 |