Azure Key Vault门户未显示机密

时间:2020-03-06 14:26:23

标签: azure azure-keyvault

我很难理解为什么我的Azure Key Vault在门户中不显示秘密(这些秘密是通过导入证书自动创建的)。

Azure Key Vault showing no secrets

但是,我可以使用命令行将它们删除(删除):

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
  }
]

我还对我的Web应用程序进行了身份验证,并且能够获得这个秘密,并且可以毫无问题地使用它(使用Azure IdentityAzure.KeyVault.CertificatesAzure.KeyVault.Secrets)。 / p>

为什么我的机密没有显示在Azure门户中?这是因为它们是通过导入证书自动添加的吗?如果我删除证书怎么办?

1 个答案:

答案 0 :(得分:2)

是的,您是正确的。如果机密是通过导入证书自动添加的,则该机密将不会显示在Azure门户的密钥库的Secrets中。

不仅您提到的SDK,还有powershellCLIREST API,他们都可以获取秘密。您还可以在Secret Identifier->证书中找到Certificates,然后直接在REST API中使用它。

enter image description here