Closed akata72 closed 1 year ago
@akata72 Thanks for reporting the issue. We'll have a look and let you know.
@akata72 I've moved the issue over here for tracking and we're working on a fix within PSRule for Azure for v1.20.1. https://github.com/Azure/PSRule.Rules.Azure/issues/1780
Fixed upstream.
Description of the issue Hi Bernie,
We are using your excellent PSRule tool, but are running into the issue below.
We have this Bicep Module:
When running Assert-PSRule on this bicep template, I get the following error message.
ERROR Failed to expand bicep source 'C:\VSCodeRepo\platform-deployment-example-dev\.bicep\microsoft.resources\resourcegroups\deploy.rg.pri.bicep'. Exception calling "GetBicepResources" with "3" argument(s): "Unable to expand resources because the source file 'C:\VSCodeRepo\platform-deployment-example-dev\.bicep\microsoft.resources\resourcegroups\deploy.rg.pri.bicep' was not valid. An error occurred evaluating expression '[format('{0}', **parameters('config').common.location)]**' line 21. An error occurred evaluating expression '[variables('$fxv#0')]' line 14. The variable named '$fxv#0' was not defined in the template."
To ReproduceIt can be reproduced by reading some content into a param and then referencing this in a different parameter. (to me it looks like the parameter is not interpreted/read correctly). The bicep file is validated and deployed on the next steps in the pipeline. (it also has the same behaviour when running locally).
I am running the latest versions of PSRule and PSRule.Azure