Search code examples
azureazure-resource-managerazure-rm-template

Azure ARM template how to get correct syntax from utcnow function to runbook start time


It should look like this:

"startTime": "2019-03-29T23:30:00+01:00"

With default I get

20190430T151332Z

But I cannot figure out how to get the desired syntax. Is that possible with ARM template utcnow function and if yes, how?


Solution

  • you'd need to use standard dotnet custom formatting. As described here.

    "[utcnow('yyyy-MM-dd THH:mm:ss zzzz')]"
    

    this seems to be fine, except it returns not your TZ, but ARM TZ, so it always returns +00:00. so it makes no sense to use it.