Select Language:
If you’re looking to secure your Cosmos DB and prevent public network access, setting up a private endpoint is a great step. It creates a private connection between your network and Azure, making your database more secure.
Here’s a simple way to connect to your Cosmos DB from a virtual machine (VM) using a graphical tool like Azure Storage Explorer:
First, ensure you’ve disabled public network access on your Cosmos DB. This can be done through the Azure portal. Just go to your Cosmos DB resource, find the “Networking” section, and turn off “Public network access.” Then, enable a private endpoint. This will connect your Cosmos DB directly to your virtual network.
Since you already created a VM for testing and confirmed connectivity with nslookup, you’re halfway there. To start using this setup with a GUI application:
-
Install Azure Storage Explorer on your VM if you haven’t already. It’s a free tool that allows you to connect to Azure resources visually.
-
Configure the connection in Storage Explorer:
- Open the app and choose to add a new account or service.
- Select “Use a connection string” or “Azure Cosmos DB” depending on your setup.
- Instead of using the public endpoint URL, use the private IP address or the private endpoint’s DNS name associated with your Cosmos DB.
-
Update your network settings if necessary:
- Make sure your VM’s network can resolve the private DNS name of your Cosmos DB.
- If needed, adjust DNS settings inside your VM to point to your private DNS zone that maps the Cosmos DB hostname to its private IP.
-
Connect and view your data:
- With everything properly configured, you should be able to connect to your Cosmos DB through Storage Explorer inside your VM.
- You’ll now have graphical access to your database without exposing it to the public internet.
This setup helps keep your data secure while still giving you easy visual access to your Cosmos DB. Remember, keep your private endpoint and DNS settings properly configured to avoid connectivity issues.





