I would like to run Mongo DB in Azure. I looked into the hosted version, but the price is high, so I'd like to run my own MongoDB for use with an Azure Web Role. I would like the Mongo DB to remain behind a firewall and not have the ports be available publicly. I would also like all the traffic to stay in the same data center to make access fast and keep down egress charges. Do we have to use some type of VPN connection between servers within the same data center or is there a better way to configure the network connections?

closed as too broad by Xavier Lucas, mdpc, Sven Mar 21 '15 at 10:09

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


Basically you just need to deploy your cloud service to the same virtual network as your virtual machine running MongoDB. That way both services will be able to communicate directly with each other. The virtual network should be created before the VM and the Cloud Service. During VM creation, just select the virtual network. On your cloud service configuration make sure to add these lines:

    <VirtualNetworkSite name="YourVirtualNetworkName" />
        <InstanceAddress roleName="YourRoleName">
                <Subnet name="YourConfiguredSubnet" />

Here's a guide explaning how to create a virtual network


Not the answer you're looking for? Browse other questions tagged or ask your own question.