1
votes

I'm having troubles understanding why my Azure Key Vault is not showing secrets (that were created automatically by importing certificates) in the portal.

Azure Key Vault showing no secrets

However, using the command line I can get them (redacted):

C:\Program Files\Microsoft SDKs\Azure\.NET SDK\v2.9>az keyvault secret list --vault-name <my vault>
[
  {
    "attributes": {
      "created": "2020-03-05T14:48:37+00:00",
      "enabled": true,
      "expires": "2021-01-28T19:23:00+00:00",
      "notBefore": "2018-01-29T19:23:00+00:00",
      "recoveryLevel": "CustomizedRecoverable+Purgeable",
      "updated": "2020-03-05T14:48:37+00:00"
    },
    "contentType": "application/x-pkcs12",
    "id": "https://<my vault>.vault.azure.net/secrets/SomeSecret",
    "managed": true,
    "tags": null
  },
  {
    "attributes": {
      "created": "2020-03-06T13:10:32+00:00",
      "enabled": true,
      "expires": "2021-01-28T19:23:00+00:00",
      "notBefore": "2018-01-29T19:23:00+00:00",
      "recoveryLevel": "CustomizedRecoverable+Purgeable",
      "updated": "2020-03-06T13:10:32+00:00"
    },
    "contentType": "application/x-pkcs12",
    "id": "https://<my vault>.vault.azure.net/secrets/SomeSecret2",
    "managed": true,
    "tags": null
  }
]

I've also authenticated my web application, and I'm able to get this secret and use it without problems from it (using Azure Identity, Azure.KeyVault.Certificates and Azure.KeyVault.Secrets).

Why are my secrets not showing in the Azure Portal? Is this because they were added automagically by importing a certificate? What happens if I delete a certificate?

1
is there any chance that secrets were created using a different credential and the one used in the portal has no list / get permissions?Thiago Custodio

1 Answers

2
votes

Yes, you are right. If the secret was added automatically by importing a certificate, it will not appear in the Secrets in your keyvault in the azure portal.

Not only the SDK you mentioned, but also powershell, CLI, REST API, they can all get the secret. You can also find the Secret Identifier in the Certificates -> your certificate, then use it directly in the REST API.

enter image description here