Self Hosting Squidex, how to secure Mongo with vnet?

Scenario : Running a docker version of Squidex in a Linux container on an App Service. Works fine without vnet integration. Squidex is built on .NET Core 3.0
When vnet integration is enabled, the app does not start.

Issue : the following code breaks:

var host = Dns.GetHostName();
// host is now e.g. b6737257279f

This results in an exception “Name or service not known”.

The same code works fine when vnet integration is disabled, it e.g. returns:

Hi, I am not an azure expert. I do not use Azure by myself. Where is the Dns.GetHostName() call used?

I think we can just move the code into the MongoDB path:

Then it should work.

The code breaks at this line:

What exactly do you mean @Sebastian with your suggestion? I don’t fully understand what this code is trying to achieve, is it trying to retrieve the host’s IP address? For what purpose?

It is for clustering mode. When you have a cluster the instances communicate together to decide which cluster member should do which task. And the code tries to find an IP that it can communicate to the other members.

But when clustering is disabled (aka Development Mode), which is the default now, we do not need the code.