Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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.
I've the same issue , it works with another api with oauth2 for another system but not for microsoftlogin whereas it works in postman...
According to Chris Webb this will only work in custom connectors.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 19 | |
| 14 | |
| 12 | |
| 10 | |
| 8 |