-
Notifications
You must be signed in to change notification settings - Fork 14
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
Resources in nested template not shown if reference is used in the parameter values #157
Comments
Basically, what-if short circuits too aggressively when we see a Thanks for reporting! |
@alex-frankel I ran into this one when using modules in bicep. Anything in a module (which translates to a nested deployment) doesn't show up in my whatif result. |
We discussed this today and the root cause of the issue is essentially that as soon as there is one parameter that uses a runtime function in a nested template, we have no good way of ignoring it/throwing it away and evaluating the rest of the template. The reason it is difficult for us because the way we evaluate expressions in an ARM Template is...fragile :) We have some work ongoing to refactor this code to make this easier for us, but no good ETA I can provide. @J0F3 - for your case in particular, you can probably refactor the code to avoid the |
Hi @alex-frankel, I also can confirm that when I'm leaving out any references, that validation shows up all resources I actually want to deploy. And of course, I'm able to set additional variables to "convert" my input parameters, but I also have to waive using ARM/Bicep module outputs as input parameters for other modules, because using outputs is also defined as a reference in ARM. May you have an update when this is gonna be fixed? Thank you very much! |
We are working on this now with the hopes of having it resolved by the end of the calendar year. This is a bit of a gnarly, low level issue so please be patient :) |
FYI - the fix for this has been checked in. Should be deployed sometime in December. |
Very happy to hear this news. Thanks for the update Alex |
Awesome news! Thank you @alex-frankel! |
I guess we will have to wait and see. As described in a previous post, I found a workaround to actually have BUT there is a big problem even if what-if shows a plan. Resources that are “calculated” will show up as being potentially changed on every single deployment. See the following screenshot of a deployment that has NO changes: Because all my environment variables are “calculated,” they show up with the current value in orange and the formula in green. I know the green formular will result in the same value as the orange, so nothing will be changed. But it pollutes the output and makes it next to impossible to see what actual changes will be done. If I was using Terraform and a state file, Terraform would show what changes I did. Have you solved this, so you able to “suppress” a formular that will result in the same output? Also, the screenshot shows that, e.g., So, I fear that when you “fix” this issue, you have an equally big task to get ALL the different Azure ARM Providers updated to behave correctly. But since this issue has been hiding this problem, the different teams do not even know that there is a problem. |
Can't believe this major issue is open for 3+ years and no warnings are built in, people had to search to get here. I did found working workaround for me after several attempt. Where module mod1 'mod1.bicep' = {
name: 'mod1'
}
module mod2 'mod2.bicep' = {
name: 'mod2'
params: {
myConnectionString: mod1.outputs.?myConnectionString ?? '(known after created)'
}
} Combining safe-dereference Hope this helps. |
@tjementum this are examples of the noise problem I was describing and resolving this issue (#157) is not going to solve that problem. We are currently investigating options for making meaningful progress on the noise issue that does not require RP/service team involvement. |
Hi @alex-frankel , |
Hi @alex-frankel. It's October. Was just wondering if you had any updates to share. Thanks. |
Hello Everyone - we are excited to share the deployment of this fix is in progress and we will begin onboarding tenants gradually as soon as the rollout is complete. For those of you interested on getting your tenant onboarded to be able to receive this fix sooner, please fill this survey. We thank you all for the patience! 📎 |
Already full?
|
@jikuja - thank you for catching this. The form is now open to all. |
Hello @azcloudfarmer, can you please provide an update on the status of the rollout? When can we expect all tenants to be onboarded? |
We are blocked on rollout at the moment due to a planned end-of-year deployment freeze for specific high-profile events. Most likely we will only be able to onboard the new tenants in specific regions during November, then all regions in early December. Apologies, as we were not as plugged into the deployment freeze timeline as we should have been. We very much want to get this out ASAP :( |
Is this rolled out already? How can I verify if my tenant already has this upgrade rolled out? I filled the survey to try to get it sooner, but I am not sure that ever happened, I am still getting mostly resource ignored and "going blind" :') |
Sadly, the Azure-wide deployment freeze got extended through all of January. More than likely we won't be able to roll this out until February. Sorry about the delay, but this one is totally out of our control. Thanks everyone for the collective patience. |
Hello, can anybody help check if the issue #388 is related with this one? |
Hi @alex-frankel , what is the ETA for the roll out? |
Would be fantastic if we could get an ETA for the complete rollout. Thanks in advance. |
Hey folks - anyone who signed up via the survey link that @azcloudfarmer shared will be onboarded this week. We will send out an email as soon as your tenant has been onboarded. If you haven't signed up, but would like to opt-in, please fill out this survey. Assuming this initial rollout goes well, we will then share a timeline for rolling this out as the default what-if behavior. |
Hi @alex-frankel we completed the survey form mid-last-week but have not had an onboarding notification and appear to still be affected by the same bug. Could you share an update when you have a moment? Would be appreciated. Thanks. |
Describe the bug
Probably related to #83 but not sure so I though it might worth it to post it here.
To Reproduce
An ARM Template with a nested deployment. The parameter value of the nested deployment uses the
reference
function.When deploying the template with Whatif it shows only the vNet created in the parent template and nothing about the Subnet created in the nested template.
On a re-deployment it gets even more weird. Whatif shows that the subnet gets deleted which is actually not what appends. So very confusing.
When the parameter value is replaced by a literal string the Whatif output is shown the changes correctly. So assume it is also related to the use of the reference function.
ARM Template:
Expected behavior
I would except that the vnet and subnet is shown as 'create' on the first deployment and as 'no change' in subsequent deployment.
Screenshots

First deployment (with reference in parameter value). Subnet is missing in the output:
Re-deployment (with the same template). Subnet is shown as 'delete':

First deployment when the value of the 'vNetName' parameter is stet to a literal string. Both the vnet and the subnet is shown correctly in the output:

Re-deployment (with the same template) show both resource correctly (beside except some noise probably not related to this issue):

Client
PowerShell
Additional context
I noticed quite some of such strange outputs of Whatif during playing with Biceps and Biceps modules as this results in templates with nested deployment where often also the reference function is used. So I thought it will be worth to place it here. But maybe your are already very aver of that? 😊
The text was updated successfully, but these errors were encountered: