Azurecli获得过期的保险库秘密
有没有办法使用CLI列出来自Azure密钥库中的所有过期秘密? 到目前为止,我已经向
az keyvault secret list --vault-name <MyVault> --output table --query [*].'{"Id":id,"expires":attributes.expires}'
我展示了一个清单
| id |到期|
| key1 | 2022-07-08 1200 |
| key2 | 2022-01-01 1200 |
我希望能够在属性上设置条件。 属性。Expires&lt; getDate()
,因此仅返回key2
Is there a way to list all expired secrets from an Azure Key Vault using the CLI?
So far I have
az keyvault secret list --vault-name <MyVault> --output table --query [*].'{"Id":id,"expires":attributes.expires}'
This shows me a list
| Id | expires |
|Key1 | 2022-07-08 1200|
|Key2 | 2022-01-01 1200|
I want to be able to set a condition on attributes.expires like
attributes.expires < GetDate()
And therefore only return Key2
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在这里找到完整的文档:
这是一个PowerShell样本,可以查询所有已过期秘密:
You can find full documentation here:
Here is a PowerShell sample to query all expired secrets: