Update 2021/2/10: BcContainerHelper has replaced NavContainerHelper. This blog post still reference NavContainerHelper, which is outdated.
As a follow up to this blog post (make sure you have read this first), this blog post will share some details about working with artifacts. How do you find them, what do they contain and what happens when you try to use them. It is primarily a list of the new functionality in NavContainerHelper for working with artifacts.
I will also provide a blog post later, which describes how to work with artifacts when using docker run (raw docker commands)
Get-BcArtifactUrl
Originally submitted by Waldo and slightly modified to fit the needs of everybody (hopefully). The parameters are:
- storageAccount (bcinsider or bcartifacts). The storage account determines where to get the artifacts. bcartifacts is the storage account, which contains all public artifacts with Business Central and NAV.
- type (onprem or sandbox) determines whether to get onprem artifacts (shipped builds) or sandbox artifacts (Saas builds). If you are looking for a build, which matches your saas version, you need to use sandbox.
- version (default is blank = all versions) is the version you are filtering for. You can specify a full version number or a partial version number. The function will try to match your request.
- country (default is blank = all countries) is the localization you are filtering for. Onprem countries follows onprem releases (na for north america), sandbox countries follows saas countries (us, ca and mx).Note that in 0.7.0.7 there is a bug, which returns the platform as a country. The platform cannot be used as a country:-(
- select (all, closest, secondToLastMajor or latest) determines which artifact urls you get.
- latest (which is the default) will return the latest image in the list
- all will return an array of all artifact urls matching the filter
- closest requires you to supply a full version number and the function will return the closest version (where Major and Minor version MUST match).
- secondToLastMajor is used in CI/CD scenarios to identify next minor release.
- sasToken is the shared access signature token to use when requesting artifacts from a secured storage account (like bcinsider).
try to run this PowerShell snippet and investigate the return values.
Write-Host -ForegroundColor Yellow "Get US sandbox artifact url for current version (Latest)" Get-BCArtifactUrl -country "us" Write-Host -ForegroundColor Yellow "Get all US sandbox artifact urls" Get-BCArtifactUrl -country "us" -select All Write-Host -ForegroundColor Yellow "Get US sandbox artifact url for a version closest to 16.2.13509.13700" Get-BCArtifactUrl -country "us" -version "16.2.13509.13700" -select Closest Write-Host -ForegroundColor Yellow "Get latest 16.1 US sandbox artifact url" Get-BCArtifactUrl -country "us" -version "16.1" Write-Host -ForegroundColor Yellow "Get latest 15.x US sandbox artifact url" Get-BCArtifactUrl -country "us" -version "15" Write-Host -ForegroundColor Yellow "Get all Danish NAV and Business Central artifact urls" Get-BCArtifactUrl -type OnPrem -country "dk" -select All
With Business Central, we do not use CU numbers, we use version numbers like 14.7, 15.4 and 16.2 and with this function you can easily find the versions available with a major, minor version.
Get-NavArtifactUrl
For people in need of a NAV 2016 – NAV 2018 artifact, these are also available. You can get NAV 2018 artifacts using Get-BcArtifactUrl with version 11.0 and type onprem – but all NAV 2018 artifacts with be versioned 11.0.<build>.0 and if you can remember the build number you will probably just use Get-BcArtifactUrl.
If you however need an artifact url for a specify CU, you can use Get-NavArtifactUrl, which has 4 parameters:
- nav (2016, 2017 or 2018) specifies which NAV version you want to find artifacts for.
- cu (can be rtm, cu1, cu2, cu3… or 0, 1, 2, 3) determines the cumulative update you need
- country (the localization you need, w1 is default).
- select (all, closest, secondToLastMajor or latest) determines which artifact urls you get – meaning of this parameter is the same as in Get-BcArtifactUrl.
a couple of examples in how to use Get-NavArtifactUrl:
Write-Host -ForegroundColor Yellow "Get all NAV 2017 DK artifact Urls" (Get-NavArtifactUrl -nav 2017 -country 'dk' -select all).count Write-Host -ForegroundColor Yellow "Get latest NA onprem artifact Url" Get-BCArtifactUrl -country "na" -type OnPrem
having the aritfact url, you can try to download it.
Download-Artifacts
Download-Artifacts is a function, which does exactly what the name describes: Downloads the artifacts pointed out by an artifact url.
The parameters are:
- artifactUrl is the artifact url returned by Get-BcArtifactUrl or Get-NavArtifactUrl
- includePlatform indicates whether you want to download the platform as well
- force indicates that you want to download the artifacts even though
- basePath (default c:\bcartifacts.cache)
You can see a sample of the command and the output here:
PS c:\temp> Download-Artifacts -artifactUrl (Get-BCArtifactUrl -country "us") -includePlatform Downloading application artifact /sandbox/16.2.13509.14082/us Downloading C:\Users\freddyk\AppData\Local\Temp\9f550271-a1c8-4125-96c5-2b781e2b9a3e.zip Unpacking application artifact c:\bcartifacts.cache\sandbox\16.2.13509.14082\us https://bcartifacts.azureedge.net/sandbox/16.2.13509.14082/platform Downloading platform artifact /sandbox/16.2.13509.14082/platform Downloading C:\Users\freddyk\AppData\Local\Temp\45959ba6-b934-470f-9603-8867135a3dcd.zip Unpacking platform artifact Downloading Prerequisite Components Downloading c:\bcartifacts.cache\sandbox\16.2.13509.14082\platform\Prerequisite Components\Open XML SDK 2.5 for Microsoft Office\OpenXMLSDKv25.msi Downloading c:\bcartifacts.cache\sandbox\16.2.13509.14082\platform\Prerequisite Components\Microsoft Report Viewer 2015\ReportViewer.msi Downloading c:\bcartifacts.cache\sandbox\16.2.13509.14082\platform\Prerequisite Components\IIS URL Rewrite Module\rewrite_2.0_rtw_x64.msi Downloading c:\bcartifacts.cache\sandbox\16.2.13509.14082\platform\Prerequisite Components\Microsoft Report Viewer 2015\SQLSysClrTypes.msi c:\bcartifacts.cache\sandbox\16.2.13509.14082\platform
It will download the artifacts and return the path. If you specify -includePlatform it will return two urls – if not, only one. Looking into the filesystem on the host, you will find the artifacts extracted in the bcartifacts.cache folder:

In the US folder you will find a manifest.json + all the things that are specific to the US application (database, applications, configuration packages etc.)
The manifest.json contains:
{ "version": "16.2.13509.14082", "platformUrl": "sandbox/16.2.13509.14082/platform", "licenseFile": "", "isBcSandbox": true, "country": "us", "platform": "16.0.13440.13997", "database": "database\\database.bak" }
In this specific sample, the cronus licensefile is already in the database and is not in the artifact. The platformUrl tag might be missing in which case the platform is grabbed by replacing the country with platform in the artifact url.
Note that we also have a sandbox country called base. base is the onprem w1 demo data running in sandbox mode. I am aware that a lot of partners have used the base docker image for running tests and decided that we had to support this in artifacts as well.
Looking into the platform artifact, you will find everything from the platform + a number of w1 things (not the database). The reason for the w1 stuff is that a lot of the localizations uses the w1 things and instead of adding these to all localizations, we added them to the platform.

Basically a lot of stuff from the DVD.
Flush-ContainerHelperCache
This function is not new, but it does have a new parameter and a new option.
Flush-ContainerHelperCache -cache bcartifacts -keepDays 7
will flush the artifacts cache but keep the artifacts, which has been used the last 7 days.
Even though downloading from CDN is crazy fast, I still thought that this function could safely run on agents on a schedule to avoid the hard drive in filling up with artifacts.
As you can see, your cache folder will contain a file called lastused, which indicates to the containerhelper when this cache folder was used last. I could also do other things like deleting oldest cache folders until the cache is less than 10Gb – but for now – the days is all that is implemented.
New-BcImage
What is this? You just thought you got rid of images and a new function appears, which can build an image????
Well yes, if you are using the same image again and again – it is much faster to run an image, which has been built, than just-in-time installation of the artifacts. So, you can build an image based in the artifacts and use it again and again.
The function has a number of parameters like baseImage, isolation, memory which are defaulted to use the baseimage, which matches your OS, but you can if you so desire use a different base image.
Mostly you will use these parameters:
- artifactUrl – yes you guessed it, the artifact url you got from Get-BcArtifactUrl.
- imageName – the name of your new docker image. This docker image can be used with new-bccontainer afterwards by specifying -imageName.
- myscripts – exactly like you can add files to this in new-bccontainer which will end up in the c:\run\my folder, you can do it here as well and get them copied into the image, they will however not end up in the c:\run\my folder, but instead get copied into the c:\run folder, overriding any existing files there (in 0.7.0.7 of ContainerHelper has a bug here)
Try
$artifactUrl = Get-BCArtifactUrl -country "us" -version "15" New-BcImage -artifactUrl $artifactUrl -imageName myownimage:latest docker images docker inspect myownimage:latest
Yes, this is an image, which is totally like the images you have been used to use.
This means that you can build an image and publish it to a private repository if you like – or you can leave it to people to build images on the fly. It does however seem cumbersome that you have to build an image and run it. Seems like some complex programming need to ensure that things are in sync – so why don’t we make it easy…
New-BcContainer
As already mentioned, New-BcContainer has a new parameter called artifactUrl and that is more or less everything you need to know.
However…
If you specify BOTH artifactUrl AND imagename – then New-BcContainer will test whether imageName is based on artifactUrl and the current OS etc. etc. and if that is the case – it will run the image. If not it will call New-BcImage and build imageName from artifactUrl – and run that.
Wait… – what?
Yes, try this twice:
Remove-NavContainer test Measure-Command { $artifactUrl = Get-BCArtifactUrl -version 16.1 -select Latest -country us $credential = New-Object pscredential 'admin', (ConvertTo-SecureString -String 'P@ssword1' -AsPlainText -Force) New-NavContainer ` -accept_eula ` -containerName test ` -artifactUrl $artifactUrl ` -Credential $credential ` -auth UserPassword ` -updateHosts ` -imagename myown }
The first run takes 8 minutes 35 seconds on my machine – the second run only a little more than 3 minutes and after the first run, I have a docker image called myown:sandbox-16.1.12629.14076-us. (BTW – you need ContainerHelper 0.7.0.8 or higher for this to work)
If you don’t want to have the image named after the version, you just specify a tag yourself.
Get-BcContainerArtifactUrl
This function can be used on a running container to discover the artifactUrl used to create the container. If the container was started using a docker image (no artifact), this function will return blank.
That’s it – I think this describes the new functionality added to the containerHelper to help people working with Business Central artifacts in docker.
Enjoy
Freddy Kristiansen
Technical Evangelist
Hi Freddy, is there any way to import a excel file to BC cloud without a prompt. I am looking for automating configuration package data import which will pick up excel file periodically and apply the data to database.
LikeLike
There are commands in BcContainerHelper that works with configuration packages.
LikeLike
This is pretty great so far!
One thing, say I want to use another drive as cache? Scripts default to c:\bcartifacts.cache in lots of places, but what if I would like to use another folder as default, ie. D:\bcartifacts.cache? Any way to do that with parameters available? I can download artifacts into another folder with Download-Artifacts, but New-BCContainer will still only check c:\bcartifacts.cache and start a new download even if I have artifacts ready elsewhere.
Maybe I’m missing something.
LikeLike
In general C: has been used as hardcoded drive for all cache’s – I will find a way to configure this in a future navcontainerhelper version
LikeLiked by 1 person
Freddy,
Do i understand correctly that creating the container with useBestContainerOS is not needed anymore when using the artifact URL?
also:
“.Parameter artifactUrl
Url for application artifact to use. If you also specify an ImageName, an image will be build (if it doesn’t exist) using these artifacts and that will be run.”
Source : https://github.com/microsoft/navcontainerhelper/blob/f573e9b822f65e9b7defb6a1a422beb1b2f20977/ContainerHandling/New-NavContainer.ps1
when ImageName is empty, will it then not create a local image to cache for the next time? so to have the fast way of reusing the image over and over, a ImageName must be given?
thnx for sharing!
LikeLike
correct!
LikeLike
Hi Freddy, so in order to user the BSInsider storageAccount you need to use a sasToken but how do you get this sasToken in the first place. Great work as always BTW 🙂
LikeLike
sasToken for bcinsider (not bs:-)) is on http://aka.ms/collaborate under packages (since 15 minutes ago) – same place as the credentials for the bcinsider docker registry.
LikeLiked by 1 person
Yep, BC not BS and yes again, I received the email notification 2 mins after posting 🙂
LikeLike
Hello Freddy,
unfortunately there is no package visible in our Microsoft Partner Center.
In the past we could download the BCInsider Key for the Docker images there.
Do you have an idea what we are doing wrong?
Best regards
LikeLike
On http://aka.ms/collaborate – in exactly the same place you downloaded bcinsider keys you should find this a package called Working with Business Central insider builds – a lot of partners found this and I just checked.
LikeLike
This example didn’t work for me:
Get-BCArtifactUrl -country “us” -version “15”
New-BcImage -artifactUrl $artifactUrl -imageName myownimage:latest
docker images
docker inspect myownimage:latest
But It works if i change it to:
$artifactUrl = Get-BCArtifactUrl -country “us” -version “15”
New-BcImage -artifactUrl $artifactUrl -imageName myownimage:latest
docker images
docker inspect myownimage:latest
LikeLike
Right you are – forgot the variable, thanks for letting me know.
LikeLike
I could not get this to work
Get-BCArtifactUrl -version 16.2 -country us -select Latest -type onprem
But this does
Get-BCArtifactUrl -version 16.2 -country na -select Latest -type onprem
Perhaps the onprem artifacts have different country tags.
LikeLiked by 1 person
Correct, OnPrem has the same country codes as NAV and the released versions of Business Central on premises have had always
LikeLike
Pingback: July updates are out – they are the last on-premises docker images | Freddys blog
Pingback: Automated Builds – Part 10: Using Artifacts – M y N A V B l o g . com
Pingback: Automated Builds – Part 10: Using Artifacts - Microsoft Dynamics NAV Community
Hi Freddy,
I can’t find our full BC version using Get-BCArtifactURL (following is the command)
Get-BCArtifactUrl -version 16.3.14085.14287 -country us
Is it possible to not have a full version match ? or it’s just because this is still new ?
LikeLike
Get-BCArtifactUrl -version 16.3.14085.14287 -country us -select closest
or
Get-BCArtifactUrl -version 16.3 -country us -select all
LikeLike
14287 should be there – but I can see it isn’t – will investigate tomorrow.
LikeLike
thank you
LikeLike
It is there now.
LikeLike
Freddy
What determines the image to use, I have created a Sandbox version for BC1602 and BC1603 and see that 2 different base images are used
BC1602: mcr.microsoft.com/dynamicsnav:10.0.19041.329-generic
BC1603: mcr.microsoft.com/businesscentral/onprem:ltsc2019
I would expect an image stating sandbox?? It works but just wondering
LikeLike
Please create issues on http://www.github.com/microsoft/navcontainerhelper/issues – your bc1602 is using artifacts – the 1603 is using one of the old specific images.
LikeLike
Is there a way to get similar result as I got when using $labels = Get-NavContainerImageLabels -imageName $ImageName when specifying an artifactUrl instead of ImageName?
I need the major version number in my scripts to determine what parameters to use when calling New-NavContainer.
LikeLike
Sorry, I didn’t see this. Please create an issue on https://github.com/microsoft/navcontainerhelper/issues and include as much information as possible if this is still an issue
LikeLike
Hi Freddy,
Is there a way to get similar result as I got when using $labels = Get-NavContainerImageLabels -imageName $ImageName when specifying an artifactUrl instead of ImageName?
I need the major version number in my scripts to determine what parameters to use when calling New-NavContainer.
LikeLike
It is part of the URL – split the URL by /’s and grab the second latest and cast it to [Version]
LikeLike
Hi Freddy, want to get artifacts for version 14.7. Get-BCArtifactUrl -country “nl” -version “14.7” gets no results?
LikeLike
Add -type “OnPrem” – Sandbox is default and there are no 14.7 sandbox artifacts.
LikeLike
thanks, you’re the best
LikeLike
Pingback: July updates are out – they are the last on-premises docker images - Freddy's Blog - Dynamics 365 Business Central/NAV User Group - Dynamics User Group
Hi Freddy we are comparing the versions published as artifacts for Switzerland (ch)
with the version presented as the offical release.
It seems that the application version lines up, but not the platform versions.
Get-BcArtifactUrl -type ‘OnPrem’ -version ’16’ -country ‘ch’ -select ‘All’ gives
16.0….
16.1.12629.12805
16.2.13509.13779
16.3.14085.14238
But https://support.microsoft.com/en-us/help/4549687 shows the following:
Application Build 16.1.12805
Platform Build 16.1.12758
Application Build 16.2.13779
Platform Build 16.2.13772
Application Build 16.3.14238
Platform Build 16.3.14195
Just curious why and if that could lead to problems.
LikeLike
If you download the app artifact and look in the manifest, you will find that the platform version number indeed is different from the app version number.
Platform artifacts are today just included under the app artifacts because they are only used in that.
LikeLike
Are there artifacts for the generic OS images? I have been using the image mcr.microsoft.com/dynamicsnav:generic-1909 and the installation DVD for NAV 2015.CU11 and that has been working fine, but I am getting the warning about images not being updated (as you predicted).
LikeLike
Get-NavArtifactUrl -nav 2015 -cu 11 will give you the artifact url for that build – but you can also use the DVD – in your case – there is no difference.
LikeLike
Hi Freddy
How about you implement working with the artifacts as ZIP files only. And then only extracting upon use.
Could mean a lot for local storage or downloading artifacts before use.
Also with the proper possibility of selecting artifacts from local repo using custom/local url in the -artifactUrl parameter as Ilari Leskinen asks above .
LikeLike
There is a workaround for the placement of artifacts cache here: https://github.com/microsoft/navcontainerhelper/issues/1060
Also Flush-ContainerHelperCache with -keepdays can ensure that your artifacts cache only contains the artifacts you are using.
Reason for not keeping zip files is that performance is more important than space.
LikeLike
OK. I favour the performance too. Thanks.
LikeLike
Hi Freddy!
I am wondering if it is possible to speed the process up even more by doing more caching? In particular the things that are done with new-bccontainer as a part of starting up the container such as creating users, starting up sql, config of service tier and such.
Another question I have is what is the best way of using a custom database with this setup? Can that be easily cached as well? In my case that database is created every day and used in multiple builds. I guess I could do this by running a script in the new-bcimage but is that the best method to accomplish this?
LikeLike
You cannot really create the user until you know the username. And on the other things, they are pretty much things people can configure when running. I have done some optimizations, which will be published very soon – cutting around 25-30%.
The best way on a custom database could be to restore it on a database server on the host and then just point to it?
LikeLike
When using cached images on my machine – the image starts in approx. 1 minut.
LikeLike
Hi Freddy,
Thanks for the replies! I have done some further experimentation and it does indeed start in just under 1 min on my machine. That assumes however that we use the standard database.
When I change it to a different database it went up by quite a bit. I have seen it going up in anywhere from 120 seconds and up to about 270 seconds.
I tried to battle this by creating a container image based on the image created by new-bcimage and in that new image I copied the database over and restored it on the docker SQL (localhost\sqlexpress). I did this under the assumption that the copying and restoring were the main factors for the increase in time but now it seems that this is not the case.
What I am noticing is that starting service tier is taking a lot longer in this case. The only guess I am left with is that the first time start of the service tier is taking this much longer since when I restart the service tier it doesn’t take long at all.
If this is indeed the case then I wonder if the best way to deal with it is to try to configure the service tier and start the service in the second image I created? Or is there possibly a way of changing the database in new-bcimage directly?
I am not to keen on restoring the database outside docker since that defeats part of the purpose of using docker in the first place and that would also require all machines (dev and build) to have SQL servers and would come with additional hassle of managing that.
LikeLike
Pingback: New-BcContainerWizzard generates scripts to build NAV or Business Central containers | NAV musings
Hello,
I am trying to get artifacts for NAV2018, but no matter which command I use I always get an error like:
Downloading c:\bcartifacts.cache\onprem\11.0.19846.0\platform\Prerequisite Components\IIS URL Rewrite Module\rewrite_2.0_rtw_x64.msi
Download-File : Exception calling “DownloadFile” with “2” argument(s): “The remote server returned an error: (404) Not Found.”
It doesn’t matter if I use
$artifactUrl = Get-BCArtifactUrl -type OnPrem -version 11.0.23572.0 -select Closest
or
$artifactUrl = Get-NavArtifactUrl -nav 2018 -cu 1 -country dk -select Latest
Can you help me with that :)?
LikeLike
Read the latest blog post from today:-(
LikeLike
Yikes! It happens man. Fingers crossed for solving the issue!
LikeLike
Solution is there – update the containerhelper and you are good to go!
LikeLike
Did that and now when trying to import-module I got this:
PS C:\windows\system32> Import-Module navcontainerhelper
Add-Type : Cannot add type. The type name ‘TimeoutWebClient’ already exists.
At C:\Program Files\WindowsPowerShell\Modules\navcontainerhelper\0.7.0.25\NavContainerHelper.psm1:93 char:1
LikeLike
You probably need to uninstall all versions and restart powershell – and then install the new one.
LikeLike
That did the trick, but server still returns 404, even when using navcontainerhelper 0.7.0.25.
I will give it a try tomorrow again : P
LikeLike
Please do not file issues here, use https://www.github.com/microsoft/navcontainerhelper/issues with full script and full output.
LikeLike
I got it all working as I would have expected by exploring additional commands via the help file (https://github.com/microsoft/navcontainerhelper/blob/32e4a323d8bb205fa20c3b446e63230f84353bcc/NavContainerHelper.md), but also looking at the script themselves for others. I use the following to set it up to be publicly accessible:
$artifactUrl = Get-BCArtifactUrl
$credential = New-Object pscredential ‘admin’, (ConvertTo-SecureString -String ‘abcd1234password’ -AsPlainText -Force)
$additionalParameters = @(“–publish 8080:8080”,
“–publish 443:443”,
“–publish 7046-7049:7046-7049”)
New-BCContainer `
-accept_eula `
-containerName navserver `
-auth NavUserPassword `
-updateHosts `
-usebestcontaineros `
-assignPremiumPlan `
-includeTestToolkit `
-licenseFile “license file uri” `
-artifactUrl $artifactUrl `
-Credential $credential `
-PublicDnsName something.cloudapp.azure.com `
-installCertificateOnHost `
-useSSL `
-additionalParameters $additionalParameters
Keep in mind, if you run several containers, you’ll need to publish the ports in different ranges so that everything is externally available. I don’t recommend it, it’s a pita and you have to change stuff in the azure portal too. Easier to run multiple VMs.
This works as expected, however, the Landing Page isn’t updated. Is there something I can do to have that Landing Page updated properly?
LikeLike
Pingback: Using Microsoft Dynamics 365 Business Central Artifacts to get to the source code of the default apps
Pingback: Using Microsoft Dynamics 365 Business Central Artifacts to get to the source code of the default apps - Waldo's Blog - Dynamics 365 Business Central/NAV User Group - Dynamics User Group
Pingback: Using Microsoft Dynamics 365 Business Central Artifacts to get to the source code of the default apps - Microsoft Dynamics NAV Community
Suggestion and request : In case we have slower connection (like 40mbps) it takes for ever to download image and artifact. During this entire process there is little or no feedback specially when data is downloaded or saved to disk. If the hard drive is not SSD creating and BC image takes several hours including download and with no progress indicators it is hard to follow the progress.
Can you do something with it?
LikeLike
Sorry, I didn’t see this. Please create an issue on https://github.com/microsoft/navcontainerhelper/issues and include as much information as possible if this is still an issue
LikeLike
HI Freddy,
Trying to get $artifactUrl = Get-BcArtifactUrl -country ‘us’ -type ‘OnPrem’ -version ’14’
Seems these are no such artifacts… Will it be available for the BC13 an BC14?
LikeLike
OnPremises until version 16 – it is called NA (North America) like in NAV.
From version 17, we have us, ca and mx.
LikeLike
Hi Freddy,
I have a problem with the container, I can’t really connect to it when I try to compile my code and I am not really sure why. Leaving a comment here with a question is my last option, that’s why I am here.
I downloaded artifacts and then I changed the existing database and license file in “C:\bcartifacts.cache\onprem\16.3.14085.14238\w1\database” with my database and license file. After that, I created a docker image using the command (New-BcImage). Building image worked well, the container looks healthy and I could uninstall already installed apps. After that, I tried to compile some code and I got an error “Compile-AppInNavContainer : Exception calling “DownloadFile” with “2” argument(s): “Unable to connect to the remote server”. (I am sure that there is the right database in use (mine), I updated the manifest file.)
Not really sure why I can’t open BC in the browser, also container ping returning TimeOut. The Database is relatively small and during building the Docker image there were no problems, all went smoothly. Why this happens? I am also using the latest version of navcontainerhelper (.26). The behavior is really strange and I really don’t know how to check or solve this kind of issue.
I wanted to do this that way because yesterday out of nowhere my current CI script stopped working. I was using two containers, one as SQL server and another as BC, and suddenly BC container couldn’t connect to the SQL container anymore. At this point, I decided to write a new script using the Docker image approach but I got stuck with what I mentioned before. I also checked if there was any update for navcontainerhelper version and it looks like the version didn’t change so that couldn’t cause a problem. Also, there was no change in the win. platform (using win10 1909).
In my case, I am using a modified Base Application and that’s the reason why I am using my database where Base Application is already installed. Regarding everything I tried also the third option, default BC container with Cronus database, where I try to install my custom Base Application but I get the problem again, this time another, Publishing Base App. fails with a timeout so no luck. (If I could install Base Application I could at least compile my code, what would be enough)
Do you maybe have any idea what am I doing wrong so far?
LikeLike
Pingback: Roadmap to Artifacts .. Installing Docker..Importing Module BCContainerHelper ..Downloading Artifacts – Tanya Kharbanda
Hi Freddy,
Is it possible to download the artifacts, and add to the cache manually, like
executing the command : Get-BCArtifactUrl -type OnPrem -select Latest
output : https://bcartifacts.azureedge.net/onprem/17.0.16993.0/us
I entered the above returned url in the browser and downloaded the artifact zip.
I extracted the zip file into the directory C:\bcartifacts.cache\onprem\17.0.16993.0\w1 manually
but when I try to create a bccontainer image using the following command, it starts redownloading the artifact file.
$artifactUrl = Get-BCArtifactUrl -Type OnPrem -select Latest
$credential = New-Object pscredential ‘admin’, (ConvertTo-SecureString -String ‘pass@whatever@me’ -AsPlainText -Force)
New-BcContainer -accept_eula -containerName bctech -artifactUrl $artifactUrl -Credential $credential -updateHosts -imageName mcr.microsoft.com/businesscentral/onprem -includeAL -includeTestToolkit -installCertificateOnHost -memoryLimit 4G -useSSL
what needs to be done, kindly guide.
LikeLike
You should never need to download the artifact manually.
if you do, use the Download-Artifacts function.
If you have an issue, please use https://github.com/microsoft/navcontainerhelper/issues – and include full script + full output (remember to format as “insert code”)
LikeLike
This one-liner shows how to download as a job:
Start-Job -Name BC17us -ScriptBlock { Download-Artifacts -artifactUrl (Get-BCArtifactUrl -country “us” -type OnPrem -version ‘17.0.16993.0’ -select Closest) -includePlatform }
Remember to clean-up the downloads occasionally with:
Flush-ContainerHelperCache -keepDays 15
LikeLike
Pingback: Starting with Container-Based Development using Dockers | Microsoft Dynamics 365 – Ing. Tomáš Kapitán
Pingback: Docker Artifacts - theDenSter
Pingback: Download all Microsoft Dynamics 365 Business Central Source Code with PowerShell
Pingback: Download all Microsoft Dynamics 365 Business Central Source Code with PowerShell - Dynamics 365 Business Central Community
Pingback: Download all Microsoft Dynamics 365 Business Central Source Code with PowerShell - Microsoft Dynamics NAV Community
Pingback: Download all Microsoft Dynamics 365 Business Central Source Code with PowerShell - Waldo's Blog - Dynamics 365 Business Central/NAV User Group - Dynamics User Group
I’ve been tasked to build an automated testing pipeline for Business Central. We need to test our apps against potentially hundreds of versions of Business Central. I have an Azure Devops Pipeline created and a pool of a dozen agent machines. Things are working now, but having each agent download all of the artifacts seems like an incredible waste.
I was thinking I could use one agent machine to execute download-artifacts to bulk download all of the artifacts needed and save them to a central network share. If I did that, is there some way to then configure all of the other agent machines to grab their artifacts from that local folder instead of the Internet?
LikeLike
Download-Artifacts “just” populates the cache folder, which default is stored in c:\bcartifacts.cache.
The structure of the folder is the same as the url – i.e. sandbox\version\country
Platform is found next to the countries in the folder structure.
If Download-Artifacts finds the folders populated, it will not download.
LikeLike
Having problems downloading container that matches our prod version
We have BC2020 Wave1 with Update 16.7 for Microsoft Dynamics 365 Business Central 2020 Release Wave 1 (Application Build 16.7.18411, Platform Build 16.0.18359)
Help says we are on “Version: NA Business Central 16.7 (Platform 16.0.18359.0 + Application 16.7.18411.0)”
Above, it says “With Business Central, we do not use CU numbers, we use version numbers like 14.7, 15.4 and 16.2 and with this function you can easily find the versions available with a major, minor version.”
Running Get-BCArtifactUrl -country us -version 16 -select Latest gives me 16.5.15897.22057
How do I get 16.7 artifacts? Or am I misinterpreting something?
LikeLike
I assume you are running on-premises, then you need to add -type onprem:
Get-BCArtifactUrl -country na -version 16.7 -select Latest -type OnPrem
returns
https://bcartifacts.azureedge.net/onprem/16.7.18411.0/na
Which is your version.
LikeLike
Thanks Freddy
LikeLike
Pingback: Starting with Container-Based Development using Dockers | Microsoft Dynamics 365 - Ing. Tomáš Kapitán
Hi freddy,
I am trying to install BC wave2 i have installed till sandbox but after that i am not able to login to bc popup (webclient) what should i do after this , can you please help me on this?
LikeLike
Sorry, didn’t see this. My assumption is that you are missing ?tenant=default in your URL.
If not, please create an issue on https://github.com/microsoft/navcontainerhelper/issues
LikeLike
Hi, why is there now progress bar for Download-Artifacts not even information about how much there is to download.. ?
LikeLike
Because it wasn’t implemented:-)
I am using WebClient class DownloadFile function and I don’t think that is able to create a progress bar.
LikeLike
Hi Freddy.
I find myself in a location in which there is minimal and very limited internet access. It is not possible to run New-BcContainer and download everything. However, I do have a number of artifacts previously downloaded e.g. C:\bcartifacts.cache\sandbox\18.3.27240.28575. Is it possible to create a new container using these and possibly eliminate the use of Get-BcArtifactUrl?
I hope that makes sense 🙂
LikeLike
You can create the artifact url manually.
https://bcartifacts.azureedge.net/sandbox/18.3.27240.28575/us will point to the sandbox artifact for US country in 18.3.27240.28575. Since the artifacts are there, it won’t download.
Basically – take your path, replace c:\bcartifacts.cache with https://bcartifacts.azureedge.net and replace \’s with /’s – volia.
LikeLike
Pingback: NAV on Docker in 2022 - theDenSter
Hi Freddy,
I am trying to download a docker container for Dominican Republic. I used the following PowerShell script to do it, however I got the response saying “You have to specify artifactUrl or imageName when creating a new container.” If I replace the country code “do” with another one such as “us”, it works fine.
$auth = …
$credential = …
$containerName = …
$licenseFile = …
$artifactUrl = Get-BCArtifactUrl -version 20 -country “do” -select Latest
New-BCContainer -accept_eula `
-containerName $containerName `
-artifactUrl $artifactUrl `
-auth $auth `
-credential $credential `
-isolation hyperv `
-accept_outdated `
-updateHosts `
-licenseFile $licenseFile `
Is it possible to create a container with Dominican Republic localization?
Looking for ward to hearing your suggestions.
Thanks!
LikeLike
Please create an issue on https://github.com/microsoft/navcontainerhelper/issues – then I will have a look next week
LikeLike
Get-BCArtifactUrl -sasToken $sasToken -country nl -select nextmajor
is working fine but returns a sandbox.
https://bcinsider.azureedge.net/sandbox/21.0.43576.0/nl? ….
What is the command to retrieve onprem version?
If I Add -onprem an error is generated :
“You cannot specify storageAccount, type=OnPrem or version when selecting nextmajor release”
If I repace select part a “403”error
Get-BCArtifactUrl -type onprem -sasToken $sasToken -country nl -select all
Error querying artifacts. Error message was Exception calling “DownloadString” with “1” argument(s): “The remote server returned an error: (403) Forbidden.”
Repeating download attempt ( 2 of 10 )…
Get-BCArtifactUrl Telemetry Correlation Id: 0d453182-c829-43ec-afb1-e4b5606ec036
The variable ‘$enumerationResults’ cannot be retrieved because it has not been set.
LikeLike
We do not publish insider builds for on-premises.
You can add -runsandboxasonprem on New-BcContainer in order to simulate onprem
LikeLiked by 1 person
Hello Freddy,
Do you have any experience using Podman in place of Docker.
Will your module work?
LikeLike
I don’t think it will work.
I think Podman is only for linux containers (on linux or windows).
LikeLike
Pingback: discover hidden extensions business central