Hi @Barik, Monalisa ,
I understand that you are looking to display the count of secrets in your key vault. You can use these Powershell commands to retrieve those numbers:
Number of secrets:
(Get-AzKeyVaultSecret -VaultName xxx).count
Number of certificates (if you want those too):
(Get-AzKeyVaultCertificate -VaultName xxx).count
I'm not sure whether Azure CLI has the commands for this (could not find this documented), so Powershell may be your best option. You can list the secrets via CLI though:
- Secret list: https://docs.microsoft.com/en-us/cli/azure/keyvault/secret?view=azure-cli-latest#az-keyvault-secret-list
- Certificate list: https://docs.microsoft.com/en-us/cli/azure/keyvault/certificate?view=azure-cli-latest#az-keyvault-certificate-list
Let me know if these options provided suit your needs.
If the information helped you, please Accept the answer. This will help us as well as others in the community who may be researching similar questions.