Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Prakash_31
Frequent Visitor

*400 Bad Request Error when export Data to sharepoint from PowerBI service using Python(spyder)*

*400 Bad Request Error when export Data to sharepoint from PowerBI service using Python(spyder)* Hello, I have a Power BI report published in my workspace(Premium). the data source is from different sources. My aim is to export a specific table(basically, it is calculated table is a combination of many tables) to a sharepoint list (Copy data from the table to the list)using python API. When I call the API https:// api.powerbi.com/v1.0/myorg/GenerateToken, it goes to catch and throws out Error: 400 Bad Request. I tried the same thing many times, likewise, Please have look at below Code Authority_Url = 'http//login/windows.net/common' Resource_Url = 'http//analysis.windows.net/powerbi/api' api_Url = 'pbiazure://api.powerbi.com' #Change these to your credentials Client_Id = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' Username = 'xxxxxxx-xxxxx-xxxxx-xxxxx.com' Password = 'xxxxxxxx' #First you need to authenticate using Adal context = adal.authenticatecontext(authority=authority_Url, Valifdate_authority=True, api_Version = None) #Get your Athentication token Token = Context.acquire_token_With_Username_Password(resource=resource_Url,Client_id=Client_id,Username= username,password=password) I tried the solution proposed in google through my research, tried this on code as well . But no luck with that. Still, nothing with the better way to get rid of this error. SOME INFO TO TROUBLESHOOT THIS ISSUE: Auth Method: Service Principal Azure App Type: Web Is Service Principal added to the security group and security group under the admin tenant settings on powerbi service : NO IDEA( DO WE NEED MANDATORY FOR NOT GET THIS ERROR) Is Service Principal added to the workspace: NO IDEA(I THINK IT DOESN'T ADDED) Is API permission provided: delegated full access to all datasets, tenant, groups, reports, workspace, capacity etc., Is Scope defined: consent is added for "admins and users" Authorized client applications: Added Or Not Added the clientid (Where can i find this) Any Help is Appreciate 

0 REPLIES 0

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.