Forum Discussion
Https 401 Unauthorized Post Request for Refreshing Power BI datasets using REST API via Python
- 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
Yes, I've tried using static values in the refresh_url path but still no luck:
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
- haiyangl1045 years agoFrequent Visitor
The tool you've posted is incredibly helpful! I found out the issue: My Azure account (john.doe@abc) and Power BI Pro licensed account (john.doe@xyz) have two different domain names. Because I'm sending HTTPS post request from my Azure account, the error code is saying that the account does not have Power BI Pro License. Do you have any suggestions for authorizing dataset refresh post request from a different Azure account? Our organization's IT department chose to de-couple our Power BI accounts and our Azure accounts, which is outside of my control.
- Anonymous5 years agoNot applicable
Hi haiyangl104,
So you mean your accounts are split into different parts and the current one which you used only has permission to operate power bi contents not has permission to operate these APIs?
If that is the case, you can consider using the azure b2b feature to share the permission to access these contents if it works for the rest API usages.
Distribute content to external guest users with Azure AD B2B - Power BI | Microsoft Docs
Regards,
Xiaoxin Sheng
- haiyangl1045 years agoFrequent Visitor
After digging deeper, I found out that my Power BI Pro licensed account is on the Gov Cloud, with address of "https://app.powerbigov.us/". I noticed that the Power BI REST API documentation only have "https://api.powerbi.com" which is for commercial users. I looked online for GCC version of API by switching to: "https://api.powerbigov.us" but it gives me back the following error:
HTTPError: 403 Client Error: Forbidden for url: https://api.powerbigov.us/v1.0/myorg/groups