Setting up a BC Development Environment on Azure

This article is primariraly for developers with a private account on Azure.

Acknowledgment. Thanks to Freddy Kristiansen from Microsoft for making this easy.

Maybe you have an idea for an app or an extension to Microsoft Dynamics 365 Business Central or maybe you just want to learn how to develop customizations to Business Central. Maybe you are an experienced C/AL developer and want to get up to speed on AL development.

This article is about setting up a development environment as easy as possible.

Microsoft Account

To get started with an Azure account, you, first of all, need a Microsoft email. It can be an Outlook.com or Hotmail.com email.

I created an outlook email here: outlook.live.com

Azure Account

Then you can create an Azure account. You probably need a credit card.

Jump-start with a Template

Freddy Kristiansen gives us a link to a BC template.

Read about it in this blog post The ARM templates for Dynamics 365 Business Central and Microsoft Dynamics NAV

He also mentions it in this blog post: Troubleshooting Business Central on Docker

This link http://aka.ms/getbc will create an Azure VM with Windows Server 2019 – and it just always works. This is an up-to-date Windows Server with Docker and no extra software or policies enforced, only Windows Defender.

Azure Custom Template

Azure VM with Windows Server 2019

A few things to remember to fill in.

  • Region: West Europe or something near where you are.
  • Vm Name: DevEnvBC or something like that
  • Accept Eula. You have to set it to Yes. Otherwise it will fail.
  • Remote Desktop Access. This is important. This is the IP address where you are when you create the VM. If you move to a different location and a different IP address, you can no longer access the VM and you will have to change the Source IP address.
  • Chose an admin password. To log in to the VM the user name is vmadmin and to login to BC the user name is admin. The password is the same.
  • Test Toolkit. I recommend to install it and get started with automated tests in case it is new to you.
  • License File Uri. You don’t need it to get started. You will have the range 50.000 to 50.149 to play with.
  • Auto Shutdown. Activate it. This is not for free. Shut down the server when you do not use it.

I leave the remaining options with their default values.

Connecting with Remote Desktop

Find the VM on the Azure Dashboard and click the link. Then find the Connect menu and chose RDP.

Wait for Azure to check and validate the “Suggested method for connection.” You should see a green check mark. Then click Download RDP File button.

Open the file with Microsoft Remote Desktop. The user name is vmadmin and the password is the one you specified above.

The first time

When you open the VM for the first time, it will not be ready right away. Be patient. It will run a lot of scripts and commands to set it up automatically. Just wait for it to finish.

You will see a lot of icons on the desktop when it is ready and a web page Dynamics 365 Business Central Sandbox Environment.

Azure Custom Template

This is important information. Read it. Especially at the bottom of the page, you will find the necessary information to run the code.

Microsoft Edge

Before moving on, you have to change the default web browser to Microsoft Edge. Edge was installed automatically and you should have seen a message. But it did not automatically set it to default.

Business Central needs it.

Visual Studio Code

Start with opening Visual Studio Code and open the HelloWorld project in the Documents\AL\Samples folder.

Uppdate launch.json

Find the launch.json file in the .vscode folder and change the server path, the serverInstance and the tenant. According to the information in the Sandbox Environment page.

Download Symbols

Press Ctrl+Shift+P or chose View, Command Palette… from the menu. Search for AL: Download Symbols and select it.

First Run

Now press Ctrl+F5 Run without debugging. It probably fails

...
HelloWorld.al(6,10): error AL0297:
The application object identifier '70051001' is not valid.
It must be within the allowed ranges '[50100..50149]'.

Change the object number to 50101.

Second Run

It should be running now. Be patient. Start by getting that project to run before you move on.

Once you have the Hello World app running, you can reuse the settings in the launch.json file for your other projects.

Extra tools

I like to work with Git, GitHub and GitHub Desktop.

GitHub

If you do not have a GitHub account, I warmly recommend getting one.

Git

Open the Terminal and type git --version.

git version 2.39.0.windows.2

If you get an error, then install it. Look here: gitforwindows.org.

During the installation, choose Visual Studio Code as the default editor for Git. I keep the default value for all the other options.

Now you should be able to right click on a folder in the explore and chose to open Git Bash on the folder. From there it is eash to open Visual Studio Code on that project by simply typing the commande:

code .

GitHub Desktop

I just love it. It makes checking in and making pull requests and everything with GitHub so much easier. Other developers prefer the command line and that is fine too.

You can download it from here: desktop.github.com

Git from the Command Line

I wrote an article about the Git Commands I used the most.

Start Exploring

How you should have the tools to get started developing AL and discover the latest version of Microsoft Dynamics 365 Business Central.

Alternative to Azure

It should also be possible install a local development environment with Docker. I just never got it to work. Either Docker never started or it failed with an error message that left me clueless.