Navcontainerhelper: Create a SQL Server with the Cronus multitenant database from a NAV container image

Created on 21 May 2018  路  10Comments  路  Source: microsoft/navcontainerhelper

Hi, I looked at the example for Create a SQL Server container with the CRONUS database from a NAV container image and tried it with bcsandbox-master image and Financials database which works fine. I had sql server container running and I could connect to from New-NAVContainer using NavUserPassword authentication.

Is it possible to have external SQL container with Financials multi-tenant databases? I wasn't able to do that by simply adding -multitenant parameter. The error I get is that SQL database does not exist, or in some cases 'default tenant is not mounted'.

Even better, if we could restore multitenant Financials databases that were created from new nav container (latest build) to our standalone SQL Server. Then we could connect to that multitenant environment from New-NavContainer, manage tenants, and have persistent data as new builds come along.

Ships in a future version

Most helpful comment

I think it is the multi-tenancy causing the issue - but it must of course work.
I am presenting at UgFocus 2018 mon-wed this week - I will look into this after that.

All 10 comments

I think this is a bug - I will look into this later this week/next week, before deploying an update to navcontainerhelper and the images.

Thanks for fast response! Our end goal really is to 'extract' sql databases from bcsandbox container to, ideally, our own SQL Server so we don't lose data as we change application builds in time.

If there is any other way to do that we can try that as well.

We need it to be multitenant so we can also manage our own template tenants for bacpac.

I think it is the multi-tenancy causing the issue - but it must of course work.
I am presenting at UgFocus 2018 mon-wed this week - I will look into this after that.

@freddydk is it possible that this fix will be in next release?

The problem here is, that a container which is setup for multi-tenancy will mount the default tenant with the database on localhost - which is the option, that will always work.
Now when container two connects to the app database in container one - it will see the the database connection for the default tenant as being localhost and obviously try to connect to localhost\SQLEXPRESS. I cannot just change localhost to the container name, because then I have to setup a lot of extra stuff on the first container as well.
In order to make this work properly, we need to get the database to a separate container, so that all service tiers references this database the same way.
I will think of ways to do this, but it will likely be a helper function in navcontainerhelper and not a change in nav-docker images themselves.

Would we have the same issue if we somehow take app database and default tenant from container and restore them to stand-alone SQL server outside containers?

No, that will solve the problem - and that is what I will be looking at adding commands in navcontainerhelper to do.

@freddydk What is the status of this?
I am trying to do something similar/same - to have persistent tenant database with data and be able to easily upgrade it to new version by running container which will create new app database to my SQL andI will only re-mount the tenant to the new service tier with new app database. I am totally missing this path or I just overlooked how to do that?

Hi Freddy,
Any updates on this? We are looking into a similar setup for doing some of the testing stages in our pipeline. Skipping the restore steps here would speed up things. And make it look more like production.

Not solving the precise issue, but creating multitenant containers pointing to a sql server and attaching an online tenant is described here:
https://freddysblog.com/2019/11/12/mounting-a-database-from-my-online-environment-using-sql-server-on-the-host/
I think you should be able to extract code from this to do what you need.

Was this page helpful?
0 / 5 - 0 ratings