Created
June 9, 2018 12:03
-
-
Save justinyoo/0f1bf2d5776717afdb0afc2278b949d7 to your computer and use it in GitHub Desktop.
Separation of Concerns: Logic App from ARM Template
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
$subscriptionId = "[SUBSCRIPTION_ID]" | |
$resourceGroup = "[RESOURCE_GROUP]" | |
$resourceName = "[RESOURCE_NAME]" | |
$connectorName = "[CONNECTOR_NAME]" | |
$apiVersion = "2016-06-01" | |
# Read parameters.json, replace values, and convert it to PSObject | |
$param = (Get-Content parameters.json -Encoding UTF8 -Raw) ` | |
-replace "{subscriptionId}", $subscriptionId ` | |
-replace "{resourceGroup}", $resourceGroup ` | |
-replace "{connectorName}", $connectorName ` | |
-replace "{apiVersion}", $apiVersion | ` | |
ConvertFrom-Json | |
# Read definition.json and convert it to PSObject | |
$definition = Get-Content definition.json -Encoding UTF8 -Raw | ` | |
ConvertFrom-Json | |
# Get Logic App | |
$resource = Get-AzureRmResource ` | |
-ResourceGroupName $resourceGroup ` | |
-ResourceName $resourceName ` | |
-ResourceType Microsoft.Logic/workflows | |
# Update Logic App | |
$resource.Properties.parameters = $param | |
$resource.Properties.definition = $definition | |
$resource | Set-AzureRmResource -Verbose -Force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment