microsoft / navcontainerhelper

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

Azure pipeline fails to download file: https://github.com/microsoft/navcontainerhelper/archive/dev.zip #3147

Closed dkiehl closed 1 year ago

dkiehl commented 1 year ago

PLEASE DO NOT INCLUDE ANY PASSWORDS OR TOKENS IN YOUR ISSUE!!!

Describe the issue When running our pipeline that we have been using for years, we are now getting an error trying to download a file from the microsoft gethub link in the title.

Full output of scripts

Starting: Run Pipeline
==============================================================================
Task         : PowerShell
Description  : Run a PowerShell script on Linux, macOS, or Windows
Version      : 2.220.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
==============================================================================
Generating script.
Formatted command: . 'C:\agent\_work1\1\s\scripts\DevOps-Pipeline.ps1' -environment "AzureDevOps" -version "v19" -appBuild 1101 -appRevision 0
========================== Starting Command Output ===========================
"C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'C:\agent\_work1\_temp\0e19bac3-###-27ffea3c5782.ps1'"
Set artifact = https://bcartifacts.azureedge.net/sandbox/19.5.36567.47252/us
Set pipelineName = DEVOPSBUILD-v19
Set containerName = itadocker01-devopsbuild-v19
Set installApps = '[https://itadevopsstorage.blob.core.windows.net/build-files/Build-Settings/#####]'
Set installTestApps = ''
Set previousApps = 'https://businesscentralapps.blob.core.windows.net/githubhelloworld/latest/apps.zip'
Set appSourceCopMandatoryAffixes = ''
Set appSourceCopSupportedCountries = ''
Set appFolders = '#####'
Set testFolders = 'test'
Set memoryLimit = '10G'
Set additionalCountries = ''
Set genericImageName = ''
Set vaultNameForLocal = 'BuildVariables'
Set bcContainerHelperVersion = 'dev'
Set installTestRunner = True
Set installTestFramework = False
Set installTestLibraries = True
Set installPerformanceToolkit = False
Set enableCodeCop = False
Set enableAppSourceCop = False
Set enablePerTenantExtensionCop = False
Set enableUICop = False
Set doNotSignApps = True
Set doNotRunTests = False
Set cacheImage = False
Set CreateRuntimePackages = True
Downloading https://github.com/microsoft/navcontainerhelper/archive/dev.zip
##[error]C:\agent\_work1\1\s\scripts\DevOps-Pipeline.ps1 : Exception calling "DownloadFile" with "2" argument(s): "The remote 
server returned an error: (404) Not Found."
At C:\agent\_work1\_temp\0e19bac3-5822-4206-a992-27ffea3c5782.ps1:4 char:1
+ . 'C:\agent\_work1\1\s\scripts\DevOps-Pipeline.ps1' -environment "Azu ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [DevOps-Pipeline.ps1], MethodInvocationException
    + FullyQualifiedErrorId : WebException,DevOps-Pipeline.ps1
##[error]PowerShell exited with code '1'.
Finishing: Run Pipeline

Additional context

freddydk commented 1 year ago

Your bcContainerHelperVersion is set to dev, which means that you try to download the dev branch from github. That branch was deleted (as it was no longer being updated). Not sure what version of the scripts you have, but maybe change that to latest?

dannoe commented 1 year ago

He is probably using https://github.com/BusinessCentralApps/Old.HelloWorld/blob/master/scripts/Install-BcContainerHelper.ps1 (so do we)

Just replace line 7 inside Install-BcContainerHelper.ps1 with this:

if ($bccontainerHelperVersion -eq "dev") { $bccontainerHelperVersion = "https://bccontainerhelper.blob.core.windows.net/public/preview.zip" }
dkiehl commented 1 year ago

Thanks so much - the line 7 fix resolved the issue.