我很难理解为什么我的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和Azure.KeyVault.Secrets)。 / p>
为什么我的机密没有显示在Azure门户中?这是因为它们是通过导入证书自动添加的吗?如果我删除证书怎么办?
答案 0 :(得分:2)
是的,您是正确的。如果机密是通过导入证书自动添加的,则该机密将不会显示在Azure门户的密钥库的Secrets
中。
不仅您提到的SDK,还有powershell,CLI,REST API,他们都可以获取秘密。您还可以在Secret Identifier
->证书中找到Certificates
,然后直接在REST API中使用它。