I'm having trouble getting a release pipeline to deploy an *.app artifact of a compiled extension to my sandbox environment.
2022-08-28T19:02:31.0302796Z ##[sectionStarting: PowerShell Script
2022-08-28T19:02:31.0470082Z ==============================================================================
2022-08-28T19:02:31.0470473Z Task : PowerShell
2022-08-28T19:02:31.0470757Z Description : Run a PowerShell script on Linux, macOS, or Windows
2022-08-28T19:02:31.0471037Z Version : 2.200.0
2022-08-28T19:02:31.0471512Z Author : Microsoft Corporation
2022-08-28T19:02:31.0472243Z ==============================================================================
2022-08-28T19:02:32.1938120Z Generating script.
2022-08-28T19:02:32.2421513Z ========================== Starting Command Output ===========================
2022-08-28T19:02:32.2704996Z ##[command"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'C:\agent\_work\_temp\50730114-9920-4770-9ecb-6599b0954225.ps1'"
2022-08-28T19:02:32.5930405Z Installing BcContainerHelper
2022-08-28T19:02:50.6303516Z Publishing to tenant
2022-08-28T19:02:50.7696266Z BcContainerHelper version 4.0.0-preview690
2022-08-28T19:02:50.9523925Z BcContainerHelper emits usage statistics telemetry to Microsoft
2022-08-28T19:02:53.1242868Z Attempting authentication to api.businesscentral.dynamics.com/.default using clientCredentials...
2022-08-28T19:02:53.9976289Z Authenticated as app ***
2022-08-28T19:02:54.9299813Z ERROR The remote server returned an error: (401) Unauthorized.
2022-08-28T19:02:56.0618857Z Publish-PerTenantExtensionApps Telemetry Correlation Id: a5731c25-f19e-4fb7-b12f-d2c154eb43a7
2022-08-28T19:02:56.1212074Z The remote server returned an error: (401) Unauthorized. {
2022-08-28T19:02:56.1213591Z "error": {
2022-08-28T19:02:56.1215402Z "code": "Authentication_InvalidCredentials",
2022-08-28T19:02:56.1217061Z "message": "The server has rejected the client credentials."
2022-08-28T19:02:56.1218096Z }
2022-08-28T19:02:56.1218948Z } (ms-correlation-x = a4a04857-2056-48c8-a2b1-28780a48b210)
2022-08-28T19:02:56.1220334Z At C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\4.0.0\BcSaaS\Publish-PerTenantExtensionApps.ps1:163
2022-08-28T19:02:56.1221388Z char:9
2022-08-28T19:02:56.1222678Z throw (GetExtendedErrorMessage $_)
2022-08-28T19:02:56.1224246Z ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2022-08-28T19:02:56.1225419Z CategoryInfo : OperationStopped: (The remote serv...1-28780a48b210):String) [, RuntimeException
2022-08-28T19:02:56.1226861Z FullyQualifiedErrorId : The remote server returned an error: (401) Unauthorized. {
2022-08-28T19:02:56.1229086Z "error": {
2022-08-28T19:02:56.1230192Z "code": "Authentication_InvalidCredentials",
2022-08-28T19:02:56.1232679Z "message": "The server has rejected the client credentials."
2022-08-28T19:02:56.1234951Z }
2022-08-28T19:02:56.1235981Z } (ms-correlation-x = a4a04857-2056-48c8-a2b1-28780a48b210)
2022-08-28T19:02:56.1237015Z
2022-08-28T19:02:56.3124270Z ##[errorPowerShell exited with code '1'.
2022-08-28T19:02:56.3597106Z ##[sectionFinishing: PowerShell Script
According to the tutorial, the pipeline only needs the authorization of BC to allow third party applications to login and install extensions. And that's done through Azure Active Directory.
Maybe I have to provide user credentials? idk
Here's the script that the release pipeline runs:
Write-Host "Installing BcContainerHelper"
Install-Module BcContainerHelper -Force -AllowPrerelease
Write-Host "Publishing to tenant"
Publish-PerTenantExtensionApps -useNewLine `
-ClientID "$(PublisherAppClientID)" `
-ClientSecret "$(MyThesisAppPublisherSecret)" `
-tenantId "$(TenantId)" `
-environment "$(Environment)" `
-companyName "$(CompanyName)" `
-appFiles @(Get-Item "_ALOps Thesis\ALOps Thesis/*.app" | % { $_.FullName })
The secrets are all correct, if I change them the pipeline doesnt go as far, so I'm all out of ideas of how to solve this.