1
votes

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>"
}
2

2 Answers

2
votes

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'

enter image description here

0
votes

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.