Forum Discussion

Aaronasp's avatar
Aaronasp
Regular Visitor
2 years ago

Get-PowerBIDataSet Error

The below the lines of code are part of one of my powershell scripts and it was working until this week when I starter to get an error (see below):

Code:

$datasetName = (Get-PowerBIdataset -Id $datasetID -Scope Organization).Name
if ( [string]::IsNullOrEmpty($datasetName)){
write-host "UNKNOWN - Could not find the requested dataset!"
exit 3
}

 

Error:

Get-PowerBIdataset : A task was canceled.
At E:\PowerBI\scripts\nagios-check-refresh.ps1:131 char:17
+ ... asetName = (Get-PowerBIdataset -Id $datasetID -Scope Organization).Na ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (Microsoft.Power...tPowerBIDataset:GetPowerBIDataset) [Get-PowerBIDataset], TaskCanceledException
+ FullyQualifiedErrorId : A task was canceled.,Microsoft.PowerBI.Commands.Data.GetPowerBIDataset

 

I tried a lot of ways to avoid this but the Get-PowerBIDataSet is not returning any value when I pass the $datasetid and I confirmed it's valid and the user is an admin.

Not sure if this is related to the update on the Power BI to the dataset that are not longer called in that way but Semantic Model, please advise about any possible solution.

4 Replies

  • Aaronasp's avatar
    Aaronasp
    Regular Visitor

    I tried to get the name of the dataset using the datasetID in this line:

     

    $datasetName = (Get-PowerBIdataset -Id $datasetID -Scope Organization).Name

     

    but apparently the Get-PwerBIdataset is not working anymore because is returning the error I posted above, no matter how I change that never return the value and that was working just fine until this week.

    • Anonymous's avatar
      Anonymous
      Not applicable

      HI Aaronasp,

      Have many times you test with these API? AFAIK, current tenant/capacity existed limitation process the request and they will block/cancelled if too many requests sent.
      In addition, how long did this request processed? If the current request execute too long times power bi service will also cancel the request.

      Regards,

      Xiaoxin Sheng

      • Aaronasp's avatar
        Aaronasp
        Regular Visitor

        how this can be a solution, this is a joke, nothing that you mentioned make any sense, there is no limitation on nothing, I found a work around that but stop posting things that doesn't help at all, thanks for nothing