Get started with the Container Sandbox Development Environment
Dynamics 365 Business Central offers a container-based image environment that enables access to the AL development environment.
You set up a container sandbox by running the Container Sandbox Environment 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.
Dynamics 365 Business Central also offers an online sandbox. For more information, see Sandbox Environments for Dynamics 365 Business Central Development.
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 capabilities and use Docker to provide the infrastructure for the container-based application. 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, Windows Server 2016, or Windows Server 2019, and you install and configure Docker before setting up the container sandbox.
Set up an Azure-hosted container sandbox
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.
In Dynamics 365 Business Central, choose the icon, enter Container Sandbox Environment, and then select the relevant link.
Choose Host in Azure. If prompted, enter the user name and password of your Azure subscription.
The Azure portal opens to display a custom deployment form.
Fill out the required fields on the form, and then select Purchase.
You must set the Accept Eula setting to Yes in order to continue.
Set up a local-hosted container sandbox
If not already done, install Docker.
To install and configure Docker, choose the version of Docker that is appropriate for the host operating system:
- For Windows 10, use Docker Community Edition. For more information, see Install instructions.
- For Windows Server, use Docker Enterprise Edition. For more information, see Install instructions.
In Dynamics 365 Business Central, choose the icon, enter SANDBOX ENVIRONMENT (CONTAINER), and then select the relevant link.
Choose Host Locally.
Save the CreateBCSandbox.ps1 file to your computer.
Run Windows PowerShell ISE as an administrator.
Open the CreateBCSandbox.ps1 file.
$containername = ''variable to the name that you want to give the container, for example
$containername = 'mybc'.
This name is only used internally in your envirorment for identification purposes.
$accept_eula = ''variable to
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 : mybc Container Dns Name : mybc Web Client : http://mybc/BC/ Dev. Server : http://mybc Dev. ServerInstance : BC Files: http://test:8080/ALLanguage.vsix Initialization took 116 seconds Ready for connections! Reading CustomSettings.config from mybc Creating Desktop Shortcuts for mybc
Write down or copy the following parameter/values from the console:
Dev. ServerInstance, and
Files. You will need this information later to set up Visual Studio Code 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> Web Client - opens the Web client for the your application in the container.
- <Container name> PowerShell Prompt - opens a Windows PowerShell prompt in the container. This gives you access to the Dynamics NAV (/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. ServerInstance, and
Files parameters that you retrieved from the Windows PowerShell ISE console when you ran the CreateBCSandbox.ps1 script.
In Visual Studio Code, go to Extensions, and install the AL Language extension from the Marketplace. You now have the AL Language extension for Microsoft Dynamics 365 Business Central enabled.
In Visual Studio Code, press Ctrl+Shift+P and then choose AL Go!.
Choose where to create the project, and then choose the Your own server option.
Open the generated
launch.jsonfile, update the
"server"setting with the value of the
Dev. Serverparameter and the
"serverInstance"setting with the value of the
Dev. ServerInstanceto reflect the container you just created. For example:
"server": "http://mybc", "serverInstance": "BC", "authentication": "Windows",
Save the launch.json file.
You have now set up Visual Studio Code with the AL Language extension for Microsoft Dynamics 365 Business Central.
Running a Container-Based Development Environment
Working with Sandboxes and Entitlements
Sandbox Environments for Dynamics 365 Business Central Development
AL Development Environment
Submit and view feedback for