-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDeploy-Resources.ps1
15 lines (11 loc) · 942 Bytes
/
Deploy-Resources.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Get the information about the role and convert it to json
$Role = Get-Content "$PSScriptRoot\Roles\Create-Deployment-Scripts.json" -Raw
Write-Host "Deploy Managed idenitity"
$templateoutput = New-AzSubscriptionDeployment -Name "deploy_mid" -TemplateFile "$PSScriptRoot\ArmTemplates\deploy_mid.json" -roleJson $Role -Location "westeurope"
$midOutput = ConvertTo-Json $templateoutput.Outputs
# Get the information about the policy and convert it to json
$Policy = Get-Content "$PSScriptRoot\Policies\TagLoadbalancedVMs.json" -Raw
# Get the script in json format
$Script = .$PSScriptRoot\Scripts\ConvertTo-ScriptJson.ps1 -Path (Join-Path -Path $PSScriptRoot -Childpath 'Scripts\Set-VmTag.ps1')
Write-Host "Deploy Policy"
$templateoutput = New-AzSubscriptionDeployment -Name "deploy_policy" -TemplateFile "$PSScriptRoot\ArmTemplates\deploy_policy.json" -midOutput $midOutput -policyJson $Policy -tagScriptJson $Script -Location "westeurope"