Using a conditional in a module or resource scope produces error
Open
1.0 - Consider
bug
intermediate language
revisit
story: scopes
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 21m
- Merged PRs (30d)
- 79
Description
Adding one case that I think it's related with this - using a conditional in a module scope:
Following code:
```
module mod 'mod.bicep' = if (!empty(otherResourceGroup)) {
name: '${_deployment}-mod'
scope: !empty(otherResourceGroup) ? resourceGroup(otherResourceGroup) : resourceGroup()
```
results in error:
```
The property "scope" expected a value of type "resourceGroup" but the provided value is of type "resourceGroup | resourceGroup".
```
_Originally posted by @miqm in https://github.com/Azure/bicep/issues/449#issuecomment-799277431_
Contributor guide
Assessment
This issue has not been assessed yet.