maikvandergaag / msft-extensions

Repository for extensions mainly used for Azure DevOps Extensions
https://msftplayground.com
MIT License
125 stars 80 forks source link

Update Parameters: cannot get it to work (invalid request) #561

Closed intellimade closed 1 month ago

intellimade commented 2 months ago

I cannot get the Update Parameters to work somehow. The other extensions are working fine, like refreshing a dataset in the same workspace. But updating the parameters is showing a Invalid Request as result.

I am running on 5.4.54

This is the YAML code:

`
trigger: 
  branches:
    include:
      - main

variables:
 - name: System.Debug
   value: true

pool:
  vmimage: 'windows-latest'

- task: PowerBIActions@5
  inputs:
    PowerBIServiceEndpoint: 'Power BI omgeving'
    Action: 'UpdateParameters'
    WorkspaceName: 'xxx - Versiebeheer Productie'
    DatasetName: 'test'
    ParameterInput: '[{"name":"ServerNaam","newValue":"DWHPRD"}]'
`

I expect the parameter "ServerNaam" to change from DWHONT to DWHPRD. The dataset itself can be changed via the same extension "resfresh dataset", so I don't think it is a permissions issue.

I am using agent type Windows Latest The log file is included.

The question: can you help me identify the issue? When resolved, i will put the solution here, since I see other issues which are created but where the solution isn't stated unfortunately. The extension is really helpfull, so hopefully we can get it to work.

powerbiactions_logs.zip

maikvandergaag commented 2 months ago

Could you for testing purposes update the input to only single quotes by escaping them?

intellimade commented 2 months ago

Thanks for getting back Maik. I tried all kind of quoting/escaping, but either the pipeline syntax is invalid, or the json input when running the extensions is invalid.

F.e; I tried \"[{'name':'ServerNaam','newValue':'DWHPRD'}]\"

But it says "Supplied json is not in the correct format!" Can you point me in the right direction?

maikvandergaag commented 2 months ago

Would you be able to try the powershell method? Maybe you will get more insights in what is going wrong.

intellimade commented 1 month ago

It seemed that the SP that was running the code wasn't the owner of the dataset. Therefore, if you want to alter the dataset (like edit the paramater), you have to first take over the dataset, and then run the script.