Azure / Azure/bicep

Allow parent resources to be redeployed while leaving their child resources alone

Open
#6,755 4 comments 0 reactions 0 assignees View on GitHub
provider bug
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

**Is your feature request related to a problem? Please describe.**
Whenever I redeploy a VNET using Azure Bicep, it will clear out all subnets in the VNET that are not explicitly listed in the VNET resource definition. This prevents me from partitioning my resource definitions into logical groups that can be separately deployed (and redeployed), which is a common strategy with infrastructure as code approaches. (For reference, see, e.g., the "stack" patterns from the "Infrastructure as Code" book by Kief Morris.)

There is a similar situation with AKS cluster deployments, which require details about all node pools.

This has also been discussed in https://github.com/Azure/bicep/issues/4023#issuecomment-995697660, but I'm creating a new issue because #4023 originally came from a different angle.

I also want to mention #5806 (which I created), which is also from a slightly different perspective, but might show there are different issues that all relate to the higher goal of being able to partition infrastructure definitions into smaller units.

**Describe the solution you'd like**
I would like to have a way to define a resource in such a way that the Azure Resource Manager will either leave existing child resources alone, if any, or merge them with what I have declared.

In https://github.com/Azure/bicep/issues/4023#issuecomment-1024456195, an `upsert` modifier was mentioned, this would work well.
An alternative would be a `merge` keyword as mentioned in #5806.

Contributor guide

Open the contributing guide

Research direction

Review the related discussions in #4023 and #5806 first, focusing on the proposed `upsert` and `merge` semantics. Use the VNET subnet and AKS node pool examples to define the expected behavior for undeclared child resources; done means the scope and behavior are settled for parent redeployments.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.