From a6191cc44cde816758c89b4182cb6867f2af9b72 Mon Sep 17 00:00:00 2001 From: AllyW Date: Wed, 23 Apr 2025 16:59:44 +0800 Subject: [PATCH 1/4] add example for keyvault --- .../cli/command_modules/keyvault/_help.py | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/src/azure-cli/azure/cli/command_modules/keyvault/_help.py b/src/azure-cli/azure/cli/command_modules/keyvault/_help.py index 7875c681487..97e7a301a75 100644 --- a/src/azure-cli/azure/cli/command_modules/keyvault/_help.py +++ b/src/azure-cli/azure/cli/command_modules/keyvault/_help.py @@ -42,6 +42,15 @@ short-summary: Manage contacts for certificate management. """ +helps['keyvault certificate contact add'] = """ +type: command +short-summary: Add a contact to the specified vault to receive notifications of certificate operations. +examples: + - name: Adds a certificate contact with the specified email to the Key Vault. (autogenerated) + text: | + az keyvault certificate contact add --vault-name cli-mock-kv-ct-co --email other@contoso.com +""" + helps['keyvault certificate create'] = """ type: command short-summary: Create a Key Vault certificate. @@ -189,11 +198,29 @@ short-summary: Manage certificate issuer information. """ +helps['keyvault certificate issuer create'] = """ +type: command +short-summary: Create a certificate issuer record. +examples: + - name: Create a certificate issuer in a Key Vault by specifying vault name, issuer name, and provider. (autogenerated) + text: | + az keyvault certificate issuer create --vault-name cli-mock-kv-ct-is --issuer-name issuer1 --provider Test +""" + helps['keyvault certificate issuer admin'] = """ type: group short-summary: Manage admin information for certificate issuers. """ +helps['keyvault certificate issuer admin add'] = """ +type: command +short-summary: Add admin details for a specified certificate issuer. +examples: + - name: Add a new certificate issuer administrator to a Key Vault by specifying the vault, issuer name, and admin email. (autogenerated) + text: | + az keyvault certificate issuer admin add --vault-name cli-mock-kv-ct-is --issuer-name issuer1 --email mock2@mock.com +""" + helps['keyvault certificate pending'] = """ type: group short-summary: Manage pending certificate creation operations. @@ -384,6 +411,10 @@ short-summary: Create a new key, stores it, then returns key parameters and attributes to the client. long-summary: The create key operation can be used to create any key type in Vault or HSM. If the named key already exists, Vault or HSM creates a new version of the key. It requires the keys/create permission. +examples: + - name: Create a key in a specified Key Vault with a given name. (autogenerated) + text: | + az keyvault key create --vault-name envault -n enkey """ helps['keyvault key download'] = """ @@ -528,6 +559,15 @@ short-summary: Manage vault network ACLs. """ +helps['keyvault network-rule add'] = """ +type: command +short-summary: Place the CLI in a waiting state until a condition of the vault is met. +examples: + - name: Add a specific IP address to the network access rules of a Key Vault in a specified resource group using this command. (autogenerated) + text: | + az keyvault network-rule add --ip-address 1.2.3.4 --name cli-mock-kv-nr --resource-group cli_mock_keyvault_network_rule +""" + helps['keyvault network-rule wait'] = """ type: command short-summary: Place the CLI in a waiting state until a condition of the vault is met. @@ -690,6 +730,15 @@ short-summary: Manage role assignments. """ +helps['keyvault role assignment create'] = """ +type: command +short-summary: Create a new role assignment for a user, group, or service principal. +examples: + - name: Create a role assignment for a specified assignee with a defined role and scope in a Managed HSM using its name. (autogenerated) + text: | + az keyvault role assignment create --assignee fb2f-ac10--a04f-8b0d786ea37d --hsm-name mock-mhsm-sd --role "Managed HSM Crypto User" --scope "/" +""" + helps['keyvault role definition'] = """ type: group short-summary: Manage role definitions. From d3c173035d5fe9b0d26eb93ca81326d7ec937583 Mon Sep 17 00:00:00 2001 From: AllyW Date: Thu, 24 Apr 2025 13:02:18 +0800 Subject: [PATCH 2/4] Update src/azure-cli/azure/cli/command_modules/keyvault/_help.py Co-authored-by: Yishi Wang --- src/azure-cli/azure/cli/command_modules/keyvault/_help.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/azure-cli/azure/cli/command_modules/keyvault/_help.py b/src/azure-cli/azure/cli/command_modules/keyvault/_help.py index 97e7a301a75..7ae3eafb295 100644 --- a/src/azure-cli/azure/cli/command_modules/keyvault/_help.py +++ b/src/azure-cli/azure/cli/command_modules/keyvault/_help.py @@ -46,7 +46,7 @@ type: command short-summary: Add a contact to the specified vault to receive notifications of certificate operations. examples: - - name: Adds a certificate contact with the specified email to the Key Vault. (autogenerated) + - name: Add a certificate contact with the specified email to the Key Vault. (autogenerated) text: | az keyvault certificate contact add --vault-name cli-mock-kv-ct-co --email other@contoso.com """ From 3d00eb4054ceb11511214747a261bb5dccfa8518 Mon Sep 17 00:00:00 2001 From: AllyW Date: Thu, 24 Apr 2025 13:03:14 +0800 Subject: [PATCH 3/4] Update src/azure-cli/azure/cli/command_modules/keyvault/_help.py Co-authored-by: Yishi Wang --- src/azure-cli/azure/cli/command_modules/keyvault/_help.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/azure-cli/azure/cli/command_modules/keyvault/_help.py b/src/azure-cli/azure/cli/command_modules/keyvault/_help.py index 7ae3eafb295..d0744230bd6 100644 --- a/src/azure-cli/azure/cli/command_modules/keyvault/_help.py +++ b/src/azure-cli/azure/cli/command_modules/keyvault/_help.py @@ -736,7 +736,7 @@ examples: - name: Create a role assignment for a specified assignee with a defined role and scope in a Managed HSM using its name. (autogenerated) text: | - az keyvault role assignment create --assignee fb2f-ac10--a04f-8b0d786ea37d --hsm-name mock-mhsm-sd --role "Managed HSM Crypto User" --scope "/" + az keyvault role assignment create --assignee fb2f-ac10--a04f-8b0d786ea37d --hsm-name mock-mhsm --role "Managed HSM Crypto User" --scope "/" """ helps['keyvault role definition'] = """ From d6e9b17c03875c9e794d0e6ad6fc7c139f1caa22 Mon Sep 17 00:00:00 2001 From: AllyW Date: Thu, 24 Apr 2025 13:08:05 +0800 Subject: [PATCH 4/4] fix cmd desc --- src/azure-cli/azure/cli/command_modules/keyvault/_help.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/azure-cli/azure/cli/command_modules/keyvault/_help.py b/src/azure-cli/azure/cli/command_modules/keyvault/_help.py index d0744230bd6..31ff65d31a2 100644 --- a/src/azure-cli/azure/cli/command_modules/keyvault/_help.py +++ b/src/azure-cli/azure/cli/command_modules/keyvault/_help.py @@ -561,7 +561,7 @@ helps['keyvault network-rule add'] = """ type: command -short-summary: Place the CLI in a waiting state until a condition of the vault is met. +short-summary: Add a network rule to the network ACLs for a Key Vault. examples: - name: Add a specific IP address to the network access rules of a Key Vault in a specified resource group using this command. (autogenerated) text: |