Set Up an Environment for Developing a Module
This topic describes how to set up an environment for developing a module in the System Application.
- You must have a GitHub account.
- You are familiar with the basics of Git, and have the application available. You will use Git to access the GitHub repository.
- Docker is installed. You will use it to run Business Central as a self-contained application.
- BcContainerHelper is installed. You will use it to create a Docker container.
- Demo or Partner license for Business Central
Get the Repository On Your Local Machine
Open the BCApps Repository, and choose Fork to create a fork of the repository.
Choose Code, and then copy the URL under code to clone the forked repository.
The URL looks like
https://github.com/<*username*\>/BCApps.git, and <username> is your GitHub username.
Open PowerShell, and then open the directory in which you want to keep the repository files.
Run the git clone <URL> command. Replace <URL> with the URL you copied in step 3.
Open Visual Studio Code, and then go to the src/System Application/App folder in the cloned repository.
In the folder from step 5, open the app.json and note the version that is listed. You will need that in step 3 in the process of setting up a Docker container.
Modify the settings.json file in Visual Studio Code to include paths to .NET assemblies. The following is an example of how to set the
"al.assemblyProbingPaths"parameter. The path to the assemblies can differ, for example, depending on where you keep them or the version you want to use.
"al.assemblyProbingPaths": [ "C:/Windows/Microsoft.NET/Framework64/v4.0.30319", "C:/bcartifacts.cache/onprem/19.0.29894.30693", "C:/WINDOWS/assembly" ],
For more information about the settings.json, see User and Workspace Settings.
Set Up a Business Central Docker Container
In PowerShell, import the BcContainerHelper module by running the Import-Module BcContainerHelper command. This loads the functions from the module.
Run the New-BcContainerWizard command. This opens a new PowerShell window and allows you to configure your AL Language development environment container.
Complete the steps in the wizard. Make the following changes to the default values.
On the Local Docker Container or Azure VM step, choose a local docker container.
On the Authentication, Username/Password Authentication step, choose options a, b or c.
On the Container Name step, enter a name.
On the Version step, choose options e or f, depending on whether you want a sandbox or on-premises build.
- Enter the version from
BCApps/src/System Application/App/app.jsonafter selecting option e or f.
- Enter the version from
Country, US is fine.
Test Toolkit, if you have a partner license, you may choose any option. If you only have a demo license, choose option d, No Test Toolkit.
Premium Plan, not required.
Create Test Users, not required.
AL Base App Development, we will need this as we will work on the System Application.
Export AL Base App, not required as we will not be working on BaseApp.
AL Language Extension, not required.
License, put in the path to your license file.
Database, default option a.
Multitenant, non-multitenant setup.
We will then put in ! to use the default option choices for the rest of the options.
At the end of the configuration, you should be presented with the following script:
$containerName = 'mydemo' $password = 'P@ssw0rd' $securePassword = ConvertTo-SecureString -String $password -AsPlainText -Force $credential = New-Object pscredential 'admin', $securePassword $auth = 'UserPassword' $artifactUrl = Get-BcArtifactUrl -type 'OnPrem' -country 'w1' -select 'Latest' $licenseFile = '<Path to license file>' New-BcContainer -accept_eula ` -containerName $containerName ` -credential $credential ` -auth $auth ` -artifactUrl $artifactUrl ` -includeTestToolkit ` -includeTestLibrariesOnly ` -licenseFile $licenseFile ` -includeAL -doNotExportObjectsToText ` -updateHosts
If you copy the script, remember to update the path to the license file ($licenseFile). Also, if you are using a demo license, remove the -includeTestToolkit and -includeTestLibrariesOnly options.
Run the script to create the Docker container. This can take some time if you are running it for the first time.