-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProvisionDemoLab.ps1
36 lines (28 loc) · 2.66 KB
/
ProvisionDemoLab.ps1
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
Param(
# Azure subscription ID associated with the Dev/Test lab instance.
[ValidateNotNullOrEmpty()]
[string]
$SubscriptionId,
#Name for the new resource group where the lab will be created
[ValidateNotNullOrEmpty()]
[string]
$ResourceGroupName,
#Location for the resource group to be created. e.g. West US
[ValidateNotNullOrEmpty()]
[string]
$ResourceGroupLocation
)
##################################################################################################
#
# Powershell Configurations
#
# Note: Because the $ErrorActionPreference is "Stop", this script will stop on first failure.
$ErrorActionPreference = "stop"
Write-Host "Login to the subscription with your Azure account..."
Login-AzureRmAccount -SubscriptionId $SubscriptionId
#TODO: Use the line below instead of Login above, once you're authenticated.
#Select-AzureRmSubscription -SubscriptionId $SubscriptionId | Out-Null
"Creating new resource group for the demo lab..."
New-AzureRmResourceGroup -Name $ResourceGroupName -Location $resourceGroupLocation
"Start deploying the demo lab using the ARM templates..."
New-AzureRmResourceGroupDeployment -Name deployS4BLab -ResourceGroupName $ResourceGroupName -TemplateFile .\azuredeploy.json -TemplateParameterFile .\azuredeploy.parameters.json -Verbose