Open
Description
I ran into a little confusing what-if error for a deployment that loads a JSON file into bicep as part of the deployment. The JSON contained, amongst other things, some escaped JSON (JSON in JSON so to speak). This deployment works fine when you deploy it, but if fails on a what-if.
After condensing the code down further, I managed to reproduce this directly in bicep, without needing to import anything.
module.bicep:
param settings object
output settings object = settings
main.bicep:
var test2 = {test: '[\\"Hello World\\"]'}
module t 'module.bicep' = {
name: 'myApp'
params: {
settings: test2
}
}
output test object = t.outputs.settings
When trying to run what-if this fails with a 'language expression validation':
Deployment runs without issue however:
It only fails when using the variable as input for a module parameter. If you remove the module and pass the variable directly to the output both what-if and deployment work:
var test2 = {test: '[\\"Hello World\\"]'}
output test object = test2
Metadata
Metadata
Assignees
Labels
No labels