This time I want to talk about the Sandbox environment in SaaS.
Business Central was relatively late in SaaS, as far as I know, in all Dynamics productions, the Sandbox was first used in CRM.
For the Sandbox environment, the first impression of NAV developers may be that this is just a test and development environment. Basically the same as the Production environment. I thought the same at the beginning.
Although we can copy the Production environment to create Sandbox. There are still many essential differences between the two environments in SaaS.
I will share a few experience I faced before and hope this will help, if you have any idea, please contact me.
- If you are developing AppSource Extension, please don’t use Visual Studio Code to publish it to Sandbox for testing before submitting it to Microsoft.
- If possible, please don’t publish extension directly from Visual Studio Code to Sandbox.
- A number of precautions are taken for that sandbox after a sandbox is created with a copy of a production environment
- Please don’t do performance testing on the Sandbox Environment.
- Each one Production Environment in Business Central is limited to three Sandbox Environments from 2020 release wave 2 (BC17).
- Test out the Major builds prior to release in Sandbox, such as PTE, permissions and so on.
- The automatic backup that applies to Production Environments does not apply to Sandbox Environments.
- If you use the “copy environment” to create the environment, you can only copy the Production environment to create the Sandbox
If you are developing AppSource Extension, please don’t use Visual Studio Code to publish it to Sandbox for testing before submitting it to Microsoft.
This is a problem I actually encountered last year. If version number you publish to SaaS Sandbox is the same as that validated to AppSource. Then the Production Environment will not able to be copied if this Extension is installed.
The following is from Microsoft:
In a sandbox environment it is impossible for the same extension to be used simultaneously as a dev extension (VS Code) and as a PTE (upload).
The extension is already in use here as a dev extension (different tenant). The conflict must be handled by changing the version of the extension used in a non-dev context.
• Change the version number of the extension and upload the new version to production
• Do the sandbox copy
• Going forward, try to always use a distinct version number for dev versus what is used for production/PTEs
Therefore, if it is a PTE, it is easy to handle, we only need to increase the version number. But for AppSource Extension, we must resubmit it to Microsoft for review.
So please try to use Docker and On-Pre environment as the development environment for Business Central.
If possible, please don’t publish extension directly from Visual Studio Code to Sandbox.
There are two types of updates that happen in Business Central SaaS.
Minor – These are typically done once a month. These would include product fixes that should not break the service.
Major – Microsoft typically have two updates per year. For example, for 2019 we had two major releases Wave 1 (April) and Wave 2 (Oct). These can include additional product fixes as well as product enhancements.
When you publish an app from Visual Studio Code to an online sandbox for testing, it is published within the scope of the service node that is hosting that sandbox. Upgrading the sandbox to a new version means that the sandbox is moved to another node that is running the new version. All apps deployed from Visual Studio Code are removed before the sandbox is moved because they will not be available on the new node. However, the data of an app is not removed, so you only have to re-publish and install the app to make it available. Apps that are uploaded to the environments of both types (production and sandbox) on the Extension Management page using the Upload Extension action are published within a global scope and downloaded to the service node and installed during the upgrade, which means that they will not disappear.https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-sandbox-overview
As recorded in Microsoft’s Docs, if you publish an extension from Visual Studio Code to an online sandbox directly, the extension you installed will be removed after the Sandbox is upgraded. I have been asked this question many times since last year. The most serious is in the UAT stage, which requires urgent reinstallation.
So I recommend using the “Upload Extension” on the “Extension Management” page, like in Production Environment.
A number of precautions are taken for that sandbox after a sandbox is created with a copy of a production environment
•The job queue is automatically stopped
•Any base application integration settings are cleared
•Outbound HTTP calls from extensions are blocked by default and must be approved for each extension
To enable outbound HTTP calls, go to the Extension Management page in Business Central, and choose Configure. Then, on the Extension Settings page, make sure that Allow HttpClient Requests is selected. This setting must be enabled for each extension.
•Any General Data Protection Regulation (GDPR) action must be handled separately and repeated for the sandbox. There is no synchronization with the production environment after the sandbox has been created.https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/environment-types#sandbox-environments
Please don’t do performance testing on the Sandbox Environment.
Sandbox is different than a Production environment. If you need to do a performance test, please create a new Production environment and do it.
You can create a sandbox environment that includes data from your production environment for debugging purposes, for example. But if you want to run performance tests, or similar benchmarking, the sandbox is not reliable enough for that purpose. This is because sandboxes run in a different performance tier on Azure than production environments. Instead, create a dedicated environment based on the Production environment type – this gives you the exact experience and performance that users will experience in the actual production environment.https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/environment-types#sandbox-environments
Each one Production Environment in Business Central is limited to three Sandbox Environments from 2020 release wave 2 (BC17).
Starting with 2020 release wave 2, every new Business Central customer with a Business Central Premium or Essential subscription can use one production environment and three sandbox environments, at no extra charge. They can then choose to purchase an unlimited number of additional production environments, if needed, through their CSP partner. Each additional production environment comes with three additional sandbox environments and 4 GB additional, tenant-wide database capacity. Production and sandbox environments can be created and used in any country or region where Business Central online is available, including the countries or regions where the existing environments are running.https://docs.microsoft.com/en-us/dynamics365-release-plan/2020wave2/smb/dynamics365-business-central/support-unlimited-number-production-sandbox-environments
Until now, Each Business Central tenant is limited to three sandbox environments. But Starting from the next version, if you purchase three production environments, you can theoretically create 9 Sandboxes.(Not tested)
Test out the Major builds prior to release in Sandbox, such as PTE, permissions and so on.
A few weeks before Major version releasing, we can create Sandbox Environments on the new major build. At this point, we can use this environment to do PTE and permission tests. But only be able to create a Sandbox environment on the Cronus company (Test Company).
The automatic backup that applies to Production Environments does not apply to Sandbox Environments.
If you want to export data from a Sandbox Environment, you can use Excel or RapidStart, but you cannot request a database export.
For Production Environment:
How often are production databases backed up?https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/faq#how-often-are-production-databases-backed-up
Databases are protected by automatic backups that are retained for 30 days. As an administrator, you cannot access or manage these backups because they are managed automatically by Microsoft. For more information about the underlying technology, see Automatic backups.
If you use the “copy environment” to create the environment, you can only copy the Production environment to create the Sandbox
○ Production Environment->Sandbox Environment
✖ Production Environment->Production Environment
✖ Sandbox Environment-> Production Environment
✖ Sandbox Environment->Sandbox Environment
Hope this will help.