Refresh Power BI Report Server Dataset with Powershell and SQL Agent

  • Hi, I have had the below script running for approx 12 months and after a power BI Upgrade on Friday last, it has stopped working.

    I can manually work around it but it would be nice to get it working again.

    Current PowerBI Report Server version: Version 1.10.7698.27886 (January 2021).

    The error is "The remote server returned an error: (403) Forbidden."

    Does anyone have any ideas?

     

    Cheers,

    Dave

    $id = "************************ removed for security**********************"

    $URL = "http://server1/Reports/api/v2.0/CacheRefreshPlans(" + $id + ")/Model.Execute"

    #Write-Output $URL

    $MailFailureNotify = @{"notifyOption"="MailOnFailure"}

    Invoke-WebRequest -Uri $URL -Method Post -Body $MailFailureNotify -UseDefaultCredentials -UseBasicParsing

  • 403 is an HTTP error. Perhaps HTTPS is now being enforced?

    If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.
    See https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help/ for details of how to post T-SQL code-related questions.

  • Hiya Phil, I tried that but no luck.

    it’s worth mentioning that other scripts using the same method are unaffected.

    cheers,

    Dave

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply