Skip to content

Files

Latest commit

5041aac · Jun 5, 2022

History

History
45 lines (34 loc) · 2.22 KB

common-cli-samples.md

File metadata and controls

45 lines (34 loc) · 2.22 KB
title description ms.service ms.subservice ms.topic ms.date author ms.author ms.reviewer ms.custom
Azure CLI Samples common to all Azure Cosmos DB APIs
Azure CLI Samples common to all Azure Cosmos DB APIs
cosmos-db
cosmosdb-table
sample
02/22/2022
seesharprun
sidandrews
mjbrown
devx-track-azurecli

Azure CLI samples for Azure Cosmos DB API

[!INCLUDEappliesto-table-api]

The following table includes links to sample Azure CLI scripts that apply to all Cosmos DB APIs. For API specific samples, see API specific samples. Common samples are the same across all APIs.

These samples require Azure CLI version 2.12.1 or later. Run az --version to find the version. If you need to install or upgrade, see Install Azure CLI. If using Azure Cloud Shell, the latest version is already installed.

Common API Samples

These samples apply to all Azure Cosmos DB APIs. These samples use a SQL (Core) API account, but these operations are identical across all database APIs in Cosmos DB.

Task Description
Add or fail over regions Add a region, change failover priority, trigger a manual failover.
Perform account key operations  List account keys, read-only keys, regenerate keys and list connection strings.
Secure with IP firewall Create a Cosmos account with IP firewall configured.
Secure new account with service endpoints Create a Cosmos account and secure with service-endpoints.
Secure existing account with service endpoints Update a Cosmos account to secure with service-endpoints when the subnet is eventually configured.

API specific samples

Next steps

Reference pages for all Azure Cosmos DB CLI commands are available in the Azure CLI Reference.