[BUG] Unable to expand resources because the source file
when using listkeys()
#2829
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
I have the following code using the keyVault AVM module and trying to reference a storage account key
secrets: { secureList: [ { name: storageRef.name value: storageRef.listKeys().keys[0].value attributesExp: 1702648632 attributesNbf: 10000 } ] }
When PSRule runs I always get this error :
Failed to expand bicep source '/home/runner/work/bicep-registry-modules/bicep-registry-modules/avm/ptn/finops-toolkit/finops-hub/tests/e2e/defaults/main.test.bicep'. Exception calling "GetBicepResources" with "2" argument(s): "Unable to expand resources because the source file '/home/runner/work/bicep-registry-modules/bicep-registry-modules/avm/ptn/finops-toolkit/finops-hub/tests/e2e/defaults/main.test.bicep' was not valid. An error occurred evaluating expression '[parameters('value')]' line 9939. The parameter named 'value' was not set or a defaultValue was defined."
Error messages
Failed to expand bicep source '/home/runner/work/bicep-registry-modules/bicep-registry-modules/avm/ptn/finops-toolkit/finops-hub/tests/e2e/defaults/main.test.bicep'. Exception calling "GetBicepResources" with "2" argument(s): "Unable to expand resources because the source file '/home/runner/work/bicep-registry-modules/bicep-registry-modules/avm/ptn/finops-toolkit/finops-hub/tests/e2e/defaults/main.test.bicep' was not valid. An error occurred evaluating expression '[parameters('value')]' line 9939. The parameter named 'value' was not set or a defaultValue was defined."
Reproduction
https://github.com/sebassem/bicep-registry-modules/actions/workflows/avm.ptn.finops-toolkit.finops-hub.yml
Version of PSRule
2.9.0
Version of PSRule for Azure
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: