Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a program that uses the Power BI API and has been running just fine for years. We recently moved some machines from on-prem to Azure VMs and suddenly this program no longer works. The error occurs when I run:
Using tsk As Tasks.Task(Of AuthenticationResult) = ctxt.AcquireTokenAsync("https://analysis.windows.net/powerbi/api", sClientID, cred)
tsk.Wait()
End Using
The StackTrace is:
Unfortunately, the error message is an incredibly helpful "One or more errors occurred".
At first, we thought it was a firewall issue, but we can access sites using https, so we know Port 443 is open and working, and the documentation says that the Power BI API only uses 443.
Does anyone have any ideas on what could possibly cause this?
Hi @JECp ,
It sounds like there may be an issue with the authentication process when trying to acquire the API token. The possible solution could be to check if the Azure VMs have the sufficient permissions to access the Power BI API. You may also want to check if the client ID and credentials being used are still valid and have not expired or been revoked.
How to generate Access Token for Azure with grant type password? PowerBI REST API - Stack Overflow
Azure Permissions 101: How to manage Azure access effectively
Best Regards
We looked into firewall and DNS issues, but everything was clear on that front. I was able to get more info about the error though, and it shows this:
I don't understand why I'm getting this, as this is the same App Reg, same user being used for authentication, same network. It's just that the machines I run this from (when it fails) are all Azure VMs. Any on-prem machine works just fine.
Is it seeing Azure VMs as being at a different "location"? If so, how do I address this? I need this code to run from both locations.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
7 | |
6 | |
3 | |
2 | |
2 |