Can I partially update an existing object? #3573
-
I'm fairly new to Azure and bicep scripts and am wondering if an imperative approach is better for this use case... I have an existing AKS cluster, and as I add new apps I need to add corresponding entries to the AKS object's podIdentityProfile.userAssignedIdentities array. Is there a way to run a bicep file to incrementally add a new entry without specifying the entire AKS object definition each time, with all of the previous entries included? Or is that just contrary to the notion of a declarative approach, and I should be using the APIs (az, etc) for this kind of thing. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I don't think it's i.e. it's not an easy problem to solve, so I don't believe there is an easy solution or single button to press. Especially currently in relation to Bicep. In theory, with ARM, you can export out the template (from the portal), however that is also no small/easy task (without experience) to make the template re-usable across environments/clusters and then you still don't have Bicep code, so you would need to also decompile the ARM. However, with imperative code, (as you mention) these types of tasks are much easier, since you can generally "do a get", "then a set" OR a "get", "update some property values", then "set", depending on what the resource is and how many properties you need to modify. AZ cli or AZ PowerShell can cover these needs. I would say, don't give up on this 'declarative' process. This is the easiest way to establish a set of templates in the first place and without them you will never really know 'why is my cluster in dev, behaving differently to prod' OR 'how can I roll out these changes to Dev and do testing, so that I am confident when I roll them out to prod, nothing is going to break'. OR 'how can I stand up a new environment, do testing, then delete the resources'. However obviously it's just easier to take exported/decompiled templates and deploy net new, instead of over the top of existing resources, especially if you really want to iterate and refine your templates. Once you have templates standing up environments is much easier, and you can just move faster overall, and change is constant (so the easier you can deal with change, the more stability you have over time). |
Beta Was this translation helpful? Give feedback.
I don't think it's
contrary
... it's just a problem that has not been solved yet.i.e. it's not an easy problem to solve, so I don't believe there is an easy solution or single button to press. Especially currently in relation to Bicep. In theory, with ARM, you can export out the template (from the portal), however that is also no small/easy task (without experience) to make the template re-usable across environments/clusters and then you still don't have Bicep code, so you would need to also decompile the ARM.
However, with imperative code, (as you mention) these types of tasks are much easier, since you can generally "do a get", "then a…