Get started with the Container Sandbox Development Environment

Dynamics 365 Business Central offers a container-based image environment that enables access to both the AL development environment and the C/SIDE development environment.

You set up a container sandbox by running the SANDBOX ENVIRONMENT (CONTAINER) page from Dynamics 365 Business Central. You will have to decide whether you want an Azure-hosted or locally hosted container sandbox. See the next section for details.

Tip

Dynamics 365 Business Central also offers an online sandbox. For more information, see Choosing Your Dynamics 365 Business Central Development Sandbox Environment.

Choosing an Azure-hosted or local-hosted container sandbox

When you set up the container sandbox, you can choose to host the sandbox on Microsoft Azure or on a local computer. Both environments offer the same capabilites and use Docker to provide the infrastructure for the container-based applicationn. The difference is:

  • With Azure hosting, Docker is installed and configured for you. However, Azure hosting requires that you sign-up for an Azure subscription, and additional costs may be incurred for each container sandbox.
  • Local hosting requires that your computer is running Windows 10 or Windows Server 2016, and you install and configure Docker before setting up the container sandbox.

Set up an Azure-hosted container sandbox

  1. If you you do not already have one, sign up for an Azure subscription.

    To get a free subscription and read more information, see https://azure.microsoft.com.

  2. In Dynamics 365 Business Central, choose the Search for Page or Report icon, enter SANDBOX ENVIRONMENT (CONTAINER), and then select the relevant link.

  3. Choose Host in Azure. If prompted, enter the user name amd password of your Azure subscription.

    The Azure portal opens to display a custom deployment form.

  4. Fill out the required fields on the form, and then select Purchase.

Note

You must set the Accept Eula setting to Yes in order to continue.

Set up a local-hosted container sandbox

  1. If not already done, install Docker.

    To install and configure Docker, choose the version of Docker that is appropriate for the host operating system:

  2. In Dynamics 365 Business Central, choose the Search for Page or Report icon, enter SANDBOX ENVIRONMENT (CONTAINER), and then select the relevant link.

  3. Choose Host Locally.

  4. Save the CreateBCSandbox.ps1 file to your computer.

  5. Run Windows PowerShell ISE as an administrator.

  6. Open the CreateBCSandbox.ps1 file.

  7. Set the $containername = '' variable to the name that you want to give the container, for example $containername = 'MyBizCentralApp'.

    This name is only used internally in your envirorment for identification purposes.

  8. Set the $accept_eula = '' variable to '$true'.

  9. Press F5 to run the script.

    The console pane displays the progress of the script. When the script has completed successfully, information like the following will display:

    ...
    Container IP Address: 172.22.147.63
    Container Hostname  : MyBizCentralApp
    Container Dns Name  : MyBizCentralApp
    Web Client          : http://MyBizCentralApp/NAV/
    Dev. Server         : http://MyBizCentralApp
    Dev. ServerInstance : NAV
    
    Files:
    http://MyBizCentralApp:8080/al-0.15.18566.vsix
    
    Initialization took 116 seconds
    Ready for connections!
    Reading CustomSettings.config from MyBizCentralApp
    Creating Desktop Shortcuts for MyBizCentralApp
    
  10. Write down or copy the following parameter/values from the console: Dev. Server, Dev. ServerInstance, and Files. You will need this information later to set up Visual Studio Code for for extension development.

You now have a container sandbox set up on your computer. The following shortcuts have been added to your desktop:

  • <Container name> Windows Client - opens the Windows client for your application in the container.
  • <Container name> Web Client - opens the Web client for the your application in the container.
  • <Container name> CSIDE - opens the Dynamics NAV Development Environment for developing your application using CSIDE.
  • <Container name> PowerShell Prompt - opens a Windows PowerShell prompt in the container. This gives you access to the Dynamics NAV (https://docs.microsoft.com/en-us/powershell/business-central/overview), which you can run against the container sandbox environment.
  • <Container name>Command Prompt - opens a Windows command prompt in the container.

For more information about working with a container sandbox, see Running a Container-Based Development Environment.

Set up Visual Studio Code

After the container sandbox is set up, you must set up Visual Studio Code for extension development. To do this, you need the values for Dev. Server, Dev. ServerInstance, and Files parameters that you retrieved from the Windows PowerShell ISE console when you ran the CreateBCSandbox.ps1 script.

  1. Open a browser to the path that is specified by the Files parameter, and save the .vsix file to your computer.

  2. In Visual Studio Code, go to Extensions, and then choose Install from VSIX. You now have the AL Language extension enabled.

  3. In Visual Studio Code, press Ctrl+Shift+P and then choose AL Go!.

  4. Choose where to create the project, and then choose the Your own server option.

  5. Open the generated launch.json file, update the "server" setting with the value of the Dev. Server parameter and the "serverInstance" setting with the value of the Dev. ServerInstance to reflect the container you just created. For example:

    "server": "http://MyBizCentralApp",
    "serverInstance": "NAV",
    
  6. Save the launch.json file.

You have now set up Visual Studio Code with the AL Language extension.

See Also

Running a Container-Based Development Environment
Troubleshooting the Container Sandbox
Choosing Your Dynamics 365 Business Central Development Sandbox Environment
AL Development Environment