Skip to content

Commit 1a58a41

Browse files
committed
Quickstart function sample demo
1 parent 2ac5e89 commit 1a58a41

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,34 @@ The output from the preceding example with the default values is:
5454
| stringOutput | Array | ["efgh"] |
5555
| objectOutput | Array | [{"a": "b", "c": "d"}] |
5656

57+
The following example is extracted from a quickstart template, [SQL Server VM with performance optimized storage settings
58+
](https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.sqlvirtualmachine/sql-vm-new-storage):
59+
60+
```bicep
61+
@description('Amount of data disks (1TB each) for SQL Data files')
62+
@minValue(1)
63+
@maxValue(8)
64+
param sqlDataDisksCount int = 1
65+
66+
@description('Amount of data disks (1TB each) for SQL Log files')
67+
@minValue(1)
68+
@maxValue(8)
69+
param sqlLogDisksCount int = 1
70+
71+
var dataDisksLuns = array(range(0, sqlDataDisksCount))
72+
var logDisksLuns = array(range(sqlDataDisksCount, sqlLogDisksCount))
73+
74+
output array1 array = dataDisksLuns
75+
output array2 array = logDisksLuns
76+
```
77+
78+
The output from the preceding example with the default values is:
79+
80+
| Name | Type | Value |
81+
| ---- | ---- | ----- |
82+
| array1 | Array | [0] |
83+
| array2 | Array | [1] |
84+
5785
## concat
5886

5987
`concat(arg1, arg2, arg3, ...)`

0 commit comments

Comments
 (0)