forked from TerraformingCloud/tf-cicd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
adhoc.azcli
26 lines (12 loc) · 1.12 KB
/
adhoc.azcli
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
# Run adhoc commands with AzCLI
az login --use-device-code
# Vnet Peering
az group create --name Vnet1-rg --location East US
az group create --name Vnet2-rg --location South India
az network vnet create --name vnet1 --resource-group Vnet1-rg --address-prefixes 10.0.0.0/16 --subnet-name Web --subnet-prefixes 10.0.1.0/24
az network vnet create --name vnet2 --resource-group Vnet2-rg --address-prefixes 172.16.0.0/16 --subnet-name DB --subnet-prefixes 172.16.1.0/24
az network vnet peering create --name vnet1-vnet2-peer -g Vnet1-rg --vnet-name vnet1 --remote-vnet /subscriptions/fbb5d319-cf63-46d2-8172-6d25507c4d57/resourceGroups/Vnet2-rg/providers/Microsoft.Network/virtualNetworks/vnet2 --allow-vnet-access
az network vnet peering create --name vnet2-vnet1-peer -g Vnet2-rg --vnet-name vnet2 --remote-vnet /subscriptions/fbb5d319-cf63-46d2-8172-6d25507c4d57/resourceGroups/Vnet1-rg/providers/Microsoft.Network/virtualNetworks/vnet1 --allow-vnet-access
az network vnet delete --name vnet1 --resource-group Vnet1-rg
az network vnet delete --name vnet2 --resource-group Vnet2-rg
az group delete --name NetworkWatcherRG --yes