question

BorsoiEmanuel-1058 avatar image
0 Votes"
BorsoiEmanuel-1058 asked DSPatrick answered

Get MS AAD access token in Power BI - Power Query

I am trying to get a Microsoft AAD access token using a Power Query:

 let
     url = "https://login.microsoftonline.com/<tenant_id>/oauth2/v2.0/token",
    
     body  = "{ ""client_id"": ""<client_id>"",  ""client_secret"": ""<client_secret>"", ""grant_type"": ""client_credentials"", ""scope"":""<scope>""}",
     options = [Headers = [#"Content-Type"="application/x-www-form-urlencoded"], Content = Text.ToBinary(body)],
     tokenResponse = Json.Document(Web.Contents(url,options)),
     AccessToken = tokenResponse[access_token],
     AccessTokenHeader = "Bearer " & AccessToken
 in
     AccessTokenHeader

I get the following error:

DataSource.Error: Fehler beim Abrufen von Inhalten von "https://login.microsoftonline.com/****************/oauth2/v2.0/token" (400) durch "Web.Contents": Bad Request

Need help please, can't find anything on the web.

power-query-not-supported
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

DSPatrick avatar image
0 Votes"
DSPatrick answered

Power Bi is not currently supported here on Q&A. The product group for Power Bi actively monitors questions over at
https://community.powerbi.com/

--please don't forget to upvote and 145510-image.png if the reply is helpful--





5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.