Azure Key Vault 门户不显示机密

Azure Key Vault portal not showing secrets

我无法理解为什么我的 Azure Key Vault 没有在门户中显示机密(通过导入证书自动创建)。

但是,使用命令行我可以获得它们(已编辑):

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 Identity, Azure.KeyVault.Certificates and Azure.KeyVault.Secrets)。

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

是的,你是对的。如果密码是通过导入证书自动添加的,它将不会出现在 Azure 门户的密钥库中的 Secrets 中。

不仅是你说的SDK,还有powershell, CLI, REST API,都可以拿到秘钥。您也可以在 Certificates -> 您的证书中找到 Secret Identifier,然后直接在 REST API.

中使用它