forked from fullscale180/PAN
-
Notifications
You must be signed in to change notification settings - Fork 1
/
azureDeploy.ps1
38 lines (30 loc) · 1.72 KB
/
azureDeploy.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
#-----------------------------------------------------
# Authenticate
#-----------------------------------------------------
Login-AzureRmAccount
#-----------------------------------------------------
# Select the Subscription by subscriptionId or by Tenant Id
#-----------------------------------------------------
Get-AzureRmSubscription -SubscriptionName "Visual Studio Enterprise" | Select-AzureRMSubscription
#-----------------------------------------------------
# Create a new deployment
#-----------------------------------------------------
$location = "westus2"
$deployName = "AzureDeploy"
$projectpath = "D:\All Projects\FS180 Clients\PAN"
#-----------------------------------------------------
# Deploy an outbound firewall using parameter file
#-----------------------------------------------------
$infaRGName = "DATEST"
$templateFile = "$projectPath\azureDeployInfra.json"
$parameterObject = @{"storageName" = "dapanstorage"; "mgmtPublicIPDns" = "dapanmgmt"}
$rg = New-AzureRMResourceGroup -name $infaRGName -location $location
New-AzureRMResourceGroupDeployment -ResourceGroupName $infaRGName -Name $deployName -TemplateFile $templateFile -TemplateParameterObject $parameterObject
#-----------------------------------------------------
# Deploy inbound firewall and backend for app1 use parameter file
#-----------------------------------------------------
$appRGName = "DAAPP1"
$templateFile = "$projectPath\azureDeployApp.json"
$parameterObject = @{ "appPrefix" = "a1"; "virtualNetworkRG" = $infaRGName}
$rg = New-AzureRMResourceGroup -name $appRGName -location $location
New-AzureRMResourceGroupDeployment -ResourceGroupName $appRGName -Name $deployName -TemplateFile $templateFile -TemplateParameterObject $parameterObject