-
Notifications
You must be signed in to change notification settings - Fork 758
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
VN snippet should use nested children for subnets instead of properties/subnets #3499
Comments
Related: #3501 |
Syntactically, I much prefer the recommendation of breaking out subnets into child resources rather than properties, but one thing to be careful with generally with this type of refactor is that it leads to a different pattern of API requests between deployment engine and RP. For children declared as parent properties, ARM will submit a single PUT containing all the data to the RP's /parent endpoint. For children declared as actual child resources, ARM will submit a single PUT without child resource data to the RP's /parent endpoint, followed by a series of PUTs to the RP's /parent/child endpoint for the individual child resources. In an ideal world, we would like RPs to treat both sets of operations as equivalent, however there are RPs that will interpret the latter as "remove all the child resources first, then add them back" - meaning there's a period where a destructive action occurs. The most common examples I'm aware of with this behavior are Microsoft.KeyVault/vaults (with accessPolicies), and Microsoft.Network/networkSecurityGroups (with securityRules). You're probably already aware; just wanted to note this info down for anyone else who might come across this! |
+1 to Anthony's comments. Unfortunately, the current snippet is the less bad one :) If you have resources connected to these subnets and the subnets get redeployed as a child resource, the deployment will fail because NetworkRP will attempt to delete the subnet, which is not allowed if there are currently connected resources. You can use Going to close this for now, but feel free to reopen/continue the discussion. |
Let's discuss at next triage. BTW, I've been doing this transformation in a lot of samples and no one has complained in the code reviews. |
Superseded by #3886 |
Here's the current "res-vnet" snippet output:
You can see the problem with this approach when you go to hook up a NIC:
RECOMMEND: Use this instead:
The text was updated successfully, but these errors were encountered: