I'm currently managing 7 active projects in Azure, each with at least two environments—development and production. Each of these projects has varying infrastructures, but they all require at least a database and an Azure function. I'm trying to enhance security by eliminating public database access, so I'm considering placing the databases in a Virtual Network (VNet). My proof of concept worked well, and the Azure function can access the database through VNet integration.
However, I run into a dilemma when it comes to checking databases regularly, as several team members need access. I found that using a VPN Gateway could help, but it's a hefty cost—over $20 per gateway, and one would be needed for each VNet. Since team members have different levels of access, merging all projects into a single VNet isn't an option. This means I'd end up with one VPN Gateway per environment, which could total around $200 a month.
Is there a more cost-effective and efficient way to connect to these VNets from our local machines? (We're all using Macbooks, if that makes any difference.)
5 Answers
Avoiding a separate VPN Gateway for each VNet is smart unless absolutely necessary. Hub-and-spoke architecture is the way to go here or maybe just a jump host without the gateway. It’s really about your requirements and how you want to manage access to the databases from local machines—make sure that's clear in your design!
Why not build your own solution using a virtual machine and some IP table configurations? This could give you more flexibility without incurring the costs of multiple gateways. Just a thought!
You might want to think about creating a single access VNet with the VPN Gateway attached. From there, you can use private links to connect to the databases in their respective VNets. Just don’t forget, you may need to set up some private DNS rules in the access VNet to make everything work smoothly. This way, instead of setting up multiple gateways, you can manage everything from one spot. It should simplify the architecture a bit too!
For sure! Check out the hub-and-spoke architecture as suggested in the Microsoft documentation. It'll really help clarify things!
Thanks for the tip! I’ll definitely look into that.
As others have mentioned, consider creating a connectivity hub where you can have one P2S VPN Gateway. Pair that with a DNS Resolver for better traffic management. Utilize VNet peering for all the networks containing your databases. That's a solid way to manage access while keeping your database authentication intact—giving you control over who accesses what, even if they are on the same network. And remember to think about DNS resolution for the private endpoints too!
Thanks for the detailed explanation! I'll look into setting that up.
If you really need to keep the environments completely isolated, consider setting up your own VPN appliance on a budget VM. This way, you can power down the VM when it's not in use, saving costs. But honestly, you should weigh the time you’d spend setting it up against the actual savings. If you can shift everyone to the same access point, that’ll make things a lot simpler and cheaper!

I just want developers to easily query the databases from their own machines!