How can I add a list of IP ranges to be whitelisted in Azure Cosmos DB?

Sheethal Pai 0 Reputation points
2023-11-22T09:59:08.99+00:00

From Azure Cosmos DB networking tab, I'm able to add individual IP address for whitelisting But I have a few IP ranges. Please let me know how to add them.

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,526 questions
{count} votes

2 answers

Sort by: Most helpful
  1. TP 83,066 Reputation points
    2023-11-22T10:24:54.3433333+00:00

    Hi Sheethal,

    You can add the public IP ranges in Classless Inter-Domain Routing (CIDR) format. You can use a free online IP range to CIDR calculator to help (search engine will give many to choose from).

    For example, say you wanted to allow IP range 104.87.85.176 - 104.87.85.179, you would enter 104.87.85.176/30 on the Networking blade of your Cosmos DB.

    Please click Accept Answer and upvote if the above was useful. If something is unclear or you need additional assistance for a specific range, add a comment below.

    Thanks.

    -TP

    1 person found this answer helpful.

  2. Sajeetharan 2,031 Reputation points Microsoft Employee
    2023-11-22T11:09:07.82+00:00

    Check the way to add using the Azure CLI here

    https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-configure-firewall#configure-ip-firewall-cli

    # Create an Azure Cosmos DB account with default values and IP Firewall enabled

    resourceGroupName='MyResourceGroup'

    accountName='mycosmosaccount'

    ipRangeFilter='192.168.221.17,183.240.196.255,40.76.54.131'

    # Make sure there are no spaces in the comma-delimited list of IP addresses or CIDR ranges.

    az cosmosdb create -n $accountName -g $resourceGroupName --locations regionName='West US 2' failoverPriority=0 isZoneRedundant=False --locations regionName='East US 2' failoverPriority=1 isZoneRedundant=False --ip-range-filter $ipRangeFilter

    0 comments No comments