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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Anonymous
Not applicable

Get Token Access for PBI API - Credentials issue

Hello, 

 

Few months ago I built a Power BI to follow my admin activities and it was working fine at the time.

However I tried to refresh it today and it failed because of Credentials issue with the function that I used to get a Bearer token. 

I used to set the Credentials to Anonymous but it's not working anymore and I do not see whichever other type I can use.

Do you have an idea to solve this problem ? 

 

Here's my function code : 

= () =>
let
    url = "https://login.microsoftonline.com/common/oauth2/token",
    postBody = [
        grant_type = "password", 
        username = "myUserName",
        password = "myPassword",
        client_id = "myClientID",
        client_secret = "myClientSecret",
        resource = "https://analysis.windows.net/powerbi/api"
        ],
    response = Json.Document(Web.Contents(url,
        [
            Content = Text.ToBinary(Uri.BuildQueryString(postBody))
        ])),
 access_token = response[access_token]
in
access_token

 

And the error message : 

Arktus_0-1676885922845.png

 

Thanks a lot for your input ! 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I finally found the answer to my question. 
It was simply that the password of the technical user used here expired... 

Password updated and it's running fine now 🙂 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

I finally found the answer to my question. 
It was simply that the password of the technical user used here expired... 

Password updated and it's running fine now 🙂 

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.