Update 2021/2/10: BcContainerHelper has replaced NavContainerHelper. This blog post still reference NavContainerHelper, which is outdated.
I know a lot of partners and customers are using the Business Central ARM templates to create an Azure VM, which runs a specific version of Business Central (or NAV). This blog post describes what changed.
Images still supported
First of all, the ARM templates still supports docker images. This means that if you are provisioning Azure VMs using the ARM templates through a PowerShell script, that script should still run.
By default, the artifactUrl is specified to return the latest version and the docker image setting is blank. If you however specify a docker image in the template, it will ignore the artifactUrl setting (hence allowing your script to still run).
The ARM template short URLs
There are currently 6 short Urls for creating Azure VMs with Business Central or NAV. In all templates you can replace the artifactUrl to a different artifact, but by default, the shortUrls will give you the following:
|http://aka.ms/getbc||Creates an Azure VM with the latest on-premises W1 build of Business Central (simplified template)|
|http://aka.ms/getbcext||Creates an Azure VM with the latest on-premises W1 build of Business Central (extended template)|
|http://aka.ms/getnav||Creates an Azure VM with the latest W1 build of NAV (simplified template)|
|http://aka.ms/getnavext||Creates an Azure VM with the latest W1 build of NAV (extended template)|
|http://aka.ms/bcsandboxazure||Creates an Azure VM with the latest US build of Business Central (sandbox)|
|http://aka.ms/getnavworkshopvms||Creates a number of Azure VMs with the latest US build of Business Central (sandbox)|
As a special option, you can add the number 2 to all Urls to get an insider version (the dev branch). While writing this blog post, the 2 branches are identical and I recommend that you use the Urls above.
The ArtifactUrl setting
When you launch any of those short Urls, you will be asked to login to the your Azure Subscription (i.e. the subscription which pays the cost of your Azure VM). After this, you will see a template, which you need to fill out. see this blog post for more general information about this: https://freddysblog.com/2019/07/26/the-arm-templates-for-dynamics-365-business-central-and-microsoft-dynamics-nav/
The only new field is artifactUrl and it is defaulted as described under Get-BcArtifactUrl in this blog post: https://freddysblog.com/2020/06/27/ci-cd-and-artifacts/
Again – if you enter a docker image, the artifactUrl is ignored. You can either enter a full artifact Url (returned by Get-BcArtifactUrl) or you can enter the parameters for the function (like above) separated by a slash like:
This means that this value:
Yields the same Business Central version (but you probably already guessed that)
If you login to the Azure VM to see what is going on, you will discover that the ContainerHelper is using the mode, where is generates the image and saves it locally on the machine before running it:
The github repository
All the ARM templates are open source and you are very welcome to clone and change them for your own needs. The github repository is here: https://github.com/microsoft/nav-arm-templates.
The short Urls are calling an Azure Function to embed parameters into the template. You can reuse that, or you can create a direct Url to deploy your template. You will need a URL to your template json file, like:
You need to data string encode this url and append it to https://portal.azure.com/#create/Microsoft.Template/uri/ – then you will have a direct URL, that launches your template:
You can also use the azure function, which also is used by the short urls:
This offers the advantage to specify parameters and build out a string, which can deploy exactly the Azure VM you need (example setting the VmName)
You get the picture…
Freddy, perhaps a stupid question from me, I’m using this for my development and that works great, but if I read correctly we can use this also to roll-out a specific Azure VM, using MFA, SSO voor a D365 BC Production instance in a specific version and specific localisation? Or do you advise not to use this for production sites. It seems to create an Azure VM and a container running at that VM or am I wrong.
Second how can we then map the certificates and for instance the domainname
.easystep2.cloud(\bc\) using the ARMtemplates?
Third, would it not be great if we can also point to an additional script which is upgrading an existing Azure SQL database and connect it to the created new Azure VM.
Currently, docker is not supported for production – I hope this will change soon – with the move to artifacts, the images are more current (it was a problem running old windows versions with supported BC builds on).
2. the http://aka.ms/getbcext has a parameter called certificate pfx url, certificate password and public dns name – these three needs to be specified to use a custom dns name.
3. http://aka.ms/getbcext also has a Final Setup Script Url, in which you can specify a PS script to run “last”. There is also a before container setup script url. You can see more in the script: https://github.com/microsoft/nav-arm-templates/blob/66ae8e5761da0941beff87daac70e94f3f14aa75/SetupVm.ps1#L288
Thnx, Hope we can reach that point fast, I can’t get out of my mind that in the saaS enviroment Dmitry is doing something simular:-)
Hey Freddy, thank you for the blog post! Is there a list of all supported/newests versions of BC?
No, you can use Get-BcArtifactUrl to see which versions are available
Great article! A few questions for you:
1) Is there any way to connect one of these sample BC VMs to an existing SQL Server VM? Or if not, are there plans to do this?
2) How would you go about running extra scripts at the end of your template? I need to to create extra users with specific rights once the VM has been setup. Is there any way to add script to be run at the end of your ARM template? Right now, I’m stuck running extra PS scripts on the VM once everything else is finished.
Anyway, thanks again!
1. No plans of doing that automatically, but the ARM templates are open source and you could just clone and add things.
2. There is a parameter called Final Setup Script Url – in that you can place a URL to a .ps1 script, which will be executed when everything else is done.
Thanks! That definitely helps!