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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
janfcarl
Helper I
Helper I

Set scheduled refresh of dataset via api v2

Hello, is it possible, to set a scheduled refresh of a dataset programmatically,

via the Power BI API? I use the API v2.

If not, is it possible to make a configuration in Power BI Service, so that all newly uploaded datasets

have automatically a scheduled refresh?

Kind regards,

Jan

1 ACCEPTED SOLUTION

I'm not even sure you can do that. You might be able. But it won't be very straight foward. I'm not sure about the C# methods but I can talk about the API.

You will need to take a look at 3 o 4 requests you can call to try this. Even though every request has limitations, so you might need to read them and be sure you can build something like that.

I can only help you pointing the requests you might need. That might be all because the rest is coding a custom script or back end app scenario.

 

After importing you might need to understand the sources in dataset. Get Datasources in Group from dataset and keep those ids. Depending on the type (cloud or onpremise), you might need to Bind to Gateway In Group those sources. At the end you might be able to Update Schedule Refresh in Group sending the time and stuff (it is easier to understand it if you have configured it completely manual at least one time)

You might need to take a look at Update Datasources in Group if you already have them and you are just updating stuff.

You can find the datasets requests here: https://docs.microsoft.com/en-us/rest/api/power-bi/datasets

 

I have writen the same names (italic format) in the paragraph so you can find them.

I hope that make sense


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

View solution in original post

3 REPLIES 3
ibarrau
Super User
Super User

Hi! despite of the fact that you can do it via API, I would suggest not to if this is your first time with Power Bi. You can handle all of it with the Power Bi UI. You can configure schedule refresh for datasets and it's sources credentials (for cloud sources) and the on premise gateway (for onpremise sources). You can read more about it here: https://docs.microsoft.com/en-us/power-bi/report-server/configure-scheduled-refresh

Once you know that you might be able to understand which requests you need to run in the API to make a similar behavior: https://docs.microsoft.com/en-us/rest/api/power-bi/datasets

I hope that helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Hi, yes, I saw I can do it in the UI. Problem is, we have a web portal where users can upload PBI reports to PB Service. It would be very helpful if we could configure the scheduled refresh already during upload, so that admin does not need to do it in the PBS. 

What would be the correct api operation using C#?

I'm not even sure you can do that. You might be able. But it won't be very straight foward. I'm not sure about the C# methods but I can talk about the API.

You will need to take a look at 3 o 4 requests you can call to try this. Even though every request has limitations, so you might need to read them and be sure you can build something like that.

I can only help you pointing the requests you might need. That might be all because the rest is coding a custom script or back end app scenario.

 

After importing you might need to understand the sources in dataset. Get Datasources in Group from dataset and keep those ids. Depending on the type (cloud or onpremise), you might need to Bind to Gateway In Group those sources. At the end you might be able to Update Schedule Refresh in Group sending the time and stuff (it is easier to understand it if you have configured it completely manual at least one time)

You might need to take a look at Update Datasources in Group if you already have them and you are just updating stuff.

You can find the datasets requests here: https://docs.microsoft.com/en-us/rest/api/power-bi/datasets

 

I have writen the same names (italic format) in the paragraph so you can find them.

I hope that make sense


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.