Bearbeiten

Freigeben über


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. In the following sections, you can read about the local-hosted container sandbox.

Tip

Dynamics 365 Business Central also offers an online sandbox. For more information, see Sandbox Environments for Dynamics 365 Business Central Development.

Set up a local-hosted container sandbox

Local hosting requires that your computer is running Windows Desktop, Windows Server 2016, or Windows Server 2019, and you install and configure Docker before setting up the container sandbox.

Prerequisite: install Docker

If not already done, install Docker.

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

Set up a Docker container sandbox using BCContainerHelper

To set up a Docker container sandbox using an existing sandbox environment, see Running a Container-Based Development Environment.

Set up a Docker container sandbox using an existing sandbox environment

To set up a Docker container sandbox using an existing sandbox environment, follow these steps 2. In Dynamics 365 Business Central, choose the Lightbulb that opens the Tell Me feature. 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 = 'mybc'.
This name is only used internally in your environment for identification purposes. 8. Set the $accept_eula = '' variable to '$true'. 9. Select F5 to run the script.

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

...
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
  1. Write down or copy the following parameter/values from the console: Dev. Server, Dev. ServerInstance, and Files. You 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 are added to your desktop:

  • <Container name> Web Client - opens the Web client for 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.

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. 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.

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

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

  4. 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 created. For example:

    "server": "http://mybc",
    "serverInstance": "BC",
    "authentication": "Windows",
    
  5. 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