Azure / Azure/bicep

Allow non-default parameter `utcNow()` calls

Open
#3,111 3 comments 1 reaction 0 assignees View on GitHub
enhancement intermediate language
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

**Is your feature request related to a problem? Please describe.**

`utcNow()` as per the documentation can only be assigned as the default value of a parameter. This means if the sole function of using `utcNow()` is to calculate some time `T` in the future (for example for SAS token expiry) then a parameter is being exposed when it ought not to be.

**Describe the solution you'd like**

Allow `utcNow()` to be called anywhere inside the template and/or `templateStartTime()` (or better-named) to be called anywhere inside the template which has the time the instant the template was invoked (what `utcNow()` as a default parameter does now, but while keeping `utcNow()` unchanged).

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the documented behavior of utcNow() and the requested templateStartTime() alternative. Clarify whether calls should be allowed anywhere, how invocation time differs from current time, and what naming and scoping are acceptable; done means future-time calculations such as SAS token expiry need no exposed parameter.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.