cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
janfcarl
Helper I
Helper I

Disabling a refresh schedule throws Bad Request

Hi, I am trying to disable a scheduled refresh on a dataset, using Power BI for C#. I can sucessfully add a scheduled refresh by using the below code.

 

var refreshSchedule = new RefreshSchedule(days, times, true, "UTC", ScheduleNotifyOption.NoNotification);
powerBiClient.Datasets.UpdateRefreshScheduleInGroup(new Guid(workspaceId), datasetId, refreshSchedule);

 

I tried to retrieve the existing schedule and setting Enabled = false,

 

var refreshSchedule = powerBiClient.Datasets.GetRefreshScheduleInGroup(new Guid(workspaceId), datasetId);
refreshSchedule.Enabled = false;
powerBiClient.Datasets.UpdateRefreshScheduleInGroup(new Guid(workspaceId), datasetId, refreshSchedule);

 

as well as just adding a new, disabled schedule,

 

var refreshSchedule = new RefreshSchedule(null, null, false, "UTC", ScheduleNotifyOption.NoNotification);
powerBiClient.Datasets.UpdateRefreshScheduleInGroup(new Guid(workspaceId), datasetId, refreshSchedule);

 

but either ways throws a Bad Request error.

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @janfcarl,

What type of workspace and contents are you working on? Any specific setting that you apply to the content you used? Have you confirmed the permission setting that API required? Please share some more detail bout these operations to help us clarify and reproduce the scenario:

How to Get Your Question Answered Quickly 

In addition, have you tried to directly test on the rest API document with 'try it' option?

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
lbendlin
Super User
Super User

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors