Skip to content

Commit 602ab57

Browse files
authored
Merge pull request #211589 from mumian/0916-object-sort
JSON object sorting
2 parents 21b2043 + 8aee5bd commit 602ab57

File tree

8 files changed

+37
-7
lines changed

8 files changed

+37
-7
lines changed

articles/azure-resource-manager/bicep/bicep-functions-object.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ The example returns:
274274
}
275275
```
276276

277-
The items() function sorts the objects in the alphabetical order. For example, **item001** appears before **item002** in the outputs of the two preceding samples.
277+
[!INCLUDE [JSON object ordering](../../../includes/resource-manager-object-ordering-bicep.md)]
278278

279279
<a id="json"></a>
280280

articles/azure-resource-manager/bicep/data-types.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Data types in Bicep
33
description: Describes the data types that are available in Bicep
44
ms.topic: conceptual
5-
ms.date: 07/06/2022
5+
ms.date: 09/16/2022
66
---
77

88
# Data types in Bicep
@@ -157,6 +157,8 @@ var environmentSettings = {
157157
output accessorResult string = environmentSettings['dev'].name
158158
```
159159

160+
[!INCLUDE [JSON object ordering](../../../includes/resource-manager-object-ordering-bicep.md)]
161+
160162
## Strings
161163

162164
In Bicep, strings are marked with singled quotes, and must be declared on a single line. All Unicode characters with code points between *0* and *10FFFF* are allowed.

articles/azure-resource-manager/bicep/outputs.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Outputs in Bicep
33
description: Describes how to define output values in Bicep
44
ms.topic: conceptual
5-
ms.date: 02/20/2022
5+
ms.date: 09/16/2022
66
---
77

88
# Outputs in Bicep
@@ -143,6 +143,10 @@ az deployment group show \
143143

144144
---
145145

146+
## Object sorting in outputs
147+
148+
[!INCLUDE [JSON object ordering](../../../includes/resource-manager-object-ordering-bicep.md)]
149+
146150
## Next steps
147151

148152
* To learn about the available properties for outputs, see [Understand the structure and syntax of Bicep](./file.md).

articles/azure-resource-manager/templates/data-types.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Describes the data types that are available in Azure Resource Manag
44
ms.topic: conceptual
55
ms.author: tomfitz
66
author: tfitzmac
7-
ms.date: 06/27/2022
7+
ms.date: 09/16/2022
88
---
99

1010
# Data types in ARM templates
@@ -149,6 +149,8 @@ You can get a property from an object with dot notation.
149149
}
150150
```
151151

152+
[!INCLUDE [JSON object ordering](../../../includes/resource-manager-object-ordering-arm-template.md)]
153+
152154
## Strings
153155

154156
Strings are marked with double quotes.

articles/azure-resource-manager/templates/outputs.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Outputs in templates
33
description: Describes how to define output values in an Azure Resource Manager template (ARM template).
44
ms.topic: conceptual
5-
ms.date: 01/19/2022
5+
ms.date: 09/16/2022
66
ms.custom: devx-track-azurepowershell
77
---
88

@@ -145,6 +145,10 @@ az deployment group show \
145145

146146
---
147147

148+
## Object sorting in outputs
149+
150+
[!INCLUDE [JSON object ordering](../../../includes/resource-manager-object-ordering-arm-template.md)]
151+
148152
## Next steps
149153

150154
* To learn about the available properties for outputs, see [Understand the structure and syntax of ARM templates](./syntax.md).

articles/azure-resource-manager/templates/template-functions-object.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Template functions - objects
33
description: Describes the functions to use in an Azure Resource Manager template (ARM template) for working with objects.
44
ms.topic: conceptual
5-
ms.date: 05/09/2022
5+
ms.date: 09/16/2022
66
---
77

88
# Object functions for ARM templates
@@ -301,7 +301,7 @@ The example returns:
301301
}
302302
```
303303

304-
The items() function sorts the objects in the alphabetical order. For example, **item001** appears before **item002** in the outputs of the two preceding samples.
304+
[!INCLUDE [JSON object ordering](../../../includes/resource-manager-object-ordering-arm-template.md)]
305305

306306
<a id="json"></a>
307307

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
author: mumian
3+
ms.service: azure-resource-manager
4+
ms.topic: include
5+
ms.date: 09/16/2022
6+
ms.author: jgao
7+
---
8+
9+
In JSON, an object is an unordered collection of zero or more key/value pairs. The ordering can be different depending on the implementations. For example, the Bicep [items()](../articles/azure-resource-manager/templates/template-functions-object.md#items) function sorts the objects in the alphabetical order. In other places, the original ordering can be preserved. Because of this non-determinism, avoid making any assumptions about the ordering of object keys when writing code, which interacts with deployments parameters & outputs.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
author: mumian
3+
ms.service: azure-resource-manager
4+
ms.topic: include
5+
ms.date: 09/16/2022
6+
ms.author: jgao
7+
---
8+
9+
In JSON, an object is an unordered collection of zero or more key/value pairs. The ordering can be different depending on the implementations. For example, the Bicep [items()](../articles/azure-resource-manager/bicep/bicep-functions-object.md#items) function sorts the objects in the alphabetical order. In other places, the original ordering can be preserved. Because of this non-determinism, avoid making any assumptions about the ordering of object keys when writing code, which interacts with deployments parameters & outputs.

0 commit comments

Comments
 (0)