Azure Key Vault门户未显示秘密

问题描述 投票:0回答:1

我很难理解为什么我的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)。

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

azure azure-keyvault
1个回答
1
投票

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

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

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.