Open slavizh opened 6 months ago
Thanks for raising this. Here's a minimal repro:
type foo = {}
resource eventHub 'Microsoft.EventHub/namespaces@2022-10-01-preview' existing = if (false) {
name: ''
}
The behavior is the same for non-existing resources in non-symbolicname templates:
resource eventHub 'Microsoft.EventHub/namespaces@2022-10-01-preview' = if (false) {
name: ''
}
@alex-frankel I believe this is related to the condition-false problem we discussed recently, although I couldn't find an existing open issue to link it to.
Possible duplicate of #12204
Adding internal work item for tracking: https://msazure.visualstudio.com/One/_workitems/edit/27778828
Bicep version Bicep CLI version 0.26.170 (e9abaf16a5)
Describe the bug On language version 2 (when I add user defined types) the template below stops to work.
To Reproduce If I have the following template
main.bicep
and I try to deploy it I get error like:
As soon as I remove the user defined types the template is deployed successfully.
another workaround is to put conditions on the names of the existing resources:
But overall that is workaround to what it seems is like some bug to behavior that should not change from adding user-defined types.
Additional context Add any other context about the problem here.