Dynamics Business Central as a Service on Azure

Load Balancer
SQL Database
Virtual Machines

Solution Idea

If you'd like to see us expand this article with more information, implementation details, pricing guidance, or code examples, let us know with GitHub Feedback!

Overview

Dynamics 365 Business Central SaaS is not available in all countries. Therefore, it is important to offer clients a similar model using Business Central running as a VM in Azure. Partners can build their own architecture where they can deploy Business Central and clients can use this SMB ERP solution as a service using the most of benefits of using Business Central as a cloud solution. This example shows how to establish a production environment for Business Central in partner private Azure environment. Topics like licensing and authentication are beyond the scope of this solution idea.

Architecture

Architecture Diagram

Data Flow

This scenario demonstrates provisioning an environment ready for adding new tenant databases, new customers, and new demo tenants. This is a complete environment with the exception of a customer database which will be built only once and it allow usage for many different customers. For new customers, the partner just needs to deploy new customer database and to mount it.

The data flows through the scenario as follows:

  1. Customers login using web browser, device (phone or tablet) or through API to access the Dynamics 365 Business Central.
  2. Virtual Machine as a middle-tier, provides Web Server Components and plays roles as a NST Server, connecting customers with databases. One Virtual Machine can be used for multiple customers and the partner just needs to provide different Business Central Server Instance with different ports numbers for each of customers. Using this model, support will be much easier as the partner needs to support only one server at a minimum. With Azure Load balancer, this system will scale applications and create highly available services.
  3. The application and business data reside in separate databases, both using Azure SQL for its databases. App database will be in one single database (S0 will be enough to run application database). The partner maintains the application centrally without affecting the various tenants that use the application. Tenant databases will be placed in an Azure Elastic Database Pool (for starters, S4 pool with 200 DTU’s will be enough). Each tenant database contains the business data for one or more specific companies from one client and does not contain all of the application metadata. If customers require more power, it is easy to change service tier on Azure SQL and Elastic Database Pool.
  4. To provide better sustainability, all resources will be in one resource Group. All external services (Azure Machine Learning, Power Apps, Power Automate and Power BI) will communicate directly with the NST Server through exposed API’s and OData web services.

Azure Resources

A resource group is a container that holds related resources for an Azure solution. The resource group can include all the resources for the solution, or only those resources that you want to manage as a group. You decide how you want to allocate resources to resource groups based on what makes the most sense for your organization. Generally, add resources that share the same lifecycle to the same resource group so you can easily deploy, update, and delete them as a group.

Azure Virtual Machines are one of several types of on-demand, scalable computing resources that Azure offers. Typically, you choose a virtual machine when you need more control over the computing environment than the other choices offer. Virtual machine is necessary for middle-tier services in Business Central architecture. Partner can choose between many different types of virtual machines with various number of CPU’s, memory.

Azure SQL Database is a fully managed Platform as a Service (PaaS) Database Engine that handles most of the database management functions such as upgrading, patching, backups, and monitoring without user involvement. Azure SQL Database is always running on the latest stable version of SQL Server Database Engine and patched OS with 99.99% availability. PaaS capabilities that are built into Azure SQL Database enables you to focus on the domain-specific database administration and optimization activities that are critical for your business.

To choose the right database option, the best way is to choose one of the service tiers. You can choose Standard or Premium service tier with different numbers of DTU’s. If you are not experienced with deploying Azure SQL databases, you can find more information here.

Azure SQL Database elastic pools are a simple, cost-effective solution for managing and scaling multiple databases that have varying and unpredictable usage demands. The databases in an elastic pool are on a single server and share a set number of resources at a set price. Elastic pools in Azure SQL Database enable SaaS developers to optimize the price performance for a group of databases within a prescribed budget while delivering performance elasticity for each database.

Similarly, with standard Azure SQL, you can choose different tiers and different number of DTU’s for your elastic database pool.

With Azure Load Balancer, you can scale your applications and create highly available services. Load balancer supports both inbound and outbound scenarios. Load balancer provides low latency and high throughput and scales up to millions of flows for all TCP and UDP applications.

Cost considerations

It is very important to note that the partner doesn’t a virtual machine per each customer. It can significantly reduce costs for middle-tier service (VM) by combining access and just changing ports.

There are various options for VM sizes depending on the usage and workload. The partner will need to track performances and to increase power when needed by scaling the VM(s) up. For app databases, you can take the smallest Azure SQL as S0 or eventually S1. The same situation applies with Azure Elastic Database Pool where you have various options and you need to start with smallest as it is easy scalable.

Next Steps