Microsoft Dynamics 365 Business Central Cookbook
上QQ阅读APP看书,第一时间看更新

Option 2 – Azure-hosted sandbox

If you want to use a container hosted on a virtual machine in Azure, perform the following steps:

  1. If you have not already done so, you can sign up for an Azure subscription at https://azure.microsoft.com and start with a free account.
  2. Now that we have an Azure subscription, we need to create a virtual machine within that subscription. This virtual machine will host a Business Central environment inside a Docker container. To make this easy, there is an Azure Resource Manager (ARM) template available for you to use.

You can access the template at https://aka.ms/getbc. Make sure to use your Azure subscription login credentials.
The template contains a lot of options, but for our purposes, we're going to focus on just a few of them. Once you're familiar with the process, take a look at the other options and do things such as connecting your sandbox to an Office 365 account! See the options in the following table:

You can get more information on each option in the template by using the '!' icon onscreen, which is directly to the right of each option name.
  1. Once you have filled in the ARM template, accept the terms and conditions at the bottom of the screen and then click the Purchase button.

Now, you can just sit back and relax, and if your template was configured properly, your virtual machine will be created. Go grab a coffee and check back later.

Make sure you wait at least one hour before logging into the virtual machine. Even after it is successfully created, the machine will go through a series of configurations to create and set up the container.
  1. To test the connection to your Azure virtual machine, you need to remotely connect to the machine to get some information from it. You need to use the Azure web portal (https://portal.azure.com) to find the address of your virtual machine:
    1. In the Azure web portal, click on Virtual Machines in the navigation pane on the left:
      • If you do not see Virtual Machines, press All Services and search for Virtual Machines to select it.
    2. Select the name of the virtual machine that you just created.
    3. Look for the DNS Name and take note of the address listed below it:
      • For example, myvirtualmachine.canadaeast.cloudapp.azure.com
  2. We can monitor the status of the virtual machine configuration by navigating to the virtual machine landing page:
    1. In your web browser, navigate to the DNS Name you noted previously.
    2. Click the View Installation Status link. Here, you can see when the virtual machine configuration is complete and is ready to use for development.

Once the virtual machine has been fully configured, the landing page will look similar to this:

  1. Now, we need to take note of a few pieces of information, for later.

At the bottom of the landing page is a section named Access the Dynamics 365 Business Central Sandbox Environment using Visual Studio Code. In this section, take note of the following values:

You can also download a remote connection file from the landing page in the event that you want to connect to and work directly within the server.
  1. Before we close the landing page, we need to install the security certificate so that we can connect to the sandbox:
    1. On the landing page, click the Download Certificate link and save the file to your local machine.
    2. Depending on which web browser you are using, click either the Windows (Edge/IE/Chrome) or the Windows (Firefox) link and follow the onscreen instructions to install the certificate.
  1. Let's check to make sure we can connect to the Business Central Web Client:
    1. Close your web browser and navigate to the landing page for your virtual machine.
    2. Click the Web Client link on the right-hand side of the page.

You should now be looking at the Business Central login page:

If you get an error about an unsecured connection, try restarting your web browser and/or reinstalling the security certificate. 
  1. Install the AL Language extension from the Visual Studio Code Marketplacehttps://marketplace.visualstudio.com/items?itemName=ms-dynamics-smb.al.