Securing a network between a website and VM in azure

azure, azure-web-app-service

Solution

IF you are looking to use networking and your own database in Virtual machine, it is best to start with reserved websites. Shared website may not be good idea due to resource limitation and other restrictions.

If your DB is MongoDB, then you have two option:

Have your ASP.NET MVC application running in a Virtual Machine (Windows Server + IIS + your app - IaaS) and have MongoDB is running on other Virtual Machine. If both machines are in same DC, you dont need to fiddle with networking.

Have Azure ASP.NET MVC Web Role (PaaS) and a Virtual Machine have MongoDB is running (IaaS).

In both cases you just need to configure a connection string to connect MongoDB and there is no extra network modification needed to make it work as all machines are inside same DC.

Problem

I understand that in windows azure you can add VMs to a virtual network, but I don't see the option to add a website to a network. what is the recommended way of securing access to a VM (MongoDb) from an azure website? I would much prefer have the db behind some sort of firewall rather than traffic going through the public internet. Edit: the vm will be hosting MongoDb, so using Sql Azure or other MSSql solutions isn't an option.

Original source