Expansion may fail when referencing the .outputs property from a module instead of a specific output such as .outputs.id.
Error messages
Error: Failed to expand bicep source '/home/runner/work/cosmosdb-chatgpt/cosmosdb-chatgpt/infra/main.test.bicep'. Exception calling "GetBicepResources" with "2" argument(s): "Unable to expand resources because the source file '/home/runner/work/cosmosdb-chatgpt/cosmosdb-chatgpt/infra/main.test.bicep' was not valid. An error occurred evaluating expression '[union(if(not(empty(parameters('appPrincipalId'))), createArray(reference(resourceId('Microsoft.Resources/deployments', 'nosql-role-assignment-app'), '2022-09-01').outputs.id.value, reference(resourceId('Microsoft.Resources/deployments', 'openai-role-assignment-read-app'), '2022-09-01').outputs), createArray()), if(not(empty(parameters('userPrincipalId'))), createArray(reference(resourceId('Microsoft.Resources/deployments', 'nosql-role-assignment-user'), '2022-09-01').outputs.id.value, reference(resourceId('Microsoft.Resources/deployments', 'container-registry-role-assignment-push-user'), '2022-09-01').outputs.id.value, reference(resourceId('Microsoft.Resources/deployments', 'openai-role-assignment-read-user'), '2022-09-01').outputs), createArray()))]' line 2400. Could not determine JSON object type for type PSRule.Rules.Azure.Data.Template.DeploymentValue+DeploymentOutputs."
Existing rule
No response
Description of the issue
Expansion may fail when referencing the
.outputs
property from a module instead of a specific output such as.outputs.id
.Error messages
Reproduction
Version of PSRule
2.9.0
Version of PSRule for Azure
1.37.0
Additional context
No response