-
Notifications
You must be signed in to change notification settings - Fork 760
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
Built-in function to sort an array #2251
Comments
We could be sorting arrays of objects with some properties or arrays of primitive types like strings or ints. How do you envision selecting the "key" for sorting the elements of the array? |
I think the scope would be to write a meta sorting algorithm using the existing |
@stan-sz - can you expand on the scenario a bit? JSON arrays are not sorted so the platform won't treat this consistently... Also, as I understand your scenario, I'd just use a different / deterministic seed for the array. |
Here's the detailed scenario: the Microsoft.ContainerRegistry/registries/pipelineRuns is used to transfer OCI artifacts (e.g. docker images, helm charts) from one container registry to another. One of the inputs is an array of to-be-transferred artifacts the other param is the name of the blob where the images will be exported to. The 'receiving' side of this pipeline needs to set the same blob name to trigger the import pipeline to get the images from the blob into the target container registry. Again, Currently a pre-deployment script is used to prepare the ARM parameters file based on user input (if the user wants to transfer a subset of images) to ensure the |
Is your feature request related to a problem? Please describe.
Declarative deployments require consistent inputs for idempotency. I have a bicep template where a part of a blob name is computed using
uniqueString(array)
. I'd like to ensure within the template that the array is always sorted to yield the same results for the same inputs.Describe the solution you'd like
Given that ARM functions already have a defined compare functions, add a
sort(
function that would sort an array. Somewhat related to #2082The text was updated successfully, but these errors were encountered: