[BUG] Unable to expand resources because the source file ... The function "references" was not found.
when using languageVersion 2.0
#2922
Labels
bug
Something isn't working
feature: pre-flight-expansion
Issues relating to expansion of ARM and Bicep.
Milestone
Existing rule
No response
Description of the issue
When referencing the outputs of a collection of deployed modules, it seems that PSRule is unable to recognize the
references
function used to access the properties of the modules.Error messages
##[error]Failed to expand bicep source '/home/vsts/work/1/s/main.bicep'. Exception calling "GetBicepResources" with "2" argument(s): "Unable to expand resources because the source file '/home/vsts/work/1/s/main.bicep' was not valid. An error occurred evaluating expression '[map(references('acc_loop'), lambda('acc', createObject(format('{0}', lambdaVariables('acc').outputs.acc.value), createObject('name', lambdaVariables('acc').outputs.acc.value))))]' line 257. The function "references" was not found."
Reproduction
module1.bicep
main.bicep
The compoilation of main.bicep fails with:
Version of PSRule
2.9.0
Version of PSRule for Azure
1.37.0
Additional context
No response
The text was updated successfully, but these errors were encountered: