Closed ctimoftey closed 2 years ago
Could your share the debug logs of both the runs?
Hi Maik This is the partial log only for the update parameter action when in json I have "SomeServerInstance\\ServerNamexxx" (with double backslash)
Done processing Power BI Actions
Finishing: Update parameter for Report
Hi Maik When I have in my json "SomeServerInstance\ServerNamexxx" (with one backslash) it fails even before your action (it fails at my action when I I parse the json from my config in the repo) error bellow
ConvertFrom-Json : Unrecognized escape sequence. (253): {
I think that is because the \ is a escape token on json try to do \
Hi Maik, If I only use one backslash in my workspaceconfig.json file then at my parsing phase I get error (that is before your actions): ConvertFrom-Json : Unrecognized escape sequence. (253)
If I use 2 backslashes in my workspaceconfig.json file then all the actions are good without errors but the parameters are not updated...
Hi Maik, Before your actions when I parse my workspaceconfig.json here is the value from parsed json only for the parameters section: @{name=sqlserver; newValue=SomeServerInstance\Someinstance_name}
But then I need to convert this back to json and compress it Here is the new paramerter back to json and compresses {"name":"sqlserver","newValue":"SomeServerInstance\\Someinstance_name"}
This will fail since there is no such instance with double backslahs
Hi Maik I even hardcoded the json value inside your action:
(single blackslash for the sql parameter)
It will fail saying : ##[error]Supplied json is not in the correct format
Hi Maik,
Here are the debug logs for both
Error system.debug=true when using double backslash with hardcoded json value inside your action:
2022-07-21T02:29:06.6545655Z Done processing Power BI Actions
2022-07-21T02:29:06.6657690Z ##[debug]Caught exception from task script.
2022-07-21T02:29:06.6696264Z ##[debug]Error record:
2022-07-21T02:29:06.7539225Z ##[debug]Invoke-API : BadRequest
2022-07-21T02:29:06.7599250Z ##[debug]At D:\a_tasks\PowerBIActions_d5b7fec6-2b25-4742-905b-0dad97687df5\5.4.38\ps_modules\PowerBI\PowerBI.psm1:238 char:9
2022-07-21T02:29:06.7640287Z ##[debug]+ Invoke-API -Url $url -Method "Post" -Body $body -ContentType ...
2022-07-21T02:29:06.7641237Z ##[debug]+ ~~~~~~~~~~~~~
2022-07-21T02:29:06.7642829Z ##[debug] + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
2022-07-21T02:29:06.7658820Z ##[debug] + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-API
2022-07-21T02:29:06.7675685Z ##[debug]
2022-07-21T02:29:06.7702071Z ##[debug]Script stack trace:
2022-07-21T02:29:06.7776892Z ##[debug]at Invoke-API, D:\a_tasks\PowerBIActions_d5b7fec6-2b25-4742-905b-0dad97687df5\5.4.38\ps_modules\PowerBI\PowerBI.psm1: line 307
2022-07-21T02:29:06.7808287Z ##[debug]at Update-PowerBIDatasetParameter, D:\a_tasks\PowerBIActions_d5b7fec6-2b25-4742-905b-0dad97687df5\5.4.38\ps_modules\PowerBI\PowerBI.psm1: line 238
2022-07-21T02:29:06.7824277Z ##[debug]at Update-PowerBIDatasetParameters, D:\a_tasks\PowerBIActions_d5b7fec6-2b25-4742-905b-0dad97687df5\5.4.38\ps_modules\PowerBI\PowerBI.psm1: line 256
2022-07-21T02:29:06.7882187Z ##[debug]at
Error system.debug=true when using single backslash hardcoded json value inside your action:
2022-07-21T02:34:03.5782269Z Done processing Power BI Actions
2022-07-21T02:34:03.5868796Z ##[debug]Caught exception from task script.
2022-07-21T02:34:03.5910056Z ##[debug]Error record:
2022-07-21T02:34:03.6655639Z ##[debug]D:\a_tasks\PowerBIActions_d5b7fec6-2b25-4742-905b-0dad97687df5\5.4.38\run.ps1 : Supplied json is not in the correct format!
2022-07-21T02:34:03.6675742Z ##[debug]At line:1 char:1
2022-07-21T02:34:03.6690607Z ##[debug]+ . 'D:\a_tasks\PowerBIActions_d5b7fec6-2b25-4742-905b-0dad97687df5\5. ...
2022-07-21T02:34:03.6705675Z ##[debug]+ ~~~~~~~~~~~~~~~~~
2022-07-21T02:34:03.6720665Z ##[debug] + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
2022-07-21T02:34:03.6735863Z ##[debug] + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,run.ps1
2022-07-21T02:34:03.6752230Z ##[debug]
2022-07-21T02:34:03.6772735Z ##[debug]Script stack trace:
2022-07-21T02:34:03.6873869Z ##[debug]at
Thanks, will investigate further when I am back holiday. Are you using a datagateway in between?
Hi Maik Yes we have gateway because our SQL and Oracle are on premise Your PowerBi Action to update parameter works perfect for Oracle dataset but for SQL we have this issue because of the databaseserver\instance (the backslash escape issue)
Thank you G
Hi Maik, You can close this issue So yes we have gateway and if we use databaseserver\\\\instance then the update paramter action works TY G
I close this issue as it seems I found the solution
Thanks for the update
Describe the issue Hi Maik, I have issue with your update parameter action. Example our sql instance and db contains "\" {"name":"sqlserver","newValue":"SomeServerInstance\\ServerNamexxx"} so if I pass this valid json PowerBIActions@5 update parameter action this will fail throwing error "Bad request" because our sql server instance is SomeServerInstance\ServerNamexxx
If I pass the this json {"name":"sqlserver","newValue":"SomeServerInstance\ServerNamexxx"} it will fail because is not well formatted
[error]Supplied json is not in the correct format!
Extension
To Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
Situation (please complete the following information):
Log info Please add the log file of the agent in debug mode [Add the variable system.debug with the value 'true ' to your pipeline]
Additional information Add any other context about the problem here.