Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
We are writing a C# application to automate the creation of datasets for specific customers in a Power BI Embedded Capacity (v2). We are using latest versions of the following Nuget packages: Microsoft.PowerBI.API (v4.2.0) ("REST API Library") and Microsoft.AnalysisServices.NetCore.retail.amd64 (v.19.32.0) ("TOM API Library"). We authenticate our API calls with access tokens issued to an AAD Service Principal which, as far as we know, has all necessary permissions in Power BI.
We are able to:
But we get a 400 Bad Request when we try to create a refresh schedule for the dataset. We call Datasets.UpdateRefreshScheduleInGroupAsync() with what we believe are the correct parameters. Here is the code:
var schedule = new RefreshSchedule
{
Days = new List<Days?> { Days.Monday },
Times = new List<string> { "01:00" },
LocalTimeZoneId = "Eastern Standard Time",
Enabled = true
};
await restApiClient.Datasets.UpdateRefreshScheduleInGroupAsync(
workspaceId,
datasetId.ToString(),
schedule);
It throws Exception: 400 Bad Request. We receive no other information about what caused the failure.
We have tried sending a RefreshSchedule without setting any properties except Enabled = true, and also sending a RefreshSchedule with only Days and Enabled properties set. No matter what properties we set, we always get Exception: 400 Bad Request.
How do we make this work?
Solved! Go to Solution.
No one else replied, but I found the solution. The RefeshSchedule needs to set NotifyOption to ScheduleNotifyOption.NoNotification. That's apparently because the dataset owner is a service principal, and NoNotification is apparently not the default.
var schedule = new RefreshSchedule
{
Days = new List<Days?> { Days.Monday },
Times = new List<string> { "01:00" },
LocalTimeZoneId = "Eastern Standard Time",
Enabled = true,
NotifyOption = ScheduleNotifyOption.NoNotification
};
Microsoft, would you please document this so we don't spend days figuring it out?
No one else replied, but I found the solution. The RefeshSchedule needs to set NotifyOption to ScheduleNotifyOption.NoNotification. That's apparently because the dataset owner is a service principal, and NoNotification is apparently not the default.
var schedule = new RefreshSchedule
{
Days = new List<Days?> { Days.Monday },
Times = new List<string> { "01:00" },
LocalTimeZoneId = "Eastern Standard Time",
Enabled = true,
NotifyOption = ScheduleNotifyOption.NoNotification
};
Microsoft, would you please document this so we don't spend days figuring it out?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 1 |
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 3 |