Observação
O acesso a essa página exige autorização. Você pode tentar entrar ou alterar diretórios.
O acesso a essa página exige autorização. Você pode tentar alterar os diretórios.
可以使用这些函数在 JSON 数据类型和编码之间转换值。
布尔
将参数转换为布尔值。 此函数支持数字、字符串和布尔类型的参数。 类似于 JavaScript 中的布尔值,除或'false'返回true之外0的任何值。
以下示例返回 true:
"[bool(1)]"
以下示例返回 false:
"[bool(0)]"
以下示例返回 true:
"[bool(true)]"
以下示例返回 true:
"[bool('true')]"
decodeBase64
从 base-64 编码字符串解码参数。 此函数仅支持字符串类型的参数。
以下示例返回 "Contoso":
"[decodeBase64('Q29udG9zbw==')]"
decodeUriComponent
从 URL 编码字符串解码参数。 此函数仅支持字符串类型的参数。
以下示例返回 "https://portal.azure.cn/":
"[decodeUriComponent('https%3A%2F%2Fportal.azure.cn%2F')]"
encodeBase64
将参数编码为 base-64 编码字符串。 此函数仅支持字符串类型的参数。
以下示例返回 "Q29udG9zbw==":
"[encodeBase64('Contoso')]"
encodeUriComponent
将参数编码为 URL 编码字符串。 此函数仅支持字符串类型的参数。
以下示例返回 "https%3A%2F%2Fportal.azure.cn%2F":
"[encodeUriComponent('https://portal.azure.cn/')]"
漂浮
将参数转换为浮点。 此函数支持数字和字符串类型的参数。
以下示例返回 1.0:
"[float('1.0')]"
以下示例返回 2.9:
"[float(2.9)]"
整数 (int)
将参数转换为整数。 此函数支持数字和字符串类型的参数。
以下示例返回 1:
"[int('1')]"
以下示例返回 2:
"[int(2.9)]"
解析
将参数转换为本机类型。 换句话说,此函数是反函数。string() 此函数仅支持字符串类型的参数。
以下示例返回 1:
"[parse('1')]"
以下示例返回 true:
"[parse('true')]"
以下示例返回 [1,2,3]:
"[parse('[1,2,3]')]"
以下示例返回 {"type":"webapp"}:
"[parse('{\"type\":\"webapp\"}')]"
字符串
将参数转换为字符串。 此函数支持所有 JSON 数据类型的参数。
以下示例返回 "1":
"[string(1)]"
以下示例返回 "2.9":
"[string(2.9)]"
以下示例返回 "[1,2,3]":
"[string([1,2,3])]"
以下示例返回 "{"type":"webapp"}":
"[string({\"type\":\"webapp\"})]"
后续步骤
- 有关 Azure 资源管理器的简介,请参阅 Azure 资源管理器概述。