简体   繁体   中英

Set expiry in Azure key vault secret

How to set expires in key vault while setting secret using 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 --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 . Once you update your CLI, you will be all set.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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