-
Notifications
You must be signed in to change notification settings - Fork 759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
condition makes the resource not included in template.json #5461
Comments
I'm not sure if I am following what the issue is. Can you include the generated JSON and where you see a problem? Is this also causing an undesirable behavior in the deployment? IOW, even if the JSON does not look the way you expect, is the final deployment result incorrect/failing? |
Hi Alex, that will be hard, the code advanced already to make it work. I did however change the script so you can run the az bicep build command on the example. the container resource has parent: deployServerlessCosmosDb? PassDb: QPDB Run az bicep build on template below, and the created JSON ARM template won't have the container resource.
|
Got it. I am able to repro. I'm actually surprised that this compiles without errors in the first place. I didn't think conditionally setting the parent was allowed because we need to be able to generate full resource IDs at the start of the deployment.. We will take a look. |
Ok, thanks for the response. Is there a reasonable solution without having to duplicate the collection? |
No, I think you will need two instances of the |
I think that this is most likely something we are missing validation for. We should either:
|
Leaving this item open to track adding actual support for expressions in the parent property. Created #7154 to track adding validation to block the unsafe behavior. |
Bicep version
0.4.1008
Describe the bug
Given the following template, when param deployServerlessCosmosDb is true, then the container is not scripted into the json template. How can I reconstruct this to have it included without having to duplicate?
The text was updated successfully, but these errors were encountered: