Forum Discussion
Https 401 Unauthorized Post Request for Refreshing Power BI datasets using REST API via Python
I experience the following error when trying to refresh my Power BI dataset in a particular workspace via Python:
I've followed this guide online and registered Power BI as "Native App" in Azure Active Directory>App Registrations:
Automate Your Power BI Dataset Refresh with Python - Pivotal BI
Under "Azure Active Directory>App Registrations", our Azure Admin provisioned the following API permissions from the guide:
In Power BI Web Services, I've configured the Data Source credentials correctly:
Despite following all the steps exactly from the guide, refreshing the dataset via Power BI API post request does not work. Strangely, manually clicking refresh button on Power BI desktop and Power BI web services do work.
Any help is appreciated!
- Anonymous5 years ago
Hi haiyangl104,
>>After digging deeper, I found out that my Power BI Pro licensed account is on the Gov Cloud, with address of
It sounds like you are working with GOV cloud.
Currently, we do not have permission to test with these types of resources. I'd like to suggest you open a support ticket to power bi team for further supports.
submit a support ticket
Regards,
Xiaoxin Sheng
11 Replies
- AnonymousNot applicable
HI haiyangl104,
I found you use the f format string in these steps, have you try to concatenate strings with delimiter or use static values to test and send requests?
Regards,
Xiaoxin Sheng
- haiyangl104Frequent Visitor
Yes, I've tried using static values in the refresh_url path but still no luck:
- AnonymousNot applicable
Hi haiyangl104,
If you test on the same variables on documents online testing(REST API document -> try it), did these API works?
I'd like to confirm if your credentials are available for the rest API usage.
Datasets - Refresh Dataset In Group - REST API (Power BI Power BI REST APIs) | Microsoft Docs
Notice: 401 error seems related to request credentials.
401 Unauthorized - HTTP | MDN (mozilla.org)
Regards,
Xiaoxin Sheng