Closed romosandarius closed 2 years ago
Hi,
The extension it self has some checks on existing parameters and then extends it. Could you tell me with what you are doing the action via the task en manually.
Besides that are you running on a hosted agent?
Hi,
Our flow looks like:
We are running on a hosted agent (windows-latest).
Is it done my a service principal or user account
We are using a service principal. We've followed the instructions from Azure docs to set it up: https://docs.microsoft.com/en-us/power-bi/admin/service-premium-service-principal
The test with what account did you perform that?
I used my own account to test from https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/update-parameters-in-group
Ok, then there can be a difference for what the Service Principal can do and what you user account can do. Did you try to perform the powershell scripts locally?
No, I haven't. I'll give it a go and write back tomorrow.
I managed to run the code locally after a few edits in the scripts and now it fails at the step before doing the POST to Default.UpdateParameters. The GET on .../parameters fails with InvalidRequest.
@romosandarius I had the same issue and wanted to comment here to get an answer as well. But I figured it out in the meantime.
Two issues blocked it for me:
Providing Ownership of the datasets in the workspace to the service principal + changing the parameter to a text value without any lists behind it made it work for me.
@TimEllens, thank you for sharing the info! It actually worked as you suggested where I managed to update the parameters with the following two actions:
displayName: 'Taking dataset ownership'
inputs:
PowerBIServiceEndpoint: 'bcea-dp-svcPowerBI-dev'
Action: 'TakeOwnership'
WorkspaceName: '$(workspace_dev)'
DatasetName: 'Client Value and Volume'
- task: PowerBIActions@5
displayName: 'Updating parameters for Client Value and Volumne'
inputs:
PowerBIServiceEndpoint: 'bcea-dp-svcPowerBI-dev'
Action: 'UpdateParameters'
WorkspaceName: '$(workspace_dev)'
DatasetName: "Client Value and Volume"
ParameterInput: "{'name':'server_host_name', 'newValue':'adb2'}"
The challenge is though that we have another ongoing issue where we need a normal Active Directory user (irrespective of MFA setup) to own the dataset, otherwise we're hit by the below error:
@maikvandergaag, do you have any ideas why we cannot update the parameters even though the service principal is Admin on the dataset's workspace?
Not sure, then we would have to dive deeper into your specific request. @mattias-de-coninck: do you have an idea
@romosandarius could you perhaps show us what the Show Details link points to?
@mattias-de-coninck , it points to the front page of the PowerBI service so there's no useful information, unfortunately.
We've been working on implementing the UpdateParameters task and it returns InvalidRequest. So either we are configuring it incorrectly or there is a bug in it. Can anyone help?
Below you can see our yaml definition:
When we run the task, we get the following after enabling system.debug=true and obfuscating the group and dataset ID.
If we take the same json payload and run on the PowerBI REST API documentation page, it succeeds with return code 200: Link: https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/update-parameters-in-group
And then the parameter is updated: