Skip to content

Instantly share code, notes, and snippets.

@dzeyelid
Last active March 2, 2020 01:39
Show Gist options
  • Select an option

  • Save dzeyelid/f0f408c817b199482e9465ab1c2f8297 to your computer and use it in GitHub Desktop.

Select an option

Save dzeyelid/f0f408c817b199482e9465ab1c2f8297 to your computer and use it in GitHub Desktop.
ARM template sample of a combine with user-defined functions and multi-line syntax. It's more readable. When you run this template with Azure CLI, you should apply `--handle-extended-json-format` option.
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {
"settings": "[
createArray(
setting.create('serviceA', bool('true')),
setting.create('serviceB', bool('false'))
)
]"
},
"resources": [],
"outputs": {
"settings": {
"type": "array",
"value": "[variables('settings')]"
}
},
"functions": [
{
"namespace": "setting",
"members": {
"create": {
"parameters": [
{
"name": "name",
"type": "string"
},
{
"name": "enabled",
"type": "bool"
}
],
"output": {
"type": "object",
"value": {
"serviceName": "[parameters('name')]",
"serviceEnabled": "[parameters('enabled')]"
}
}
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment