Add code for properly handling bicep parameters#1805
Open
Conversation
zentron
approved these changes
Feb 25, 2026
|
|
||
| var result = new JObject(); | ||
|
|
||
| foreach (var kvp in parameterKeyValuePairs) |
Contributor
There was a problem hiding this comment.
Minor stylistic nit, not a blocker.
You're using Linq to partly transform and allocate a list above, and then just iterating over it here to put it into a JObject.
Id consider either doing it all in a single Linq expression, or even simpler and just do it all in a singer foreach iterator.
| static JToken ParseStringOrObject(string value) | ||
| { | ||
| var trimmed = value.Trim(); | ||
| if (trimmed.StartsWith("{") && trimmed.EndsWith("}")) |
Contributor
There was a problem hiding this comment.
Yeah, not nice but I get why its needed.
To confirm, there's no way to distinguish from the parameter type what is a string and what is an object (where the object needs the parsing and string remains as-is regardless of curly braces)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Recent andon cord pull (https://slipway.octopushq.com/software-products/OctopusServer/problems/SoftwareReleaseProblems-9261) was the result of differnt way Octopus/Calamari/SPF attemopt to handle parameters.
ARM Templates are heavily processed on the Server side which seems a problematic approach long term.
SPF has everything morphed into JSON through multiple serialise/deserialise calls within Calamari
This PR attempts to handle the manangement of variables sent directly from Octopus and p[rocessed specifically for Bicep template deployment.