maikvandergaag / msft-extensions

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

Power Bi actions: update SQL credentials #510

Closed dariuszbz closed 8 months ago

dariuszbz commented 11 months ago

Scope: Organization

it shows an error:

2023-10-12T13:26:26.1548759Z ##[debug]Caught exception from task script. 2023-10-12T13:26:26.1582841Z ##[debug]Error record: 2023-10-12T13:26:26.2143700Z ##[debug]Invoke-PowerBIRestMethod : One or more errors occurred. 2023-10-12T13:26:26.2156046Z ##[debug]At D:\a_tasks\PowerBIActions_d5b7fec6-2b25-4742-905b-0dad97687df5\5.4.44\ps_modules\PowerBI\PowerBI.psm1:1060 char:13 2023-10-12T13:26:26.2167319Z ##[debug]+ Invoke-PowerBIRestMethod -Url $ApiUrl -Method Patch -Body ... 2023-10-12T13:26:26.2179055Z ##[debug]+ ~~~~~~~~~~~~~ 2023-10-12T13:26:26.2190568Z ##[debug] + CategoryInfo : WriteError: (Microsoft.Power...werBIRestMethod:InvokePowerBIRestMethod) [Invoke-PowerBIR estMethod], AggregateException 2023-10-12T13:26:26.2202007Z ##[debug] + FullyQualifiedErrorId : One or more errors occurred.,Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod 2023-10-12T13:26:26.2213266Z ##[debug] 2023-10-12T13:26:26.2231485Z ##[debug]Script stack trace: 2023-10-12T13:26:26.2263503Z ##[debug]at Update-BasicSQLDataSourceCredentials, D:\a_tasks\PowerBIActions_d5b7fec6-2b25-4742-905b-0dad97687df5\5.4.44\ps_modules\PowerBI\PowerBI.psm1: line 1060 2023-10-12T13:26:26.2275228Z ##[debug]at , D:\a_tasks\PowerBIActions_d5b7fec6-2b25-4742-905b-0dad97687df5\5.4.44\run.ps1: line 189 2023-10-12T13:26:26.2286588Z ##[debug]at , : line 1 2023-10-12T13:26:26.2297950Z ##[debug]at , : line 22 2023-10-12T13:26:26.2309373Z ##[debug]at , : line 18 2023-10-12T13:26:26.2320610Z ##[debug]at , : line 1 2023-10-12T13:26:26.2337891Z ##[debug]Exception: 2023-10-12T13:26:26.2988261Z ##[debug]System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request). 2023-10-12T13:26:26.3000004Z ##[debug] at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() 2023-10-12T13:26:26.3013269Z ##[debug] at Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod.d35.MoveNext() 2023-10-12T13:26:26.3024624Z ##[debug] --- End of inner exception stack trace --- 2023-10-12T13:26:26.3037450Z ##[debug] at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) 2023-10-12T13:26:26.3048815Z ##[debug] at Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod.ExecuteCmdlet() 2023-10-12T13:26:26.3061467Z ##[debug] at Microsoft.PowerBI.Commands.Common.PowerBICmdlet.ProcessRecord() 2023-10-12T13:26:26.3072908Z ##[debug]---> (Inner Exception #0) System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request). 2023-10-12T13:26:26.3084302Z ##[debug] at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() 2023-10-12T13:26:26.3095719Z ##[debug] at Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod.d35.MoveNext()<--- 2023-10-12T13:26:26.3106924Z ##[debug]

dariuszbz commented 11 months ago

This is what need to be done in terms of SQL on prem via data-gateway: https://endjin.com/blog/2020/12/how-to-update-credentials-for-an-on-prem-power-bi-data-source-using-powershell. Hello of a work, but it works. I have my script, plus your tooling and my PowerBi automation works. Thanks chaps.

maikvandergaag commented 11 months ago

What kind of authentication mechanism are you using within the Power BI Actions extension?

maikvandergaag commented 8 months ago

Closing this issue due to no response