Skip to content

Bicep compat functions #767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SteveL-MSFT opened this issue Apr 28, 2025 · 1 comment · Fixed by #779
Closed

Bicep compat functions #767

SteveL-MSFT opened this issue Apr 28, 2025 · 1 comment · Fixed by #779
Labels

Comments

@SteveL-MSFT
Copy link
Member

Summary of the new feature / enhancement

Need equals() and format() functions implemented

Proposed technical implementation details (optional)

No response

@SteveL-MSFT SteveL-MSFT changed the title Bicep compat Bicep compat functions Apr 29, 2025
@andyleejordan
Copy link
Member

andyleejordan commented Apr 30, 2025

Also needs if() as discovered while testing #770 against:

@allowed(['light', 'dark'])
@description('Light or dark color mode')
// TODO: Teach DSC how to use Bicep param files
param colorMode string = 'light'

var valueData = colorMode == 'light' ? 1 : 0

The ARM file ends up with [if(equals(parameters('colorMode'), 'light'), 1, 0)].

Per https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/template-functions-logical#if

that's if(condition, trueValue, falseValue) and comes from Bicep's ternary operator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants