Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext 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
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?
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 4 | |
| 3 | |
| 2 |