0

Below is error that I could not update refreshSchedule of the datasets:

{
  "error": {
     "code": "InvalidRequest",
     "message": "Invalid NotifyOption value 'MailOnFailure' for app only owner requests"
  }
}

Below is code to call it:

var datasets = await client.Datasets.GetDatasetsAsync(new Guid(_workspaceId));
var days = new List<Days?> { Days.Monday, Days.Tuesday, Days.Wednesday, Days.Thursday, Days.Friday, Days.Saturday, Days.Sunday };
var times = new List<string> { "00:00" };
var refreshSchedule = new RefreshSchedule(days, times, true, "UTC");
var id = "XXX";

await client.Datasets.TakeOverAsync(new Guid(_workspaceId), id);
var refreshRequest = new RefreshRequest(NotifyOption.NoNotification);
// refresh datasets
await client.Datasets.RefreshDatasetAsync(new Guid(_workspaceId), id, refreshRequest);
// Target: Update RefreshSchedule (Exception for calling this)
await client.Datasets.UpdateRefreshScheduleInGroupAsync(new Guid(_workspaceId), id, refreshSchedule);

1 Answer 1

2

Can you pls let me know how the app is consuming the endpoint - User Interventaion or Completeley done through AppOnly or using the master user Credential?

Alternatively, if you don't want the MailOnfailure, can you set up explicitly No Notification for the Refresh Schedule and Try ?

just modified your piece of code and presented below :

 var refreshSchedule = new RefreshSchedule(days, times, true, "UTC", ScheduleNotifyOption.NoNotification);

The snippet :

var days = new List<Days?> { Days.Monday, Days.Tuesday, Days.Wednesday, Days.Thursday, Days.Friday, Days.Saturday, Days.Sunday };
var times = new List<string> { "00:00" };
//Fixed code
var refreshSchedule = new RefreshSchedule(days, times, true, "UTC", ScheduleNotifyOption.NoNotification);

await client.Datasets.UpdateRefreshScheduleInGroupAsync(WorkspaceId, datasets.Id, refreshSchedule);

UPDATE

When i used ServicePrincipal (without any UserIntervention/Master User Credential)

I was able to repro your issue

Error Status: BadRequest (400) Response: {"error":{"code":"InvalidRequest","message":"Invalid NotifyOption value 'MailOnFailure' for app only owner requests"}}

I was able to get past the error by making use of the ScheduleNotifyOption.NoNotification in the refreshSchedule mentioned above.

enter image description here

Or if i use the app through cred of a mailenabled account.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks @sathya_vijayakumar-MSFT. After I granted privilege to ServicePrincipal in PowerBI console and using your suggested method ScheduleNotifyOption.NoNotification, it is okay to update RefreshSchedule now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.