microsoft / navcontainerhelper

Official Microsoft repository for BcContainerHelper, a PowerShell module, which makes it easier to work with Business Central Containers on Docker.
MIT License
386 stars 247 forks source link

Publish-PerTenantExtensionApps failing using the Prerelise module #2861

Closed eclipses closed 1 year ago

eclipses commented 1 year ago

DevOps Release Pipeline failing when using -AllowPrerelease, removing it same script works correctly. I wanted just to inform you about a possible breaking change introduced receintly.

Scripts used to create container and cause the issue

Write-Host "Installing BcContainerHelper"
Install-Module BcContainerHelper -Force -AllowPrerelease

Write-Host "Publishing to tenant"
Publish-PerTenantExtensionApps -useNewLine `
 -ClientID "$(PublisherAppClientID)" `
 -ClientSecret "$(PublisherAppClientSecret)" `
 -tenantId "$(TenantId)" `
 -environment "$(Environment)" `
 -companyName "$(CompanyName)" `
 -appFiles @(Get-Item "Artifacts/output/Apps/*.app" | % { $_.FullName })

Error

 Publish-PerTenantExtensionApps Telemetry Correlation Id: 39e1e7f6-6667-4788-b871-b38fe62dfc94
ForEach-Object : Cannot convert value "1 1 1.0 0 0.2 1 0.0 0 0" to type "System.Version". Error: "Input string was not 
in a correct format."
At C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\4.0.11\Saas\Publish-PerTenantExtensionApps.ps1:116 
char:63
+ ...    Sort-AppFilesByDependencies -appFiles $appFiles | ForEach-Object {
+                                                          ~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidArgument: (:) [ForEach-Object], RuntimeException
+ FullyQualifiedErrorId : InvalidCastParseTargetInvocation,Microsoft.PowerShell.Commands.ForEachObjectCommand...
freddydk commented 1 year ago

Right before it fails, it shows a list of installed extensions - could you copy/paste that here or email it to me? Thanks

eclipses commented 1 year ago

` 2023-01-18T11:24:26.8298133Z ##[section]Starting: PowerShell Script 2023-01-18T11:24:26.8511296Z ============================================================================== 2023-01-18T11:24:26.8511596Z Task : PowerShell 2023-01-18T11:24:26.8511722Z Description : Run a PowerShell script on Linux, macOS, or Windows 2023-01-18T11:24:26.8511938Z Version : 2.212.0 2023-01-18T11:24:26.8512059Z Author : Microsoft Corporation 2023-01-18T11:24:26.8512204Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell 2023-01-18T11:24:26.8512417Z ============================================================================== 2023-01-18T11:24:28.7878767Z Generating script. 2023-01-18T11:24:28.8611972Z ========================== Starting Command Output =========================== 2023-01-18T11:24:28.8917471Z ##[command]"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'D:\a_temp\5d2b2984-2437-4336-9f35-af255c1dba5b.ps1'" 2023-01-18T11:24:29.2836723Z Installing BcContainerHelper 2023-01-18T11:25:54.1348425Z Publishing to tenant 2023-01-18T11:25:54.3854056Z BcContainerHelper version 4.0.11-preview855 2023-01-18T11:25:54.5919045Z BC.HelperFunctions emits usage statistics telemetry to Microsoft 2023-01-18T11:25:57.5293489Z Attempting authentication to https://api.businesscentral.dynamics.com/.default using clientCredentials... 2023-01-18T11:25:57.7439304Z Authenticated as app db50f64d-5085-45e8-aabd-2e9511761c16 2023-01-18T11:25:58.0736546Z Company has id f5600a1b-df3a-ed11-bbab-000d3a38ed97 2023-01-18T11:25:58.4499110Z Extensions before: 2023-01-18T11:25:58.4596360Z - AMC Banking 365 Fundamentals, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.4643352Z - API Reports - Finance, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.4660821Z - Application, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.4681909Z - Base Application, Version 21.2.49946.52011, Installed=True 2023-01-18T11:25:58.4692940Z - Business Central Cloud Migration - Previous Release, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.4742547Z - Business Central Cloud Migration API, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.4743714Z - Business Central Intelligent Cloud, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.4744563Z - Company Hub, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.4751079Z - Contoso Coffee Demo Dataset, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.4764824Z - Contoso Coffee Demo Dataset (GB), Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.4780028Z - Data Archive, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.4794032Z - Data Search, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.4808322Z - Dynamics GP History SmartLists, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.4823205Z - Dynamics GP Intelligent Cloud, Version 21.2.49946.51746, Installed=True 2023-01-18T11:25:58.4843912Z - CUSTOM Base App, Version 1.0.2.0, Installed=True 2023-01-18T11:25:58.4854240Z - CUSTOM Base App, Version 1.0.1.0, Installed=False 2023-01-18T11:25:58.4870513Z - CUSTOM Base App, Version 1.0.0.0, Installed=False 2023-01-18T11:25:58.4885134Z - Email - Current User Connector, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.4900824Z - Email - Microsoft 365 Connector, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.4941428Z - Email - Outlook REST API, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.4955790Z - Email - SMTP API, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.4971082Z - Email - SMTP Connector, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.4986506Z - Essential Business Headlines, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.5001429Z - GetAddress.io UK Postcodes, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.5016408Z - Image Analyzer, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.5031403Z - Import of QuickBooks Payroll Files, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.5073763Z - Intelligent Cloud Base, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.5090139Z - Late Payment Prediction, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.5134239Z - Making Tax Digital Localization for United Kingdom, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.5148268Z - Migration of QuickBooks Data, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.5165335Z - Payment Links to PayPal, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.5183602Z - Recommended Apps, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.5199008Z - Sales and Inventory Forecast, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.5213666Z - Send remittance advice by email, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.5228572Z - Send To Email Printer, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.5238278Z - Shopify Connector, Version 21.2.49946.50546, Installed=True 2023-01-18T11:25:58.5253228Z - Simplified Bank Statement Import, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.5267018Z - System Application, Version 21.2.49946.52050, Installed=True 2023-01-18T11:25:58.5284747Z - Troubleshoot FA Ledger Entries, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.5298438Z - Universal Print Integration, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.5308542Z - VAT Group Management, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.5324766Z - WorldPay Payments Standard, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:58.5331303Z 2023-01-18T11:25:59.6640231Z KPMG_CUSTOM Base App_1.0.3.0.app - 2023-01-18T11:25:59.6688246Z Extensions after: 2023-01-18T11:25:59.6720405Z - AMC Banking 365 Fundamentals, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.6744132Z - API Reports - Finance, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.6764403Z - Application, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.6783948Z - Base Application, Version 21.2.49946.52011, Installed=True 2023-01-18T11:25:59.6863176Z - Business Central Cloud Migration - Previous Release, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.6880859Z - Business Central Cloud Migration API, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.6897798Z - Business Central Intelligent Cloud, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.6916861Z - Company Hub, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.6935495Z - Contoso Coffee Demo Dataset, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.6951915Z - Contoso Coffee Demo Dataset (GB), Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.6967357Z - Data Archive, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.6983383Z - Data Search, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.6998888Z - Dynamics GP History SmartLists, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.7014103Z - Dynamics GP Intelligent Cloud, Version 21.2.49946.51746, Installed=True 2023-01-18T11:25:59.7030741Z - CUSTOM Base App, Version 1.0.2.0, Installed=True 2023-01-18T11:25:59.7048133Z - CUSTOM Base App, Version 1.0.1.0, Installed=False 2023-01-18T11:25:59.7065375Z - CUSTOM Base App, Version 1.0.0.0, Installed=False 2023-01-18T11:25:59.7081277Z - Email - Current User Connector, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.7096689Z - Email - Microsoft 365 Connector, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.7112112Z - Email - Outlook REST API, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.7211978Z - Email - SMTP API, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.7213116Z - Email - SMTP Connector, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.7214943Z - Essential Business Headlines, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.7215669Z - GetAddress.io UK Postcodes, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.7216297Z - Image Analyzer, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.7216932Z - Import of QuickBooks Payroll Files, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.7218626Z - Intelligent Cloud Base, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.7234744Z - Late Payment Prediction, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.7250770Z - Making Tax Digital Localization for United Kingdom, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.7277531Z - Migration of QuickBooks Data, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.7294597Z - Payment Links to PayPal, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.7310498Z - Recommended Apps, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.7327151Z - Sales and Inventory Forecast, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.7342319Z - Send remittance advice by email, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.7365806Z - Send To Email Printer, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.7408766Z - Shopify Connector, Version 21.2.49946.50546, Installed=True 2023-01-18T11:25:59.7454605Z - Simplified Bank Statement Import, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.7494237Z - System Application, Version 21.2.49946.52050, Installed=True 2023-01-18T11:25:59.7512975Z - Troubleshoot FA Ledger Entries, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.7528571Z - Universal Print Integration, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.7544117Z - VAT Group Management, Version 21.2.49946.50300, Installed=True 2023-01-18T11:25:59.7559442Z - WorldPay Payments Standard, Version 21.2.49946.50300, Installed=True 2023-01-18T11:26:00.7233967Z Publish-PerTenantExtensionApps Telemetry Correlation Id: 39e1e7f6-6667-4788-b871-b38fe62dfc94 2023-01-18T11:26:00.7803087Z ForEach-Object : Cannot convert value "1 1 1.0 0 0.2 1 0.0 0 0" to type "System.Version". Error: "Input string was not 2023-01-18T11:26:00.7804019Z in a correct format." 2023-01-18T11:26:00.7805214Z At C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\4.0.11\Saas\Publish-PerTenantExtensionApps.ps1:116 2023-01-18T11:26:00.7805900Z char:63 2023-01-18T11:26:00.7806403Z + ... Sort-AppFilesByDependencies -appFiles $appFiles | ForEach-Object { 2023-01-18T11:26:00.7806899Z + ~~~~ 2023-01-18T11:26:00.7807443Z + CategoryInfo : InvalidArgument: (:) [ForEach-Object], RuntimeException 2023-01-18T11:26:00.7808213Z + FullyQualifiedErrorId : InvalidCastParseTargetInvocation,Microsoft.PowerShell.Commands.ForEachObjectCommand 2023-01-18T11:26:00.7808738Z
2023-01-18T11:26:00.9119367Z ##[error]PowerShell exited with code '1'. 2023-01-18T11:26:00.9526514Z ##[section]Finishing: PowerShell Script

`

freddydk commented 1 year ago

Thanks - got it

freddydk commented 1 year ago

This is fixed in prerelease now.

eclipses commented 1 year ago

I confirm that with the prerelease now the release works again. Thank you for the quick resolution

freddydk commented 1 year ago

Fixed in 4.0.14