4

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://learn.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.

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
Venkata Dorisala
  • 4,783
  • 7
  • 49
  • 90

3 Answers3

2

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

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
0

There is now a function available to generate Unix-style timestamps from an ISO-8601 format.

dateTimeToEpoch('2022-11-17T09:54:13Z')
Sam
  • 1,176
  • 6
  • 19
-1

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

Murmel
  • 5,402
  • 47
  • 53
okko
  • 29
  • 2