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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
deboec
Helper I
Helper I

Scheduled refresh for dataset with REST API connection

I have a pretty simple Power BI dataset with 4 queries.

The first query retrieves an access_token from an API:

 

= () => let
    url = "https://api./.../application",
    headers = [#"Content-Type" = "application/json"],
    postData = Json.FromValue([applicationId = 123, applicationSecret = "123"]),
    response = Web.Contents(
        url,
        [
            Headers = headers,
            Content = postData
        ]
    ),
    access_token = Json.Document(response)[accessToken]
in
    access_token

 

The other queries use the dynamically generated access token and retrieve data from the API:

 

let
    Source = Json.Document(Web.Contents("https://api./...", [Headers=[token=GetToken()]])),
    # ...
    # ...
in
    # ...

 

It all works fine and I can refresh the data if I click "Refresh" in the dataset in the Power BI desktop application.

 

What I want to do though is to publish the dataset to Power BI service and schedule a refresh.

In order to do so I need to edit the credentials somehow:

deboec_0-1681911797514.png

 

What do I need to do here in order to regularily configure a Scheduled Refresh?

Thank you

1 REPLY 1
deboec
Helper I
Helper I

Update:
If I try and establish the data connection to the Web API without a dynamic token that uses a POST request to get the token for the API, meaning by getting a token value in Python by using the POST request and putting it into the data connection pane:

deboec_0-1681985019723.png

This works fine after publishing it to Power BI Service and clicking on "Refresh Now" -> No Error.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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