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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

PBI dataset enhanced refresh via REST API in ADF pipeline: Table refresh

Hello, 

 

I tried to implement the enhanced Dataset refresh as sugessted on this page:

https://docs.microsoft.com/en-us/power-bi/connect-data/asynchronous-refresh

 

Below is the input for the Datafactory web activity of the REST API call:

Input
{ "url": "https://api.powerbi.com/v1.0/myorg/groups/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/datasets/xxxxxxxxxxxxxxxx...", "connectVia": { "referenceName": "ir-a2-pub-01", "type": "IntegrationRuntimeReference" }, "method": "POST", "headers": { "Content-Type": "application/x-www-form-urlencoded" }, "body": { "type": "Automatic", "commitMode": "partialBatch", "maxParallelism": 20, "retryCount": 3, "objects": [ { "table": "Fact GL Balance" }, { "table": "Fact GL Movement" } ] }, "authentication": { "type": "MSI", "resource": "https://analysis.windows.net/powerbi/api" } }
 
But instead of refresh only the 2 tables I specified here, it refreshes the whole dataset.
 
Can anyone see what is not working properly here?
 
Thank you
Status: Investigating

Hi @Anonymous ,

 

To perform anenhancedrefresh operation,you must specify one or more parametersin the Request Body. Additional parameters can specify the default or an optional value. When specified, all other parameters are applied to the operation using the default value. If no additional parameters are specified, other parameters won't be applied and a standard refresh operation is performed.

 

You can refer to the following article to see if it helps. Cancelling Power BI Dataset Refreshes With The Enhanced Refresh API 

 

Best Regards,
Community Support Team _ Caitlyn

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

Hi @Anonymous ,

 

To perform anenhancedrefresh operation,you must specify one or more parametersin the Request Body. Additional parameters can specify the default or an optional value. When specified, all other parameters are applied to the operation using the default value. If no additional parameters are specified, other parameters won't be applied and a standard refresh operation is performed.

 

You can refer to the following article to see if it helps. Cancelling Power BI Dataset Refreshes With The Enhanced Refresh API 

 

Best Regards,
Community Support Team _ Caitlyn

Anonymous
Not applicable

hello,

I've specified the parameters in the body as following, 

 

"body":

{ "type": "Automatic",

      "commitMode": "partialBatch",

          "maxParallelism": 20,

              "retryCount": 3,

                 "objects": [ { "table": "Fact GL Balance" }, { "table": "Fact GL Movement" } ]

}

 

and the table names are correct, but it still refreshes the whole dataset instead of just the two fact tables I specified.

Sourav1202
New Member

I used following script and it worked for me.
I had 2 table, updated 1 row value in both table and used below script, it updated only the value f table used in script while other table value remained uncganged.

{
"type": "automatic",
"commitMode": "transactional",
"maxParallelism": 2,
"retryCount": 2,
"objects": [
{
"table": "Table_Name"
}
]
}

po-wei
Employee

v-caitlyn-mstf (Community Support)  Hi, we have internal documents to help customer on debugging. Please let me know if you need help. I'm one of the engineer developing this feature from Power BI product team. (pohuan) 

xiangyangGuo: Thanks for trying our feature. Could you provide your refreshId and your region? That could be get from GetHistory. We could take a look from backend log.

Anonymous
Not applicable

Hello,

I'm triggering the refresh in Azure Datafactory 

just did a test run again and the same it refresh the whole dataset instead of the tables I specified.

region is sweden.

 

"id": 379526866,
"refreshType": "ViaApi",
"startTime": "2022-07-29T13:29:38.563Z",
"endTime": "2022-07-29T13:30:36.117Z",

 

please share the log / documents that could be relevant.

 

Thank you very much

po-wei
Employee

powei_0-1659107482006.png

Could you please give me the API response of this get history call?

From viaApi, it doesn't sound right. It should be ViaEnhancedApi.

Could you paste me the Get API url and your result for the dataset being investigated?

po-wei
Employee
Anonymous
Not applicable

Hello, below is the respose from get via ADF. refresh type is viaAPI, do you happen to how I can change it to viaenhancedAPI? thank you very much

{
"@odata.context": "http://wabi-north-europe-g-primary-redirect.analysis.windows.net/v1.0/myorg/groups/XXXXXXXXXXXXXXXXX...",
"value": [
{
"requestId": "f7817d95-862c-473a-a735-f871d5fc17ff",
"id": 381739764,
"refreshType": "ViaApi",
"startTime": "2022-08-01T19:51:46.553Z",
"status": "Unknown"
}
],
"ADFWebActivityResponseHeaders": {
"Pragma": "no-cache",
"Transfer-Encoding": "chunked",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"X-Frame-Options": "deny",
"X-Content-Type-Options": "nosniff",
"RequestId": "bec022e0-cbcc-4c20-a77b-7a44d91a3506",
"OData-Version": "4.0",
"Access-Control-Expose-Headers": "RequestId",
"request-redirected": "true",
"home-cluster-uri": "https://wabi-north-europe-g-primary-redirect.analysis.windows.net/",
"Connection": "close",
"Cache-Control": "no-store, must-revalidate, no-cache",
"Date": "Mon, 01 Aug 2022 19:55:52 GMT",
"Content-Type": "application/json; odata.metadata=minimal; odata.streaming=true"
},
"effectiveIntegrationRuntime": "AutoResolveIntegrationRuntime (West Europe)",
"executionDuration": 0,
"durationInQueue": {
"integrationRuntimeQueue": 0
},
"billingReference": {
"activityType": "ExternalActivity",
"billableDuration": [
{
"meterType": "AzureIR",
"duration": 0.016666666666666666,
"unit": "Hours"
}
]
}
}

po-wei
Employee

post - What are the differences between application/json and application/x-www-form-urlencoded? - St...

Thanks for your info.

My manager and I have looked at this case together. We suspect that this is due to application/x-www-form-urlencoded. Could you change it to application/json?

From backend log, we see that the request boday is not detected and thus it's interpreted as viaApi request. And we suspected it's due to above problem.

Could you help test it?

We would discuss internally about how to make it more user-friendly after confirming it's the root cause.

Thanks,

Po-wei

Anonymous
Not applicable

Hi Po-wei,

 

thank you so much for investigating the issue, now after that I changed the application/x-www-form-urlencoded to the application/json, I do see in the the reponse: refresh type: viaenhancedapi and status completed,

but the data was not being refrehed, the change I made in the database was not reflected in the dataset at all.

I made change in the table I specified in the body but the change was not seen in the dataset.

{
    "@odata.context": "http://wabi-north-europe-g-primary-redirect.analysis.windows.net/v1.0/myorg/groups/XXXXXXXXXXXXXXXX/...,
    "value": [
        {
            "requestId": "a27a095d-7cf6-44f1-a132-81fd32ab5ef8",
            "id": 386879774,
            "refreshType": "ViaEnhancedApi",
            "startTime": "2022-08-09T08:33:05.427Z",
            "endTime": "2022-08-09T08:34:05.347Z",
            "status": "Completed",
            "extendedStatus": "Completed"
        }
    ],
    "ADFWebActivityResponseHeaders": {
        "Pragma": "no-cache",
        "Transfer-Encoding": "chunked",
        "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
        "X-Frame-Options": "deny",
        "X-Content-Type-Options": "nosniff",
        "RequestId": "3e47784a-d439-4bc6-9db1-f099400cade2",
        "OData-Version": "4.0",
        "Access-Control-Expose-Headers": "RequestId",
        "request-redirected": "true",
        "home-cluster-uri": "https://wabi-north-europe-g-primary-redirect.analysis.windows.net/",
        "Cache-Control": "no-store, must-revalidate, no-cache",
        "Date": "Tue, 09 Aug 2022 08:35:11 GMT",
        "Content-Type": "application/json; odata.metadata=minimal; odata.streaming=true"
    },
    "effectiveIntegrationRuntime": "AutoResolveIntegrationRuntime (West Europe)",
    "executionDuration": 0,
    "durationInQueue": {
        "integrationRuntimeQueue": 0
    },
    "billingReference": {
        "activityType": "ExternalActivity",
        "billableDuration": [
            {
                "meterType": "AzureIR",
                "duration": 0.016666666666666666,
                "unit": "Hours"
            }
        ]
    }
}

 

Is it because I'm triggering it in Data factory using Web activity?

 

Thank you very much in advance