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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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

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.