4
votes

I am creating an ARM template to provision keyvault and it's secrets. I want to generate unix timestamp inside template and supply to nbf and exp attributes which only take integers. Can't find much pointers on this.

i am referring to microsoft documentation https://docs.microsoft.com/en-us/azure/templates/microsoft.keyvault/vaults/secrets

If no solution in ARM template then i need to use powershell to generate and pass it to template which i may not prefer unless there is no other option.

2

2 Answers

2
votes

There is no way to generate those with ARM templates. arm templates do not have a way to work with date\time

-1
votes

Use utcNow() function to get Date/Time during deployment time. Note you can use it only in parameter's default value:

"parameters" : {
    "todayUtc": {
      "type": "string",
      "defaultValue": "[utcNow('yyyy-MM-dd')]"
    }
}

See: docs