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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Jessy_D
Frequent Visitor

Importing microsoft api data in power bi fails

Hi,

 

We have 2 dataflows that import data from Microsoft REST API's but since Monday, the dataflows have lot's of issues to get passed the authentication step. When we try to get our token from https://login.microsoftonline.com/<id>/oauth2/token we don't get a response. When we try it in Power BI Desktop or Postman, it works immediatly. There hasn't been any changes on those dataflows for a couple of weeks. 

Anyone else has this issue?

1 ACCEPTED SOLUTION

The issue has been resolved after an update from microsoft in the backend.

View solution in original post

11 REPLIES 11
jake_BIV
Helper I
Helper I

@Jessy_D 

I have the exact same issue. I don't think its a coincidence. See my topic link below.  Have you put a ticket into Microsoft?

https://community.fabric.microsoft.com/t5/Service/Timeout-getting-Auth-Token-from-MS-Graph-or-PBI-AP...

@jake_BIV I have been in contact and it is confirmed by the support desk from Microsoft it is a bug with at least the gen 1 dataflows. It works all if you place all the code in a semantic model, but this is not preferred because we use the data in several other situations and we prefer dataflows.

Hi @Jessy_D 

I would like to know if the issue has been resolved. If so, kindly mark the reply that provided the solution as accepted. This will help other community members facing similar challenges to find a resolution more efficiently.

Thank you!

The issue has been resolved after an update from microsoft in the backend.

Jessy_D
Frequent Visitor

Nothing has changed from permissions or anything at our side. It has always worked until Monday.

The dataflows are in the online version of Power BI, and we want to connect to login.microsoftonline.com. So no gateway is needed. Changing regions also didn't work.

I have 2 functions. One gets an token for the async api of microsoft, the other for the non async api of microsoft. Both don't work.

 

//non async api token

let
  Source = () => let
  apiUrl = "https://login.microsoftonline.com/<id>/oauth2/token",
  body = [
          client_id="<clientid>",
          grant_type="client_credentials",
          client_secret="<secret>",
          resource="https://graph.windows.net"
],
  Source = Json.Document(Web.Contents(apiUrl, [Headers = [Accept = "application/json"],
 Content = Text.ToBinary(Uri.BuildQueryString(body))])),
  access_token = Record.Field(Source, "access_token")
in
  access_token
in
  Source
  
//Async api token
  
let
  Source = () => let
  apiUrl = "https://login.microsoftonline.com/<id>/oauth2/v2.0/token",
  body = [
          client_id="<clientid>",
          grant_type="client_credentials",
          client_secret="<secret>",
          scope="https://graph.microsoft.com/.default"
  ],
  Source = Json.Document(Web.Contents(apiUrl, [Headers = [#"Content-Type" = "application/x-www-form-urlencoded", #"Accept" = "*/*"],
  Content = Text.ToBinary(Uri.BuildQueryString(body))])),
  access_token = Record.Field(Source, "access_token")
in
  access_token
in
  Source

 

Hi @Jessy_D 
Hope you are doing well!
We would like to follow up to see if the solution provided by our super user @rajendraongole1  has been helpful to you or let us know if you need any further assistance here? 

 

Your feedback is important to us, Looking forward to your response.

Thanks

I have been in contact with the support of Microsoft. It still doesn't work, but we have been working hard to search for a solution. When we move to code from a dataflow to a semantic model, it works. When we replace the code for getting the access token with a fixed active token in the dataflow, it also works for the non async microsoft api, but not for the async api. That one only seems to work maybe once a day.

Hi @Jessy_D ,

 

Have you tried to disable load for the parameters on dataflow?.

 

I have created a bunch of MS Graph API connections for our clients and all of them are working fine.

 

You can try changing authentication and privacy.

 

Thanks,

Sai Teja 

We tried everything. Changing privacy levels, making a new dataflow, change settings, change timezone, ... nothing works. But when placed in a semantic model it works. Microsoft support confirmed it is a bug with the gen 1 dataflows and are looking into it. 

SaiTejaTalasila
Super User
Super User

Hi @Jessy_D ,

 

If you are passing any parameters please disable load. 

 

I hope it will fix the issue.

 

Thanks,

Sai Teja 

rajendraongole1
Super User
Super User

Hi @Jessy_D  - can you please verify the application registration in Azure AD. Ensure the app has the correct permissions for the API and that the authentication settings match what Power BI requires.Test the authentication flow manually using Postman (as you did) and compare the request details with the ones used in the dataflow.

Check the Microsoft Azure Status Page for any reported issues with Azure AD or related services.
Ensure there are no firewall rules or proxy configurations that might block Power BI from accessing https://login.microsoftonline.com.

 

Test if the issue persists when using a different region (e.g., set up the dataflow in another Power BI Service region).
Contact Microsoft Support to confirm if there are any region-specific issues.

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
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.