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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
petrVolfMBI
Regular Visitor

Rest API Datasets - Update Refresh Schedule In Group - Error

Hi,

currently, we have a problem setting schedule refresh using API with enabled notifications (notifyOption = MailOnFailure) using Service principal (We use Service principal to init everything in our PowerBi workspace).

After we set up the dataset we want to define a Refresh Schedule for the dataset using API.

When we call Rest API with this body (Service Principal is dataset owner): 

 

 

{
    "value": 
        {
            ...
            "notifyOption": "MailOnFailure"
        }
}

 

 

An error is returned:

 

 

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

 

 

We know how to fix this problem by changing "notifyOption": "NoNotification". But notification are then disabled and we have to "manualy" check if any refresh error occured (we have a lot of workspaces with datasets). So this solution is not ideal.

 

Is it possible to configure mailOnFailure with Service Principal? Or add additional email recipients. Current Rest API does not support adding other recipients but in GUI it is possible to add other recipients. Or it does but it is not in Rest API doc?

3 REPLIES 3
Anonymous
Not applicable

Hi @petrVolfMBI,

AFAIK, some of the features are not released to the rest APIs(notice: they may be due to security or performance reasons) so that you can only use it on the power bi service side.

For this scenario, I'd like to suggest you submit ideas for these requirements.

Microsoft Power BI ideas

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Your question showed me the answer to my problem, for which I thank you. Solved: Failing: Datasets.UpdateRefreshScheduleInGroupAsyn... - Microsoft Power BI Community

 

You may need to write your own daemon to check refresh results. You can write an Azure Function that calls restApiClient.Datasets.GetRefreshHistoryXXX().

I am glad that my problem helped you :-).

Thanks, I know how to solve my problem using the daemon (Probably the only solution for this problem for now 😞 ). I hope for a better solution 🙂
But I don't want to solve this that way. We have lots of datasets. And I see some problems like timing, schedules run at different times, refreshes take different amounts of time, and so on. Why should we waste other resources to check if something fails, when the functionality already exists. Power BI has the functionality to handle refresh errors and send an email about the error (But only for users). So, I would like to use the existing functionality for Service Principal.
Or add a notification list to Rest API. In GUI - API does not support that - it is possible to send failure messages to multiple users, but this is possible only for users.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.