Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Dynamics 365 Business Central Development Quick Start Guide

You're reading from  Dynamics 365 Business Central Development Quick Start Guide

Product type Book
Published in Aug 2018
Publisher Packt
ISBN-13 9781789347463
Pages 224 pages
Edition 1st Edition
Languages
Concepts
Authors (2):
Stefano Demiliani Stefano Demiliani
Profile icon Stefano Demiliani
Duilio Tacconi Duilio Tacconi
Profile icon Duilio Tacconi
View More author details

Chapter 4. Creating Your Development Sandbox

In Chapter 3, Modern Development Environment Overview, we gave you an overview of the new modern development environment based on Visual Studio Code for developing extensions for Microsoft Dynamics 365 Business Central, and you had a lot of tips and tricks for customizing and optimizing your development experience.

In this chapter, we'll see how to create an environment isolated from the production one (called a sandbox) for developing and testing purposes. Here, we'll learn the following:

  • What is a sandbox environment in Dynamics 365 Business Central?
  • What are the available types of sandbox environments?
  • How to create and use a sandbox environment for testing and developing with Microsoft Dynamics 365 Business Central.

What is a sandbox?


In Dynamics 365 Business Central, a sandbox is an environment totally isolated from a production instance, where you can develop, test, run demos, and play with the service, without affecting the real production data.

You can create a sandbox environment by connecting to your Business Central instance, clicking on the search button in the top bar, and searching for the word sandbox (or, if you prefer, by accessing the Administrator | IT Administration | General menu in Dynamics 365 Business Central):

Searching for sandbox in Dynamics 265 Business Central

You will be presented with two main choices:

  • Creating an online sandbox
  • Creating a container-based sandbox

 

These are the differences between the two choices:

Online sandbox


The online sandbox is an environment deployed as a Dynamics 365 Business Central service (SaaS). You can activate the online sandbox only from a production environment, by selecting Sandbox in the search box and clicking on the first choice (Sandbox Environment).

When the creation wizard starts, click Create:

A new browser window will open, and the sandbox creation process starts. At the end of this process, you have a welcome page that shows that the sandbox environment is ready. To start working with the online sandbox, click on the Close button:

When creating the online sandbox, a new Dynamics 365 Business Central tenant is deployed, and this tenant is created with a default demonstration company (CRONUS). At the moment, there isn't an option for copying data from the production tenant to the online sandbox.

You can reset your online sandbox environment at any time. Remember that resetting the sandbox will completely remove and recreate it with demonstration data. You can switch...

Azure-hosted sandbox


With the Azure-hosted sandbox option, you can create a Dynamics 365 Business Central sandbox on an Azure Virtual Machine, by using a predefined template. This template gives you the option to create an Azure VM with Docker as the infrastructure for the container-based application is automatically configured. Obviously, this option requires that you have an active Azure subscription, and each sandbox has its costs in terms of Azure resources.

To create an Azure-hosted Dynamics 365 Business Central sandbox, select the Sandbox Environment (Container) option as shown and then select Host in Azure:

After clicking this button, you will be redirected to your Azure portal account, and the template for the Azure Virtual Machine will be provided:

In this template, you with need to select a Resource group (or create a new one), select the VM name and the VM admin password (used also for connecting to the Docker-based instance of Dynamics 365 Business Central), select Accept Eula is...

Local-hosted sandbox


A local-hosted Dynamics 365 Business Central sandbox requires that you have a machine running Windows 10 or Windows Server 2016, with Docker installed and running.

Docker for Windows can be installed from the following link: https://www.docker.com/docker-windows.

Run the installer with administrator privileges. After installation, check that Docker is running Windows Container (right click on the Docker icon in the task bar):

On your Windows Settings, check that you've enabled the PowerShell execution script option:

A local-hosted sandbox can be created by selecting the Sandbox Environment (Container) option as shown and then selecting Host locally:

At this point, you will be asked to download and save a Powershell script file called CreateBCSandbox.ps1.

After saving it, start Powershell ISE with administrator privileges and open that file.

In this Powershell script, you've simply to set these parameters:

  • Set the $containername variable to the name of your Dynamics 365 Business...

Manually creating a sandbox based on Docker


You can also create a Dynamics 365 Business Central sandbox environment without using the sandbox links to the Business Central production tenant, but instead using custom scripts for creating Docker-based sandboxes hosted locally or on Azure Container Instances.

Steps for manually creating a locally hosted Dynamics 365 Business Central sandbox

After installing Docker for Windows on your local machine, you can manually create a Docker-based Dynamics 365 Business Central container by running a script that pulls a container image from the Docker hub.

From Command Prompt, you can execute the following command:

docker run -m 4G -e ACCEPT_EULA=Y -e UseSSL=N microsoft/bcsandbox:latest

 This will create a Dynamics 365 Business Central container with the latest image available.

If you want to create a sandbox with a particular localization (for example, IT), you can run the following command:

docker run -m 4G -e ACCEPT_EULA=Y -e UseSSL=N microsoft/bcsandbox:it...

Summary


In this chapter, we saw the various options for creating a sandbox environment for working and developing with Dynamics 365 Business Central. This is the starting point for a development environment, where we can connect with Visual Studio Code, publish, deploy, and debug extensions.

In Chapter 5Developing an Extension with AL and VS CODE, we'll see how to create a real-world extension for Dynamics 365 Business Central by using the AL language and Visual Studio Code.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Dynamics 365 Business Central Development Quick Start Guide
Published in: Aug 2018 Publisher: Packt ISBN-13: 9781789347463
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}

Online Sandbox

Container-Based Sandbox

Dynamics 365 Cloud Service

Run in Azure VM or locally

Managed by Microsoft

Managed by partner

Same environment as production

Container-based environment

Visual Studio Code only

Visual Studio Code. Supports also C/SIDE and SQL Management Studio...