Outputing a nested resource in a module results in deployment errors
Discussed in https://github.com/Azure/bicep/discussions/12890
Originally posted by jahead January 2, 2024
Hey another question #sorry.
I know resourceTypedParamsAndOutputs is not GA but, I was just wondering if this is a bug | future planned work | out-scope
I currently have a module
standard-app-service does a bunch of things, but ends like this.
output appService resource = appService - with is a resource appService 'Microsoft.Web/sites@2023-01-01'
I then use the output in another parent module. The deployment works fine but azure deployment reports an error when completing the intermediate module.
The template output 'appService' is not valid: The language expression property 'id' can't be evaluated.. (Code: DeploymentOutputEvaluationFailed, Target: appService)
TLDR:
moduleA.outputs.appService -> moduleB.outputs.appservice -> output resource appService
results in: The template output 'appService' is not valid: The language expression property 'id' can't be evaluated.. (Code: DeploymentOutputEvaluationFailed, Target: appService)
If this a bug then I'll happily report it, otherwise just looking for clarity if this a known limitation, so I can design around it?
After looking into and finding #12895 maybe this just isn't possible yet and the linter isn't catching module.outputs.