Azure / Azure/bicep

Incorrect interpretation of '' in Bicep parameter.

Open
#6,417 5 comments 0 reactions 1 assignee Claimed by @alex-frankel View on GitHub
investigate troubleshooting
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

**Bicep version**

az bicep version
Bicep CLI version 0.4.1318 (ee0d808f35)

**Describe the bug**
A clear and concise description of what the bug is vs what you expected to happen

Linter shows warning when used '' in if-else condition for evaluation. Linter should interprete '' as null and not show warning.

**To Reproduce**
Steps to reproduce the behavior:
@allowed([
'AAD'
'PrivateLink'
''
])
param allowedCopyScope string = ''

When used with the if-else condition in resource or variable, linter shows following warning. see screenshot -

allowedCopyScope: ((allowedCopyScope == '' ) ? null : allowedCopyScope)

![image](https://user-images.githubusercontent.com/21009379/161740658-88ee60d4-bf25-40ca-a55c-fa909ea6856f.png)

allowedCopyScope: ((allowedCopyScope == null ) ? null : allowedCopyScope)
![image](https://user-images.githubusercontent.com/21009379/161741253-3581d148-9197-4b2e-bf28-a90f962e323c.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.