Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
These functions can be used with collections, like JSON strings, arrays and objects.
Returns true
if a string contains the specified substring, an array contains the specified value, or an object contains the specified key.
The following example returns true
:
"[contains('webapp', 'web')]"
Assume element1
returns [1, 2, 3]
. The following example returns false
:
"[contains(steps('demoStep').element1, 4)]"
Assume element1
returns:
{
"key1": "Linux",
"key2": "Windows"
}
The following example returns true
:
"[contains(steps('demoStep').element1, 'key1')]"
Returns true
if the string, array, or object is null or empty.
The following example returns true
:
"[empty('')]"
Assume element1
returns [1, 2, 3]
. The following example returns false
:
"[empty(steps('demoStep').element1)]"
Assume element1
returns:
{
"key1": "Linux",
"key2": "Windows"
}
The following example returns false
:
"[empty(steps('demoStep').element1)]"
Assume element1
is null
or undefined. The following example returns true
:
"[empty(steps('demoStep').element1)]"
Returns a new array after applying the filtering logic provided as a lambda function. The first parameter is the array to use for filtering. The second parameter is the lambda function that specifies the filtering logic.
The following sample returns the array [ { "name": "abc" } ]
.
"[filter(parse('[{\"name\":\"abc\"},{\"name\":\"xyz\"}]'), (item) => contains(item.name, 'abc'))]"
Returns the first character of the specified string; first value of the specified array; or the first key and value of the specified object.
The following example returns "c"
:
"[first('contoso')]"
Assume element1
returns [1, 2, 3]
. The following example returns 1
:
"[first(steps('demoStep').element1)]"
Assume element1
returns:
{
"key1": "Linux",
"key2": "Windows"
}
The following example returns {"key1": "Linux"}
:
"[first(steps('demoStep').element1)]"
Returns the last character of the specified string, the last value of the specified array, or the last key and value of the specified object.
The following example returns "o"
:
"[last('contoso')]"
Assume element1
returns [1, 2, 3]
. The following example returns 3
:
"[last(steps('demoStep').element1)]"
Assume element1
returns:
{
"key1": "Linux",
"key2": "Windows"
}
The following example returns {"key2": "Windows"}
:
"[last(steps('demoStep').element1)]"
Returns the number of characters in a string, the number of values in an array, or the number of keys in an object.
The following example returns 7
:
"[length('Contoso')]"
Assume element1
returns [1, 2, 3]
. The following example returns 3
:
"[length(steps('demoStep').element1)]"
Assume element1
returns:
{
"key1": "Linux",
"key2": "Windows"
}
The following example returns 2
:
"[length(steps('demoStep').element1)]"
Returns a new array after calling a lambda function on a provided array. The first parameter is the array to use for the lambda function. The second parameter is the lambda function.
The following sample returns a new array with every value doubled. The result is [2, 4, 6]
.
"[map(parse('[1, 2, 3]'), (item) => mul(2, item))]"
The following sample returns a new array ["abc", "xyz"]
.
"[map(parse('[{\"name\":\"abc\"},{\"name\":\"xyz\"}]'), (item) => item.name)]"
Bypasses a specified number of elements in a collection, and then returns the remaining elements.
The following example returns "app"
:
"[skip('webapp', 3)]"
Assume element1
returns [1, 2, 3]
. The following example returns [3]
:
"[skip(steps('demoStep').element1, 2)]"
Assume element1
returns:
{
"key1": "Linux",
"key2": "Windows"
}
The following example returns {"key2": "Windows"}
:
"[skip(steps('demoStep').element1, 1)]"
Returns an array of strings containing the substrings of the input delimited by the separator.
The following sample returns the array [ "555", "867", "5309" ]
.
"[split('555-867-5309', '-')]"
Returns a specified number of contiguous characters from the start of the string, a specified number of contiguous values from the start of the array, or a specified number of contiguous keys and values from the start of the object.
The following example returns "web"
:
"[take('webapp', 3)]"
Assume element1
returns [1, 2, 3]
. The following example returns [1, 2]
:
"[take(steps('demoStep').element1, 2)]"
Assume element1
returns:
{
"key1": "Linux",
"key2": "Windows"
}
The following example returns {"key1": "Linux"}
:
"[take(steps('demoStep').element1, 1)]"
- For an introduction to Azure Resource Manager, see Azure Resource Manager overview.