Since  published his first version of navcontainerhelper 1 year passed (almost). 

And community loved (and love... I hope ... at least I do) possibility to spin up fresh Business Central Sandbox in minutes.

But one feature is still missing. It's - Business Central Sandbox with Extended data

Yes, there are a number of good blogs about how-to-create-business-central-sandbox-with-extended-data

But, they require manual steps and ... yes, they require manual steps. And we are lazy (at least me :)

Premium vs Extended Pack

As you might know, there are two Business Central Experiences

  • Essential
  • Premium

I will not describe here the differences between them, it's all described here

What I really wanted to clarify is that: 

  • Premium experience - is about visible UI (read - additional features, mostly production) inside Business Central
  • Extended pack - is about demo data inside of the production module (which becomes visible after activation of Premium experience).

How to manually enable Premium Experience with Extended Data

Just to remind you of all the steps:

  1. Spin up New-Navcontainer with -assignPremiumPlan option. Adding this option will assign the premium plan to your default admin user.
  2. [Optional] Run Setup-NavContainerTestUsers. This will create additional test users with the premium plan.
  3. Change User experience to Premium in Company Information. This will make all functionality visible through UI (and search).
  4. Upload and Apply Extended Data Pack in the Configuration packages. This will bring demo data to extended functionality. 
  5. [Optional]. Upload your own Custom Data Pack. If you have, for example, some industry solution.  

The process itself is not very complicated, but you should sit and wait when to press the next button. 

Some days ago 420Tech asked me to automate this. Well, technically I advised them to automate this, just because it should be automated if you sell your solution and need to quickly prepare a demo environment. Right? And after, I asked them if I can share the result with the community. And they agreed! Thank a lot!

So here it is.

How to automatically enable Premium Experience with Extended Data

You don't need to be an expert in Power Shell to create something like this. Thanks to our community we have so many open source project now, and if you don't know how to do something just google, look at ready examples and repeat.

What I did - I created my own New-NavContainer which I called 

New-PremiumNavContainerWithExtendedData

and when you run it you get ready-to-go Premium Business Central Sandbox with Extended Data inside.

The process takes about 17 minutes. The most time-consuming part is applying Extended Pack. 

How it works

In the background:

1. I run New-NavContainer to create a new container

New-NavContainer -accept_eula:$accept_eula `
                 -containername $containername `
                 -auth NavUserPassword `
                 -Credential $credential `
                 -includeCSide `
                 -doNotExportObjectsToText `
                 -usessl:$false `
                 -updateHosts `
                 -assignPremiumPlan `
                 -shortcuts Desktop `
                 -imageName $navdockerimage `
                 -licenseFile $licenseFile `
                 -additionalParameters $additionalParameters `
                 -alwaysPull

2. I create Test Users

Setup-NavContainerTestUsers -containerName $containername -password $password

3. I switch UI to the premium mode. To do this I import my own SetPremiumExperience.fob with one codeunit inside and run it.

Switch-NavContainerToPremiumMode -containerName $containername 

4. I search for Extended Pack inside of the Container, upload it and apply to the Cronus company.

I tried to invoke Codeunit 8620 (Config. Package - Import) directly but did not succeed due to the error that caused FILE.ISPATHTEMPORARY(Path) in CU 419.IsAllowedPath. So, I created one more codeunit ImportAndApplyRapidStartPackage.fob, which I import and invoke CU8620, but through the stream.

ImportAndApply-ConfigPackageInNavContainer -containerName $containername -configPackageType:Premium 

Warning! Specify BC developer license for this script in $licenseFile. Otherwise BC will not be able to apply DimensionSet inside of Extended Pack, and script will return an error.

5. [Optional] If you want to import and apply your own rapid start package you can do this by using the same function, just specify a path to your package (could be local or cloud). 

ImportAndApply-ConfigPackageInNavContainer -containerName $containername -configPackageType:Custom -customConfigPackageFile $customConfigPackageFile

6. That's all! 

The script can be found here https://github.com/dkatson/BC-Scripts/blob/master/New-PremiumNavContainerWithExtendedData.ps1

P.S> If you'll have something to add/optimize etc. just make PR. 

Enjoy!