Share via

Securing cosmos db

Anubhav Aggarwal (TATA CONSULTANCY SERVICES LTD) 60 Reputation points Microsoft External Staff
2023-11-10T21:30:06.08+00:00

Hi All,

I am trying to secure the cosmos db account and block any external connections to make connection with it. I am trying to access cosmos db through Python SDK in a virtual machine which has a private IP. While adding to the list of trusted IP in cosmos db, it shows me an error that we cannot add private IP in it. Is there way I can add private IP?

Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.

Azure
Azure

A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.

Azure Cosmos DB
Azure Cosmos DB

An Azure NoSQL database service for app development.

0 comments No comments

Answer accepted by question author

GeethaThatipatri-MSFT 29,597 Reputation points Microsoft Employee Moderator
2023-11-12T00:46:36.6+00:00

Hi @Anubhav Aggarwal (TATA CONSULTANCY SERVICES LTD)Welcome to Microsoft Q&A thanks for posting your question

You cannot add a private IP address to the list of trusted IP addresses in Azure Cosmos DB. The list of trusted IP addresses is used to allow access to your Cosmos DB account from specific IP addresses or IP address ranges.

However, you can still secure your Cosmos DB account and block any external connections by using Azure Virtual Network (VNet) service endpoints.

You can follow this document here https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-configure-firewall

https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-configure-private-endpoints?source=recommendations&tabs=arm-bicep

Regards

Geetha

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.