question

PhilipORourke-7866 avatar image
0 Votes"
PhilipORourke-7866 asked PhilipORourke-7866 answered

dynamic workspace name and dataset name on logicapps call for powerbi dataset refresh from azure data factory

Hi,

Have created a logic app which allows us to call power bi dataset refresh at end of pipeline via the web activity pipeline.

However, this logic app has the name of the dataset and workspace - is it possible to pass these as parameters somehow in the web activity to the logic app and have the logic app pick up the parameter names and do you have an example of this?

Thanks

azure-data-factory
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

NandanHegde-7720 avatar image
0 Votes"
NandanHegde-7720 answered PhilipORourke-7866 commented

Hey,
The below blog :
medium.com/analytics-vidhya/passing-the-dynamic-parameter-from-azure-data-factory-to-logic-apps-e2f35eb4846f

explains how to pass parameters via ADF to logic apps.

NOte: You can refresh powerbi directly via ADF as well rather than going the route of logic app :
https://datasavvy.me/2020/07/09/refreshing-a-power-bi-dataset-in-azure-data-factory/

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,

Thanks for info.

One of the links referred to in the blog saying url not available anymore

http://thelearnguru.com/passing-the-dynamic-parameters-from-azure-data-factory-to-logic-apps/

looks like refers to e-mail action

How can we set up parameters in the logic app for the power bi e.g. is there some josn we can past in at the logic app end and woudl this be pasted into the http reuqester part to enable them to be referred to in the action part?

Thanks

197350-image.png


0 Votes 0 ·
image.png (11.5 KiB)

Hi,

For info managed to set parameters in the logic app but get message 401 in the refresh power bi dataset action.

I just pasted below into json body of the http request in the workflow and this then allows us to refer to the two parameters Workspace and Dataset
and can pass in these as parameters in the body of the json in the web activity

{
"properties": {
"Dataset": {
"type": "string"
},
"Workspace": {
"type": "string"
}
},
"type": "object"
}

However if don't try pass parameters dynamically and just set manually in the logic app from dropdown list works o.k. on same report.



Can see it triggered and passing in 2 parameters Workspace and Dataset but says 401 unauthorized.



If I set up a workflow where the Workspace and Dataset are simply select in the logic app as opposed to being passed as parameters then it works o.k on same dataset.



Why an I getting 401 unauthorized message when try and pass the Workspace and Dataset as parameters bit not when select in the workflow manually and how can we resolve this to allow the refresh with dynamic workspace and dataset being passed from azure data factory.



Thanks
Thanks

0 Votes 0 ·
PhilipORourke-7866 avatar image
0 Votes"
PhilipORourke-7866 answered

Hi,

Managed to get this working but had to pass workspace and dataset as guids as when passed as names for some reason said unauthorized 401.

Any idea why this would be case as admin user and can refresh dataset fine when pass as guids.

Notice the json shows the guids - any way of either translating names passed as parameters to guids in the logic app or in adf getting the guids for the workspace and dataset of a power bi report


{
"inputs": {
"host": {
"connection": {
"referenceName": "powerbi"
}
},
"method": "post",
"path": "/v1.0/myorg/groups/@{encodeURIComponent('75086179-c3e5-4263-97b5-68017e40a4bd')}/datasets/@{encodeURIComponent('a2ae32f4-bc20-4099-88c3-499062ad0823')}/refreshes",
"queries": {
"pbi_source": "powerAutomate"
}
}
}

Thanks

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.