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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Bokazoit
Responsive Resident
Responsive Resident

Power BI asks for credentials when I upload my dataset and it is not needed?

let
    #"HR-On employees" = let
    // Parametre
    client_id = "xxx",
    client_secret = "yyy",
    api_url = "url",
    token_url = "token",

    // Obtain Authorization Credentials
    ObtainAuthorizationCredentials = Json.Document(
        Web.Contents(token_url,
            [
                Content = Text.ToBinary("grant_type=client_credentials&client_id=" & client_id & "&client_secret=" & client_secret),
                Headers = [#"Content-Type" = "application/x-www-form-urlencoded"]
            ]
        )
    ),

    refresh_token = ObtainAuthorizationCredentials[refresh_token],

    access_token = ObtainAuthorizationCredentials[access_token],

    // Brug token til at hente data
    Kilde = Json.Document(
        Web.Contents(
            api_url,
            [
                Headers = [Authorization = "Bearer " & access_token]
            ]
        )
    ),
    items = Kilde[items]
in
    Kilde,
    items = #"HR-On employees"[items],
    #"Konverteret til tabel" = Table.FromList(items, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Udvidet Column1" = Table.ExpandRecordColumn(#"Konverteret til tabel", "Column1", {"id", "companyAdmin", "leader", "systemUser", "archived", "picture", "systemFields", "customFields", "departments", "roles", "createdAt", "updatedAt", "customId"}, {"id", "companyAdmin", "leader", "systemUser", "archived", "picture", "systemFields", "customFields", "departments", "roles", "createdAt", "updatedAt", "customId"})
in
    #"Udvidet Column1"

 

When I run my script in power bi desktop, everything is fine, and no prompt for credentials, since everything is handled in the script.

 

But when I upload to Power BI it prompts for credentials and they are not needed. I have tried anonymous, my own etc. but it errors.

 

What might be the error?

1 ACCEPTED SOLUTION
Bokazoit
Responsive Resident
Responsive Resident

Just don't test the connection and everything is fine

View solution in original post

1 REPLY 1
Bokazoit
Responsive Resident
Responsive Resident

Just don't test the connection and everything is fine

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.