-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdeploy.ps1
More file actions
37 lines (29 loc) · 1.18 KB
/
deploy.ps1
File metadata and controls
37 lines (29 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Import-Module AzureRM
Set-Location $PSScriptRoot
<#
# Run below code to create a PS script containing the vars that we need. This file is being ignored by git so that
# we do not accidentally expose them to Github
@"
$SubscriptionId = 'SUBSCRIPTION_ID'
$TenantId = 'TENANT_ID'
"@ | Out-File ".\vars.ps1"
#>
# dot source the vars file
. ".\vars.ps1"
try {
Select-AzureRmSubscription -SubscriptionId $SubscriptionId | Out-Null
}
catch {
Login-AzureRmAccount -TenantId $TenantId
}
Select-AzureRmSubscription -SubscriptionId $SubscriptionId | Out-Null
$ResourceGroupName = 'rg81e35VYltTU3'
$Location = 'northeurope'
$TemplateParameterObject = @{
siteName = 'siteB8jHNFN8wusv'
Location = $Location
repoUrl = 'https://github.com/MortenMeisler/AzureAutomationFormGenerator'
}
New-AzureRmResourceGroup -Name $ResourceGroupName -Location $Location -Force | Out-Null
Test-AzureRmResourceGroupDeployment -ResourceGroupName $ResourceGroupName -TemplateFile ".\azuredeploy.json" -TemplateParameterObject $TemplateParameterObject
New-AzureRmResourceGroupDeployment -ResourceGroupName $ResourceGroupName -TemplateFile ".\azuredeploy.json" -TemplateParameterObject $TemplateParameterObject