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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Charline_74
Resolver I
Resolver I

Refresh a Dataset with an API error

I use this API to automatically refresh a dataset via a Powershell script with a Service Principal, however when I run the script I get this error in the dataset.

 

Charline_74_0-1679491118798.png

 

Do you know why?

 

My script :

$IDWKS = Get-PowerBIWorkspace -Name 'WKS - [REC] FINANCE'
$IDDTS = Get-PowerBIDataset -WorkspaceId $IDWKS.Id

Invoke-PowerBIRestMethod -Url "https://api.powerbi.com/v1.0/myorg/groups/$($IDWKS.Id)/datasets/$($IDDTS.Id)/refreshes" -Method POST -Body ('$($IDDTS.Id)')

 

1 REPLY 1
lbendlin
Super User
Super User

Do exactly as the error message says.  Refresh the credentials in the dataset settings page. Credentials do expire, service principal or not.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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