From e30d5bc4dac8f627d0f1d47281633bc74ffd8b78 Mon Sep 17 00:00:00 2001 From: "RuiJun Hu (MSFT)" Date: Mon, 26 May 2025 18:03:28 +0800 Subject: [PATCH 1/2] add examples --- .../cli/command_modules/cosmosdb/_help.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/azure-cli/azure/cli/command_modules/cosmosdb/_help.py b/src/azure-cli/azure/cli/command_modules/cosmosdb/_help.py index aa0ea1c1ce9..f1f15b77ed7 100644 --- a/src/azure-cli/azure/cli/command_modules/cosmosdb/_help.py +++ b/src/azure-cli/azure/cli/command_modules/cosmosdb/_help.py @@ -25,6 +25,9 @@ helps['cosmosdb cassandra keyspace create'] = """ type: command short-summary: Create an Cassandra keyspace under an Azure Cosmos DB account. +examples: + - name: Create an Cassandra keyspace under an Azure Cosmos DB account. + text: az cosmosdb cassandra keyspace create -g rg -a myaccount -n mydb """ helps['cosmosdb cassandra keyspace delete'] = """ @@ -331,6 +334,9 @@ helps['cosmosdb gremlin database create'] = """ type: command short-summary: Create an Gremlin database under an Azure Cosmos DB account. +examples: + - name: Create an Gremlin database under an Azure Cosmos DB account. + text: az cosmosdb gremlin database create -g rg -a myaccount -n mydb """ helps['cosmosdb gremlin database delete'] = """ @@ -577,6 +583,9 @@ helps['cosmosdb mongodb database create'] = """ type: command short-summary: Create an MongoDB database under an Azure Cosmos DB account. +examples: + - name: Create an MongoDB database under an Azure Cosmos DB account. + text: az cosmosdb mongodb database create -g rg -a account -n dbname """ helps['cosmosdb mongodb database delete'] = """ @@ -632,6 +641,14 @@ short-summary: Manage Azure Cosmos DB network rules. """ +helps['cosmosdb network-rule add'] = """ +type: command +short-summary: Adds a virtual network rule to an existing Cosmos DB database account. +example: + - name: Adds a virtual network rule to an existing Cosmos DB database account. + text: az cosmosdb network-rule add -n accountname -g rg --subnet subnet +""" + helps['cosmosdb private-endpoint-connection'] = """ type: group short-summary: Manage Azure Cosmos DB private endpoint connections. @@ -860,6 +877,9 @@ helps['cosmosdb sql database create'] = """ type: command short-summary: Create an SQL database under an Azure Cosmos DB account. +examples: + - name: Create an Azure Cosmos DB SQL database. + text: az cosmosdb sql database create -g MyResourceGroup -a MyAccount -n MyDatabase """ helps['cosmosdb sql database delete'] = """ @@ -909,6 +929,9 @@ helps['cosmosdb table create'] = """ type: command short-summary: Create an Table under an Azure Cosmos DB account. +examples: + - name: Create an Azure Cosmos DB Table. + text: az cosmosdb table create -g rg -a account -n mytable """ helps['cosmosdb table delete'] = """ From 9b3f4b2f50eb4d000592f745542976ac898ab005 Mon Sep 17 00:00:00 2001 From: "RuiJun Hu (MSFT)" Date: Thu, 29 May 2025 14:28:17 +0800 Subject: [PATCH 2/2] Update _help.py --- src/azure-cli/azure/cli/command_modules/cosmosdb/_help.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/azure-cli/azure/cli/command_modules/cosmosdb/_help.py b/src/azure-cli/azure/cli/command_modules/cosmosdb/_help.py index f1f15b77ed7..97d7c83588d 100644 --- a/src/azure-cli/azure/cli/command_modules/cosmosdb/_help.py +++ b/src/azure-cli/azure/cli/command_modules/cosmosdb/_help.py @@ -644,7 +644,7 @@ helps['cosmosdb network-rule add'] = """ type: command short-summary: Adds a virtual network rule to an existing Cosmos DB database account. -example: +examples: - name: Adds a virtual network rule to an existing Cosmos DB database account. text: az cosmosdb network-rule add -n accountname -g rg --subnet subnet """