Skip to content

Latest commit

 

History

History
61 lines (41 loc) · 2.63 KB

ipfirewall.md

File metadata and controls

61 lines (41 loc) · 2.63 KB
title description author ms.author ms.reviewer ms.service ms.custom ms.topic ms.date
Create an Azure Cosmos DB account with IP firewall
Create an Azure Cosmos DB account with IP firewall
seesharprun
sidandrews
mjbrown
cosmos-db
devx-track-azurecli
sample
02/21/2022

Create an Azure Cosmos DB account with IP firewall using Azure CLI

[!INCLUDENoSQL, MongoDB, Cassandra, Gremlin, Table]

The script in this article demonstrates creating an Azure Cosmos DB account with default values and IP Firewall enabled. It uses a API for NoSQL account, but these operations are identical across all database APIs in Azure Cosmos DB. To use this sample for other APIs, apply the ip-range-filter parameter in the script to the az cosmosdb account create command for your API specific script.

[!INCLUDE quickstarts-free-trial-note]

[!INCLUDE azure-cli-prepare-your-environment.md]

  • This article requires version 2.9.1 or later of the Azure CLI. If using Azure Cloud Shell, the latest version is already installed.

Sample script

[!INCLUDE cli-launch-cloud-shell-sign-in.md]

Run the script

:::code language="azurecli" source="~/azure_cli_scripts/cosmosdb/common/ipfirewall.sh" id="FullScript":::

Clean up resources

[!INCLUDE cli-clean-up-resources.md]

az group delete --name $resourceGroup

Sample reference

This script uses the following commands. Each command in the table links to command specific documentation.

Command Notes
az group create Creates a resource group in which all resources are stored.
az cosmosdb create Creates an Azure Cosmos DB account.
az group delete Deletes a resource group including all nested resources.

Next steps

For more information on the Azure Cosmos DB CLI, see Azure Cosmos DB CLI documentation.

For Azure CLI samples for specific APIs see: