-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVNET_Template_Customer.ps1
More file actions
59 lines (49 loc) · 2.03 KB
/
Copy pathVNET_Template_Customer.ps1
File metadata and controls
59 lines (49 loc) · 2.03 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<#
Before execuitng commands from this script to build an Azure Cloud shell VNET, The following
resource providers must be registered in your subscription:
- Microsoft.CloudShell
- Microsoft.ContainerInstances
- Microsoft.Relay
You can learn more about registering resource providers and gathering the required information for your unique environment here:
https://learn.microsoft.com/en-us/azure/cloud-shell/vnet/deployment#1-register-resource-providers
#>
# Resource Group
$rg = @{
Name = "<- Your Value Here ->"
Location = "<- Your Value Here ->"
}
New-AzResourceGroup @rg
# Virtual Netowrk
$vnet = @{
name = "<- Your Value Here ->"
location = "<- Your Value Here ->"
resourceGroupName = "<- Your Value Here ->"
addressPrefix = "<- Your Value Here ->"
}
New-AzVirtualNetwork @vnet
# Network template
$subnet = @{
ResourcegroupName = "<- Your Value Here ->"
TemplateURI = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/demos/cloud-shell-vnet/azuredeploy.json"
existingVNETName = "<- Your Value Here ->"
relayNamespaceName = "<- Your Value Here ->"
azureContainerInstanceOID = (Get-AzADServicePrincipal -DisplayNameBeginsWith 'Azure Container Instance').id
containerSubnetName = "container-subnet1"
containerSubnetAddressPrefix = "<- Your Value Here ->"
relaySubnetName = "relay-subnet1"
relaySubnetAddressPrefix = "<- Your Value Here ->"
storageSubnetName = "storage-subnet1"
storageSubnetAddressPrefix = "<- Your Value Here ->"
nsgname = "<- Your Value Here ->"
}
New-AzResourceGroupDeployment @subnet
# Storage
$storage = @{
ResourcegroupName = "<- Your Value Here ->"
TemplateURI = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/demos/cloud-shell-vnet-storage/azuredeploy.json"
existingVNETName = "<- Your Value Here ->"
existingStorageSubnetName = "storage-subnet1"
existingContainerSubnetName = "container-subnet1"
storageAccountName = "<- Your Value Here ->"
}
New-AzResourceGroupDeployment @storage