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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Asynchronous refresh with the PBI API does not return a requestid

Hello,

 

I try to refresh a Power BI dataset programmatically by sending post request to PBI API endpoint: datasets/<datasetid>/refreshes.

 

The documentation (https://docs.microsoft.com/en-us/power-bi/connect-data/asynchronous-refresh) states: The response also includes a location response-header field to point the caller to the refresh operation that was just created/accepted. Location is that of the new resource which was created by the request, which includes the refreshId.

 

 

I used following Powershell code to refresh the dataset, but I don't receive a Location header. Is this a bug or expected behaviour?

 

 

 

 

Login-PowerBI
$XmlaQuery = @"
{
  "refresh": {
    "type": "full",
    "objects": [
      {
        "database": "<Datamodel>",
        "table": "<Table>"
      }
    ]
  }
}
"@

# URL is a relative or absolute URL of the Power BI entity to access. 
Invoke-PowerBIRestMethod -Url 'datasets/<datasetid>/refreshes' -Method Post -Body $XmlaQuery 

 

 

 

 

 

 

 

Status: Investigating

Hi @Anonymous 

 

I’ve tested on this API. As you can see, I run this API with Post request method and get Location and RequestId contained in Response Header.

vcazhengmsft_0-1643618090108.png

vcazhengmsft_2-1643618132055.png

 

Best Regards,

Community Support Team _ Caiyun

Comments
v-cazheng-msft
Community Support
Status changed to: Investigating

Hi @Anonymous 

 

I’ve tested on this API. As you can see, I run this API with Post request method and get Location and RequestId contained in Response Header.

vcazhengmsft_0-1643618090108.png

vcazhengmsft_2-1643618132055.png

 

Best Regards,

Community Support Team _ Caiyun

Anonymous
Not applicable

Hi @v-cazheng-msft ,

 

So I debugged this issue and came to the following conclusions:

 

- When passing no parameters in the body to POST /refreshes the entire dataset gets refreshed, but no Location is returned. Also when I send a request to GET /refreshes/RequestId including the RequestId returned by POST /refreshes, I receive an error: 

 

 

{"error":{"code":"MethodNotAllowed","message":"Operation failed - Refresh details unavailable. Dataset ID ... Refresh ID ... RefreshType is ViaApi."}}

 

This indicates that passing no parameters to POST /refreshes does not initiate an asynchronous refresh, since a GET /refreshes should then return refreshType = 'ReliableProcessing' but now returns refreshType = 'ViaApi'. 

 

- When passing parameters in the body to POST /refreshes I do now receive a valid Location and RequestId, when passing them to GET /refreshes I receive a message including RefreshType = 'ReliableProcessing'.

 

Could you please investigate the issue and get back to me

 

Kind regards,

 

shy78
New Member

I am having same issue, I use the azure Logic App to trigger the POST refresh with parameters, but is not getting the location and requestId value in the response header

shy78_0-1666854232185.png

 

Can anyone help on this? Thanks in advance 

 

Kinda Regards,

 

rajulshah
Super User

Hello @Anonymous ,

 

Did you get the solution to this issue?

I am getting the same error.

Stefan-O
Regular Visitor

@v-cazheng-msft @Anonymous I am having the same issue when triggering a POST from Azure data factory. The RequestID in the ADF response does not match what's in PBI in the screenshots 

 

StefanO_0-1678760945713.png

 

StefanO_1-1678761048818.png

 

StefanO_2-1678761070542.png