简体   繁体   English

在 Azure 密钥保管库机密中设置过期

[英]Set expiry in Azure key vault secret

How to set expires in key vault while setting secret using azure cli.如何在使用 azure cli 设置机密时在密钥保管库中设置过期。 I tried the following but it didn't work.我尝试了以下但没有用。 Any help is highly appreciable.非常感谢任何帮助。

az keyvault secret set --name <my-key> --value <my-value> --vault-name <my-kv> --expires "2018-12-30T07:28:38Z"

OUTPUT:输出:

{
  "attributes": {
    "created": "2018-12-13T07:45:37+00:00",
    "enabled": true,
    "expires": null,
    "notBefore": null,
    "recoveryLevel": "Purgeable",
    "updated": "2018-12-13T07:45:37+00:00"
  },
  "contentType": null,
  "id": "https://my-kv.vault.azure.net/secrets/<mykey>/<version>",
  "kid": null,
  "managed": null,
  "tags": {
    "file-encoding": "utf-8"
  },
  "value": "<myvalue>"
}

Try the command az keyvault secret set-attributes , it works on my side.尝试命令az keyvault secret set-attributes ,它对我有效。

az keyvault secret set-attributes --vault-name 'keyvaultname' --name 'test' --expires '2018-12-30T07:28:38Z'

在此处输入图像描述

Quick update: Finally MS fixed the issue on August 27, 2019 in azure CLI release Version 2.0.72 .快速更新:最终 MS 于 2019 年 8 月 27 日在 azure CLI 版本2.0.72中修复了该问题。 Once you update your CLI, you will be all set.更新 CLI 后,一切就绪。

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

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