DeploymentNotFound when referencing an output from a conditional deployment module #7735
-
Bicep version Describe the bug When deploying a sub-module conditionally with true and also using an output the arm template is happy. when the condition is false it throws a weird error DeploymentNotFound. I would like bicep to give me an error when I output to also make it conditional. not sure if related to: To Reproduce Additional context |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
It does some like you are running into the issue that #3750 would have caught. It seems your output is dependent on a module being executed, so when it is not, the deployment fails. You probably need to use the ternary operator to conditionally set the value. In order to know for sure, please include a concise repro of the issue. |
Beta Was this translation helpful? Give feedback.
-
Yeah. I was able to fix with similar workaround. I guess the issue is that bicep should warn or error. Not sure if it’s worth keeping this issue open or just mark it as duplicate.
… On Aug 2, 2022, at 4:46 PM, Ben Wilkinson ***@***.***> wrote:
Hi @masters3d
Just a follow up for you... here is a related discussion
#7266 (reply in thread)
Please review and a summary of the line of code that resolves it.
add the conditional ternary expression to the property as well..
virtualNetworkSubnetId: connectToVnet ? existingSubnets.outputs.subnets.sql : ''
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
Beta Was this translation helpful? Give feedback.
It does some like you are running into the issue that #3750 would have caught. It seems your output is dependent on a module being executed, so when it is not, the deployment fails. You probably need to use the ternary operator to conditionally set the value. In order to know for sure, please include a concise repro of the issue.