简体   繁体   English

Azure Key Vault 门户未显示机密

[英]Azure Key Vault portal not showing secrets

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 没有在门户中显示机密(通过导入证书自动创建)。

Azure Key Vault 未显示任何机密

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 ).我还对我的 Web 应用程序进行了身份验证,并且我能够从中获取此机密并毫无问题地使用它(使用Azure IdentityAzure.KeyVault.CertificatesAzure.KeyVault.Secrets )。

Why are my secrets not showing in the Azure Portal?为什么我的机密没有显示在 Azure 门户中? Is this because they were added automagically by importing a certificate?这是因为它们是通过导入证书自动添加的吗? What happens if I delete a certificate?如果我删除证书会怎样?

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.如果机密是通过导入证书自动添加的,则它不会出现在 azure 门户中密钥保管库的Secrets中。

Not only the SDK you mentioned, but also powershell , CLI , REST API , they can all get the secret.不仅是你提到的SDK,还有powershellCLIREST API ,他们都可以得到秘密。 You can also find the Secret Identifier in the Certificates -> your certificate, then use it directly in the REST API.您还可以在Certificates -> your certificate 中找到Secret Identifier ,然后直接在 REST API 中使用它。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM