Last active
March 2, 2020 01:39
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "$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