To start writing extensions for Business Central we have a few choices: installing locally one of the release candidates that comes in the same format as any other Dynamics NAV DVD packages, creating a locally hosted docker sandbox, or in Azure as a container instance.
As the process of getting your container takes just a few minutes, I prefer to do my extensions testing and development in an Azure container.
In Visual Studio Code click on Terminal and in a powershell session start your Azure work by logging in your Azure account with
If logged in already and want to check account logged info:
Next, we need to create a resource group, which is a logical container in Azure, something like an organization unit in Active Directory or a folder for Windows files.
The command is “az group create” and takes two parameters: group name and location:
Once the resource group is created we can create the azure container instance loaded with the latest Business Central using the following Azure command:
“az container create”
In the image above,
- the group in which the container will be created follows “-g” (group) option: “svrg”
- the name of the container follows the “-n” (name) option: “d365bc-az-cont-us-cont”
- the image loaded on this container is stored here: “Microsoft/bcsandbox:latest”
- the OS is Windows
- We can only enter 5 ports: 80,7046, 7048, 7049, 8080
For a complete list of parameters for “az container create”, check this.
To check the logs, find the credentials to log in recorded by Azure for the previous command run “Az container logs” like below:
As you have seen above, the admin credentials are displayed and the new Azure Business Central instance appears ready for connections. Lets check by browsing on the link for the web client:
Ctrl + Click on the web client link in the picture above opens the Business Central web client:
To see the newly container page in Azure navigate to the resource group and then to your container:
After entering the credentials from the logs we are in:
Good! We’ve got a Business Central instance in Azure running in a container and we’re ready to code and test extensions!
To get into this container in Visual Studio Code generate with AL:Go command a new AL project and change in launch.json the value for server token to the container dns name created above:
In the next blog I’ll go through the steps of deploying an Azure container loaded with a Business Central image using deployment templates with parameters.