Last active
June 18, 2020 11:28
-
-
Save justinyoo/53a5c751808161187b69e35c10b3b481 to your computer and use it in GitHub Desktop.
Writing ARM Templates in YAML
This file contains 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/2015-01-01/deploymentTemplate.json#' | |
contentVersion: 1.0.0.0 | |
parameters: | |
logicAppName1: | |
type: string | |
metadata: | |
description: Name of the Logic App. | |
logicAppName2: | |
type: string | |
metadata: | |
description: Name of the Logic App. | |
variables: | |
logicApp: | |
name: "[concat(parameters('logicAppName1'), '-', parameters('logicAppName2'))]" | |
apiVersion: "[providers('Microsoft.Logic', 'workflows').apiVersions[0]]" | |
location: '[resourceGroup().location]' | |
tags: | |
author: Justin Yoo | |
profile: 'https://twitter.com/justinchronicle' | |
projectUrl: 'https://github.com/devkimchi/ARM-Templates-in-YAML' | |
repositoryUrl: 'https://github.com/devkimchi/ARM-Templates-in-YAML' | |
license: 'https://raw.githubusercontent.com/devkimchi/ARM-Templates-in-YAML/master/LICENSE' | |
resources: | |
- apiVersion: "[variables('logicApp').apiVersion]" | |
type: Microsoft.Logic/workflows | |
name: "[variables('logicApp').name]" | |
location: "[variables('logicApp').location]" | |
tags: "[variables('tags')]" | |
properties: | |
state: Enabled | |
parameters: {} | |
definition: | |
$schema: 'https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#' | |
contentVersion: 1.0.0.0 | |
parameters: {} | |
triggers: {} | |
actions: {} | |
outputs: {} | |
outputs: | |
subscriptionId: | |
type: string | |
value: '[subscription().subscriptionId]' | |
resourceGroup: | |
type: string | |
value: '[resourceGroup().name]' |
This file contains 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
$directory = "$(Build.SourcesDirectory)" | |
$yarmpath = "$(System.DefaultWorkingDirectory)\yarm-cli\yarm.cmd" | |
$targetdir = "$(Build.SourcesDirectory)" | |
Get-ChildItem -Path $directory -Recurse -Include *.yaml | ` | |
ForEach { & $yarmpath -i $_.FullName -o "$targetdir\$($_.Name)".Replace(".yaml", ".json") } |
This file contains 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
$script = Invoke-WebRequest https://raw.githubusercontent.com/TeamYARM/YARM-CLI/master/Download-Latest.ps1 | |
$argList = "win-x64", "$(System.DefaultWorkingDirectory)\yarm-cli" | |
Invoke-Command -ScriptBlock ([scriptblock]::Create($script.Content)) -ArgumentList $argList |
This file contains 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
yarm -i azuredeploy.yaml -o azuredeploy.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment