├── lab02
├── iometer.zip
├── ConfigureVM.ps1.zip
├── Lab02Start.ps1.zip
├── RGCleanup.ps1.zip
├── azuredeploy.parameters.json
├── Readme.md
├── RGCleanup.ps1
└── azuredeploy.json
├── lab03
├── PortQryUI.zip
├── ConfigureBE1.zip
├── ConfigureFE1.zip
├── azuredeploy.parameters.json
├── AZVPNConnectionConfig.ps1
├── RRASConfig.ps1
├── RGCleanup.ps1
├── Readme.md
├── start.azuredeploy.nsg.json
├── Lab03Start.ps1
└── azuredeploy.json
├── lab04
├── Lab04Cleanup.ps1
├── ConfigurePsVM.ps1
├── ConfigurePsVM.zip
├── ConfigureSourceVM.zip
├── azuredeploy.parameters.json
├── AzureNetwork.netcfg
├── ConfigureSourceVM.ps1
├── Lab04Start.ps1
└── azuredeploy.json
├── Solutions
├── Readme.md
├── Lab01
│ └── 101-simple-windows-vm
│ │ ├── azuredeploy.parameters.json
│ │ └── azuredeploy.json
├── Lab02
│ └── azuredeploy-premstorage.json
└── Lab03
│ └── azuredeploy.nsg.json
├── Manuals
├── Lab5-DesigningIdentitySolutions-AAD.pdf
├── Lab3-DesignAzureNetworkingForAdvSecurity.pdf
├── Lab1-DeployAzureResourcesUsingARMTemplates.pdf
├── Lab2-DesignAzureStorageAndComputeInfrastructure.pdf
└── Lab4-DesignOnPremisesSiteRecoveryAndMigrationUsingASR-Final.v2.pdf
├── .gitattributes
├── lab01
├── 101-simple-windows-vm
│ ├── azuredeploy.parameters.json
│ └── azuredeploy.json
├── RGCleanup.ps1
└── Lab01Start.ps1
└── .gitignore
/lab02/iometer.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AZITCAMP/Labfiles/HEAD/lab02/iometer.zip
--------------------------------------------------------------------------------
/lab03/PortQryUI.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AZITCAMP/Labfiles/HEAD/lab03/PortQryUI.zip
--------------------------------------------------------------------------------
/lab03/ConfigureBE1.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AZITCAMP/Labfiles/HEAD/lab03/ConfigureBE1.zip
--------------------------------------------------------------------------------
/lab03/ConfigureFE1.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AZITCAMP/Labfiles/HEAD/lab03/ConfigureFE1.zip
--------------------------------------------------------------------------------
/lab04/Lab04Cleanup.ps1:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AZITCAMP/Labfiles/HEAD/lab04/Lab04Cleanup.ps1
--------------------------------------------------------------------------------
/lab02/ConfigureVM.ps1.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AZITCAMP/Labfiles/HEAD/lab02/ConfigureVM.ps1.zip
--------------------------------------------------------------------------------
/lab02/Lab02Start.ps1.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AZITCAMP/Labfiles/HEAD/lab02/Lab02Start.ps1.zip
--------------------------------------------------------------------------------
/lab02/RGCleanup.ps1.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AZITCAMP/Labfiles/HEAD/lab02/RGCleanup.ps1.zip
--------------------------------------------------------------------------------
/lab04/ConfigurePsVM.ps1:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AZITCAMP/Labfiles/HEAD/lab04/ConfigurePsVM.ps1
--------------------------------------------------------------------------------
/lab04/ConfigurePsVM.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AZITCAMP/Labfiles/HEAD/lab04/ConfigurePsVM.zip
--------------------------------------------------------------------------------
/lab04/ConfigureSourceVM.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AZITCAMP/Labfiles/HEAD/lab04/ConfigureSourceVM.zip
--------------------------------------------------------------------------------
/Solutions/Readme.md:
--------------------------------------------------------------------------------
1 | # AZURE ITPRO Camp Solution Files
2 |
3 | This folder contains the solution files for the labs.
4 |
5 |
--------------------------------------------------------------------------------
/Manuals/Lab5-DesigningIdentitySolutions-AAD.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AZITCAMP/Labfiles/HEAD/Manuals/Lab5-DesigningIdentitySolutions-AAD.pdf
--------------------------------------------------------------------------------
/Manuals/Lab3-DesignAzureNetworkingForAdvSecurity.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AZITCAMP/Labfiles/HEAD/Manuals/Lab3-DesignAzureNetworkingForAdvSecurity.pdf
--------------------------------------------------------------------------------
/Manuals/Lab1-DeployAzureResourcesUsingARMTemplates.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AZITCAMP/Labfiles/HEAD/Manuals/Lab1-DeployAzureResourcesUsingARMTemplates.pdf
--------------------------------------------------------------------------------
/Manuals/Lab2-DesignAzureStorageAndComputeInfrastructure.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AZITCAMP/Labfiles/HEAD/Manuals/Lab2-DesignAzureStorageAndComputeInfrastructure.pdf
--------------------------------------------------------------------------------
/Manuals/Lab4-DesignOnPremisesSiteRecoveryAndMigrationUsingASR-Final.v2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AZITCAMP/Labfiles/HEAD/Manuals/Lab4-DesignOnPremisesSiteRecoveryAndMigrationUsingASR-Final.v2.pdf
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
--------------------------------------------------------------------------------
/lab01/101-simple-windows-vm/azuredeploy.parameters.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
3 | "contentVersion": "1.0.0.0",
4 | "parameters": {
5 | "newStorageAccountName": {
6 | "value": "myStorageAccount"
7 | },
8 | "adminUsername": {
9 | "value": "admin123"
10 | },
11 | "adminPassword": {
12 | "value": "ADmin123_!"
13 | },
14 | "dnsNameForPublicIP": {
15 | "value": "myDnsName"
16 | }
17 | }
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/lab03/azuredeploy.parameters.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
3 | "contentVersion": "1.0.0.0",
4 | "parameters": {
5 | "storageAccount": {
6 | "value": "myStorageAccount"
7 | },
8 | "adminUsername": {
9 | "value": "ITCampAdmin"
10 | },
11 | "publicDNSName": {
12 | "value": "myDnsName"
13 | },
14 | "assetlocation": {
15 | "value": "https://github.com/AZITCAMP/Labfiles/raw/master"
16 | }
17 | }
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/lab04/azuredeploy.parameters.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
3 | "contentVersion": "1.0.0.0",
4 | "parameters": {
5 | "storageAccount": {
6 | "value": "myStorageAccount"
7 | },
8 | "adminUsername": {
9 | "value": "ITCampAdmin"
10 | },
11 | "publicDNSName": {
12 | "value": "myDnsName"
13 | },
14 | "assetlocation": {
15 | "value": "https://github.com/AZITCAMP/Labfiles/raw/master"
16 | }
17 | }
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/Solutions/Lab01/101-simple-windows-vm/azuredeploy.parameters.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
3 | "contentVersion": "1.0.0.0",
4 | "parameters": {
5 | "newStorageAccountName": {
6 | "value": "dmgstore1"
7 | },
8 | "adminUsername": {
9 | "value": "admin123"
10 | },
11 | "adminPassword": {
12 | "value": "Passw0rd!"
13 | },
14 | "dnsNameForPublicIP": {
15 | "value": "dmg6685"
16 | },
17 | "location": {
18 | "value": "West US"
19 | },
20 | "sizeOfDiskInGB": {
21 | "value": "20"
22 | }
23 | }
24 | }
25 |
26 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Windows image file caches
2 | Thumbs.db
3 | ehthumbs.db
4 |
5 | # Folder config file
6 | Desktop.ini
7 |
8 | # Recycle Bin used on file shares
9 | $RECYCLE.BIN/
10 |
11 | # Windows Installer files
12 | *.cab
13 | *.msi
14 | *.msm
15 | *.msp
16 |
17 | # Windows shortcuts
18 | *.lnk
19 |
20 | # =========================
21 | # Operating System Files
22 | # =========================
23 |
24 | # OSX
25 | # =========================
26 |
27 | .DS_Store
28 | .AppleDouble
29 | .LSOverride
30 |
31 | # Thumbnails
32 | ._*
33 |
34 | # Files that might appear on external disk
35 | .Spotlight-V100
36 | .Trashes
37 |
38 | # Directories potentially created on remote AFP share
39 | .AppleDB
40 | .AppleDesktop
41 | Network Trash Folder
42 | Temporary Items
43 | .apdisk
44 |
--------------------------------------------------------------------------------
/lab02/azuredeploy.parameters.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
3 | "contentVersion": "1.0.0.0",
4 | "parameters": {
5 | "newStorageAccountName": {
6 | "value": "myStorageAccount"
7 | },
8 | "adminUsername": {
9 | "value": "itcampdmin"
10 | },
11 | "dnsNameForPublicIP": {
12 | "value": "myDnsName"
13 | },
14 | "vmSize": {
15 | "value": "Standard_DS2"
16 | },
17 | "location": {
18 | "value": "West US"
19 | },
20 | "sizeOfEachDataDiskinGB": {
21 | "value": "128"
22 | },
23 | "modulesURL" : {
24 | "value": "https://github.com/AZITCAMP/Labfiles/blob/master/lab02/ConfigureVM.ps1.zip?raw=true"
25 | }
26 | }
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/lab04/AzureNetwork.netcfg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 10.0.0.0/16
8 |
9 |
10 |
11 | 10.0.0.0/24
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/lab02/Readme.md:
--------------------------------------------------------------------------------
1 | # Lab 02 VM - D2 VM with 4 striped data disks
2 |
3 | Create a VM that uses 4 Data Disks to test IOPS
4 |
5 |
6 |
7 |
8 |
9 | This template creates a STANDARD_D2 VM instance with 4 data disks configured with a ReadOnly cache setting. The template, leveraging DSC, creates a storage pool and stripes the 4 disks. The new volume is presented as H:\.
10 | Additionally, the IOMETER setup executable and .icf file are downloaded to the C:\Source directory on the virtual machine.
11 |
12 | This template is based on the VM-high-iops-data-disks Azure Quickstart template.
13 |
14 |
--------------------------------------------------------------------------------
/lab03/AZVPNConnectionConfig.ps1:
--------------------------------------------------------------------------------
1 |
2 | <#
3 | .SYNOPSIS
4 | This simple script configure a virtual network gateway connection in Azure. \
5 | The script assumes that you have completed the comfiguration of a VPN gateway
6 | in Azure, either by deploying the Lab 03 template to create the lab infrasture or
7 | by creating the VPN gateway using another method.
8 |
9 | .DESCRIPTION | USAGE
10 | This script assumes that the resource group is named RG-AZITCAMP-LAB02 and that the resource
11 | group is located in West US. If this is not true, then change the variable to the appropriate values.
12 | This script also assumes that you have configured or will configure the RRAS to use an IKEv2
13 | shared key as 'abc123'
14 |
15 | #>
16 |
17 | $loc = "West US"
18 | $rg = "RG-AZITCAMP-LAB03"
19 | $gw = Get-AzureVirtualNetworkGateway -Name vnetgw -ResourceGroupName $rg
20 | $ls = Get-AzureLocalNetworkGateway -Name LocalSiteGW -ResourceGroupName $rg
21 |
22 | New-AzureVirtualNetworkGatewayConnection -Name s2svpn -ResourceGroupName $rg -Location $loc -VirtualNetworkGateway1 $gw -LocalNetworkGateway2 $ls -ConnectionType IPsec -RoutingWeight 10 -SharedKey 'abc123'
--------------------------------------------------------------------------------
/lab04/ConfigureSourceVM.ps1:
--------------------------------------------------------------------------------
1 | Configuration ConfigureSourceVM
2 | {
3 | param ($MachineName)
4 |
5 | Node $MachineName
6 | {
7 | Script ConfigureSourceVM {
8 | SetScript = {
9 |
10 | $AdminKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}"
11 | $UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}"
12 | Set-ItemProperty -Path $AdminKey -Name "IsInstalled" -Value 0
13 | Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 0
14 | # Stop-Process -Name Explorer
15 |
16 | $regpath = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\'
17 | $x= get-item -Path $regpath
18 | $pname = 'LocalAccountTokenFilterPolicy'
19 | New-ItemProperty $regpath -Name $pname -Value 1 -PropertyType "Dword"
20 |
21 | $dir = "c:\Source"
22 | New-Item $dir -ItemType directory
23 |
24 | }
25 |
26 | TestScript = {
27 | # if ($x.GetValue("$pname") -eq $null) {return $false} else {return $true}
28 | Test-path c:\source
29 | }
30 | GetScript = { <# This must return a hash table #> } }
31 | }
32 | }
--------------------------------------------------------------------------------
/lab03/RRASConfig.ps1:
--------------------------------------------------------------------------------
1 | # Microsoft Corporation
2 | # Microsoft Azure Virtual Network
3 |
4 | # This configuration sample applies to Microsoft RRAS running on Windows Server 2012.
5 | # This configuration sample configures an IPSec VPN tunnel used to connect your on-premises VPN device with the Windows Azure Virtual Network gateway.
6 |
7 | # !!! In this version, the following support restrictions apply for RRAS:
8 | # !!! 1. Only IKEv2 is currently supported
9 | # !!! 2. Only route-based VPN configuration is supported.
10 |
11 | # Install RRAS role
12 | Import-Module ServerManager
13 | Install-WindowsFeature RemoteAccess -IncludeManagementTools
14 | Add-WindowsFeature -name Routing -IncludeManagementTools
15 |
16 | # !!! NOTE: You may be required to reboot before continuing on with the script.
17 |
18 | # Install S2S VPN
19 | Import-Module RemoteAccess
20 | Install-RemoteAccess -VpnType VpnS2S
21 |
22 | # Add S2S VPN interface
23 | Add-VpnS2SInterface -Protocol IKEv2 -AuthenticationMethod PSKOnly -NumberOfTries 3 -ResponderAuthenticationMethod PSKOnly -Name -Destination -IPv4Subnet @("10.0.0.0/16:10") -SharedSecret abc123
24 |
25 | # Restart the RRAS service
26 | Restart-Service RemoteAccess
27 |
28 | # Dial-in to Azure gateway (optional)
29 | #Connect-VpnS2SInterface -Name
--------------------------------------------------------------------------------
/lab01/RGCleanup.ps1:
--------------------------------------------------------------------------------
1 | # This script is intended to remove a single resource group
2 | # and all the resources contained within the resource group.
3 | # In order to use this script, you must know the name of the
4 | # resource group you would like to delete. To determine the name
5 | # of the resource group, you can issue the command Get-AzureResourceGroup
6 |
7 | # Remove existing subscriptions and accounts from local PowerShell environment
8 |
9 | Write-Host "Removing local Azure subscription certificates..."
10 | foreach ($sub in Get-AzureSubscription)
11 | {
12 | if ($sub.Name)
13 | {
14 | Remove-AzureSubscription $sub.Name -Force
15 | }
16 | }
17 | Write-Host "Signing out of Azure..."
18 | foreach ($acct in Get-AzureAccount)
19 | {
20 | Remove-AzureAccount $acct.Name -Force
21 | }
22 |
23 | # Sign into Azure
24 | Add-AzureAccount
25 |
26 | # Delete resource group used for lab
27 |
28 | Switch-AzureMode AzureResourceManager
29 |
30 | Write-Host "WARNING: This script will delete all resources in the resource groups named *AZITCAMP*" -ForegroundColor Red -BackgroundColor Yellow
31 | "`n"
32 | "If do not wish to delete any resources in your subscription, click No when prompted."
33 | "`n"
34 |
35 | Get-AzureResourceGroup | where {$_.ResourceGroupName -like "*AZITCAMP*"} | Remove-AzureResourceGroup
36 |
37 | # $RGNAME = Read-Host -Prompt "Enter the name of the Resource Group you wish to delete"
38 |
39 | # Get-AzureResourceGroup -name $RGNAME | Remove-AzureResourceGroup
40 |
41 | # Get-AzureResourceGroup | Remove-AzureResourceGroup
--------------------------------------------------------------------------------
/lab02/RGCleanup.ps1:
--------------------------------------------------------------------------------
1 | # This script is intended to remove a single resource group
2 | # and all the resources contained within the resource group.
3 | # In order to use this script, you must know the name of the
4 | # resource group you would like to delete. To determine the name
5 | # of the resource group, you can issue the command Get-AzureResourceGroup
6 |
7 | # Remove existing subscriptions and accounts from local PowerShell environment
8 |
9 | Write-Host "Removing local Azure subscription certificates..."
10 | foreach ($sub in Get-AzureSubscription)
11 | {
12 | if ($sub.Name)
13 | {
14 | Remove-AzureSubscription $sub.Name -Force
15 | }
16 | }
17 | Write-Host "Signing out of Azure..."
18 | foreach ($acct in Get-AzureAccount)
19 | {
20 | Remove-AzureAccount $acct.Name -Force
21 | }
22 |
23 | # Sign into Azure
24 | Add-AzureAccount
25 |
26 | # Delete resource group used for lab
27 |
28 | Switch-AzureMode AzureResourceManager
29 |
30 | Write-Host "WARNING: This script will delete all resources in the resource groups named *AZITCAMP*" -ForegroundColor Red -BackgroundColor Yellow
31 | "`n"
32 | "If do not wish to delete any resources in your subscription, click No when prompted."
33 | "`n"
34 |
35 | Get-AzureResourceGroup | where {$_.ResourceGroupName -like "*AZITCAMP*"} | Remove-AzureResourceGroup
36 |
37 | # $RGNAME = Read-Host -Prompt "Enter the name of the Resource Group you wish to delete"
38 |
39 | # Get-AzureResourceGroup -name $RGNAME | Remove-AzureResourceGroup
40 |
41 | # Get-AzureResourceGroup | Remove-AzureResourceGroup
--------------------------------------------------------------------------------
/lab03/RGCleanup.ps1:
--------------------------------------------------------------------------------
1 | # This script is intended to remove a single resource group
2 | # and all the resources contained within the resource group.
3 | # In order to use this script, you must know the name of the
4 | # resource group you would like to delete. To determine the name
5 | # of the resource group, you can issue the command Get-AzureResourceGroup
6 |
7 | # Remove existing subscriptions and accounts from local PowerShell environment
8 |
9 | Write-Host "Removing local Azure subscription certificates..."
10 | foreach ($sub in Get-AzureSubscription)
11 | {
12 | if ($sub.Name)
13 | {
14 | Remove-AzureSubscription $sub.Name -Force
15 | }
16 | }
17 | Write-Host "Signing out of Azure..."
18 | foreach ($acct in Get-AzureAccount)
19 | {
20 | Remove-AzureAccount $acct.Name -Force
21 | }
22 |
23 | # Sign into Azure
24 | Add-AzureAccount
25 |
26 | # Delete resource group used for lab
27 |
28 | Switch-AzureMode AzureResourceManager
29 |
30 | Write-Host "WARNING: This script will delete all resources in the resource groups named *AZITCAMP*" -ForegroundColor Red -BackgroundColor Yellow
31 | "`n"
32 | "If do not wish to delete any resources in your subscription, click No when prompted."
33 | "`n"
34 |
35 | Get-AzureResourceGroup | where {$_.ResourceGroupName -like "*AZITCAMP*"} | Remove-AzureResourceGroup
36 |
37 | # $RGNAME = Read-Host -Prompt "Enter the name of the Resource Group you wish to delete"
38 |
39 | # Get-AzureResourceGroup -name $RGNAME | Remove-AzureResourceGroup
40 |
41 | # Get-AzureResourceGroup | Remove-AzureResourceGroup
--------------------------------------------------------------------------------
/lab03/Readme.md:
--------------------------------------------------------------------------------
1 | # Lab 03 Infrastructure: VMs, Subnets, and VPN Gateway
2 |
3 | Create 3 subnets, 2 virtual machines, and a VPN gateway to support the Azure ITPRO Camp Lab 03 exercises.
4 |
5 |
6 |
7 |
8 |
9 | This template creates three subnets (FESubnet, BESubnet, and GatewaySubnet), two STANDARD_A2 virtual machines, and a VPN Gateway. One virtual machine is attached to the FESubnet; the other virtual machine is attached to the BEsubnet.
10 |
11 | The template additionally leverages Desired State Configuration to install files necessary for the lab steps and to install and configure additional services and features.
12 |
13 | To deploy this template to Azure, you you will need to provide values for the following parameters:
14 |
15 | 1. StorageAccount - this must be a global unique string that is all lower case and contains only letters and numbers. To create a unique name, use something like abcstore12345, where abc is your initials and 12345 is some random 5-digit number.
16 | 2. PublicDNS - Unique public DNS prefix for the deployment. The fqdn will look something like this: 'PublicDNSName.westus.cloudapp.azure.com'. To create a unique name, use something like abc12345, where abc is your initials and 12345 is a random 5-digit number.
17 | 3. localGatewayIpAddress - Public IP address of the VPN endpoint (the onprem VPN device or remote site).*
18 | 3. AdminPassword - password for the local admin accounts for the two virtual machines created in this deployment.
19 |
20 | *In the lab environment, you need to reconfigure the Edge virtual machine to get a public IP address, as per the lab instructions. If you are doing this lab using your own environment, please keep in mind that your VPN endpoint cannot be behind a NAT device. If you do not have a VPN endpoint, you can enter a random IP address. You will still be able to most of the lab steps.
21 |
22 | As an alternative to deploying the envrionment using the link above, you can deploy this template using the Lab03start.ps1 PowerShell script. This script requires your initials, Admin password, and localGatewayIPAddress as inputs. Both The Storage account and public DNS names are created using your intials to create the unique names required by the deployment. In the case of the storage account name, the script verifies that it is globally unique. Your initials and a random number between 10,000 and 99,999 are concatnated to create a unique dns name.
23 |
24 | The Lab03Start.ps1 script provides a demonstration of how to convert a parameter.json file to a hash table, modify the key/value pairs in the hash table and then use the hash table as an input to the new-resourcegroupdeployment cmdlet.
25 |
26 |
--------------------------------------------------------------------------------
/lab01/Lab01Start.ps1:
--------------------------------------------------------------------------------
1 | <#
2 | .SYNOPSIS
3 | This script is used to create a starting point for the Azure ITPRO Camp lab exercises.The script first determines
4 | a globally unique name for a storage account that can be used for the lab exercises and then creates a
5 | new Azure resource group for use in the lab exercises.
6 | .DESCRIPTION | USAGE
7 | The script first attempts to remove any local Azure subscription certificates that might interfere with
8 | logging into the subscription. You can ignore any errors, if they appear, before you are prompted to log on
9 | to your Azure subscription.
10 |
11 | IMPORTANT: Before running this script, please note that you will be prompted to provide your intiails.
12 | These intials are used to determine a unique name for the storage account. For storage account names,
13 | you must use all lower case letters or numbers. No hyphens or other characters are allowed.
14 |
15 |
16 | #>
17 |
18 | $init = Read-Host -Prompt "Please type your initials in lower case, and then press ENTER."
19 |
20 | Write-Host "Removing local Azure subscription certificates..."
21 | foreach ($sub in Get-AzureSubscription)
22 | {
23 | if ($sub.Name)
24 | {
25 | Remove-AzureSubscription $sub.Name -Force
26 | }
27 | }
28 | Write-Host "Signing out of Azure..."
29 | foreach ($acct in Get-AzureAccount)
30 | {
31 | Remove-AzureAccount $acct.Name -Force
32 | }
33 |
34 | # Sign into Azure
35 | Add-AzureAccount
36 |
37 | # Get the default subscription name and use it in $subname variable
38 | $subname = ""
39 | foreach ($sub in Get-AzureSubscription)
40 | {
41 | if ($sub.IsDefault -eq "True")
42 | {
43 | $subname = $sub.SubscriptionName
44 | }
45 | }
46 |
47 | # Make the default subscription the current subscription.
48 | # If you wish to use a subscription other than the default, replace $subname with the name of the subscription.
49 |
50 | Select-AzureSubscription -SubscriptionName $subname
51 |
52 |
53 | $loc = "West US"
54 | $rgname = "RG-AZITCAMP-LAB01"
55 | $deploymentname = "Simple-VM"
56 | $templatefilepath = "C:\LabFiles\..."
57 | $templatefileURI = "https://raw.githubusercontent.com/..."
58 | $parameterfilepath = "C:\LabFiles\..."
59 | $parameterfileURI = "https://raw.githubusercontent.com/..."
60 |
61 |
62 |
63 | # Use Test-Azure to determine unique name for storage account.
64 |
65 | #Ensure we are in Service Management mode to run the Test-AzureName cmdlet.
66 | Switch-AzureMode AzureServiceManagement
67 |
68 | $uniquename = $false
69 | $counter = 0
70 | while ($uniqueName -eq $false)
71 | {
72 | $counter ++
73 | #
74 | $storeName = "$init" + "store" + "$counter"
75 | if (!(Test-AzureName -Storage $storeName))
76 | {
77 | $uniquename = $true
78 | }
79 | }
80 |
81 | Write-Host ""
82 | Write-Host "Please note and use the following as the name for your storage account in subsequent lab exercises:"
83 | "`n"
84 | Write-Host "$storename" -ForegroundColor Black -BackgroundColor Green
85 | "`n"
86 |
87 | Pause
88 |
89 | #Switch to AzureResource Manager mode.
90 |
91 | Switch-AzureMode AzureResourceManager
92 |
93 | # If you are running this script on your own computer and not on the supplied host,
94 | # you consider specifying a location that it is closer to your own physical location.
95 |
96 | New-AzureResourceGroup -Name $rgname -Location $loc
97 |
98 | # If you want to deploy a local template using this script, add values for the $deploymentname, $templatefilepath, and $parametefilepath
99 | # and uncomment the following line.
100 |
101 | # New-AzureResourceGroupDeployment -Name $deploymentname -ResourceGroupName $rgname -TemplateParameterFile $paremeterfilepath -TemplateFile $templatefilepath
102 |
103 | # If you want to deploy a remote template using this script, add values for the $deploymentname, $templatefileURI, and $parametefileURI
104 | # and uncomment the following line.
105 |
106 | # New-AzureResourceGroupDeployment -Name $deploymentname -ResourceGroupName $rgname -TemplateParameterUri $parameterfileURI -TemplateUri $templatefileURI
107 |
--------------------------------------------------------------------------------
/lab03/start.azuredeploy.nsg.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
3 | "contentVersion": "1.0.0.0",
4 | "parameters": {
5 | "FENSGName": {
6 | "type": "string",
7 | "defaultValue": "FE_NSG",
8 | "metadata": {
9 | "description": "This is name of the networkSecurityGroup that will be assigned to FrontEnd Subnet"
10 | }
11 | },
12 | "BENSGName": {
13 | "type": "string",
14 | "defaultValue": "BE_NSG",
15 | "metadata": {
16 | "description": "This is name of the networkSecurityGroup that will be assigned to BackEnd Subnet"
17 | }
18 | }
19 | },
20 | "variables": {
21 | "VirtualNetworkName": "Lab03_VNET",
22 | "addressPrefix" : "10.0.0.0/16",
23 | "FESubnetPrefix" : "10.0.0.0/24",
24 | "BESubnetPrefix" : "10.0.1.0/24",
25 | "GWSubnetPrefix" : "10.0.200.0/28",
26 | "OnPremSubnetPrefix": "192.168.10.0/24",
27 | "FESubnetName" : "FESubnet",
28 | "BESubnetName" : "BESubnet",
29 | "GWSubnetName" : "GatewaySubnet"
30 | },
31 | "resources": [
32 | {
33 | "apiVersion": "2015-05-01-preview",
34 | "type": "Microsoft.Network/networkSecurityGroups",
35 | "name": "[parameters('FENSGName')]",
36 | "location": "[resourceGroup().location]",
37 | "properties": {
38 | "securityRules": [
39 | {
40 | "name": "rpd-inbound-from-onprem",
41 | "properties": {
42 | "description": "Allow RDP from OnPrem",
43 | "protocol": "Tcp",
44 | "sourcePortRange": "*",
45 | "destinationPortRange": "3389",
46 | "sourceAddressPrefix": "[variables('OnPremSubnetPrefix')]",
47 | "destinationAddressPrefix": "*",
48 | "access": "Allow",
49 | "priority": 100,
50 | "direction": "Inbound"
51 | }
52 | },
53 | {
54 | "name": "allow-web-inbound",
55 | "properties": {
56 | "description": "Allow WEB from Internet",
57 | "protocol": "Tcp",
58 | "sourcePortRange": "*",
59 | "destinationPortRange": "80",
60 | "sourceAddressPrefix": "Internet",
61 | "destinationAddressPrefix": "*",
62 | "access": "Allow",
63 | "priority": 101,
64 | "direction": "Inbound"
65 | }
66 | }
67 | ]
68 | }
69 | },
70 | {
71 | "apiVersion": "2015-05-01-preview",
72 | "type": "Microsoft.Network/networkSecurityGroups",
73 | "name": "[parameters('BENSGName')]",
74 | "location": "[resourceGroup().location]",
75 | "properties": {
76 | "securityRules": [
77 | {
78 | "name": "rpd-inbound-from-onprem",
79 | "properties": {
80 | "description": "Allow RDP from OnPrem",
81 | "protocol": "Tcp",
82 | "sourcePortRange": "*",
83 | "destinationPortRange": "3389",
84 | "sourceAddressPrefix": "[variables('OnPremSubnetPrefix')]",
85 | "destinationAddressPrefix": "*",
86 | "access": "Allow",
87 | "priority": 100,
88 | "direction": "Inbound"
89 | }
90 | }
91 | ]
92 | }
93 | },
94 | {
95 | "apiVersion": "2015-05-01-preview",
96 | "type": "Microsoft.Network/virtualNetworks",
97 | "name": "[variables('virtualNetworkName')]",
98 | "location": "[resourceGroup().location]",
99 | "dependsOn": [
100 | "[concat('Microsoft.Network/networkSecurityGroups/', parameters('FENSGName'))]",
101 | "[concat('Microsoft.Network/networkSecurityGroups/', parameters('BENSGName'))]"
102 | ],
103 | "properties": {
104 | "addressSpace": {
105 | "addressPrefixes": [
106 | "[variables('addressPrefix')]"
107 | ]
108 | },
109 | "subnets": [
110 | {
111 | "name": "[variables('FESubnetName')]",
112 | "properties": {
113 | "addressPrefix": "[variables('FESubnetPrefix')]",
114 | "networkSecurityGroup": {
115 | "id": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('FENSGName'))]"
116 | }
117 | }
118 | },
119 | {
120 | "name": "[variables('BESubnetName')]",
121 | "properties": {
122 | "addressPrefix": "[variables('BESubnetPrefix')]",
123 | "networkSecurityGroup": {
124 | "id": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('BENSGName'))]"
125 | }
126 | }
127 | },
128 | {
129 | "name": "[variables('GWSubnetName')]",
130 | "properties": {
131 | "addressPrefix": "[variables('GWSubnetPrefix')]"
132 | }
133 | }
134 | ]
135 | }
136 | }
137 | ]
138 | }
139 |
140 |
--------------------------------------------------------------------------------
/lab01/101-simple-windows-vm/azuredeploy.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
3 | "contentVersion": "1.0.0.0",
4 | "parameters": {
5 | "newStorageAccountName": {
6 | "type": "string",
7 | "metadata": {
8 | "description": "Unique DNS Name for the Storage Account where the Virtual Machine's disks will be placed."
9 | }
10 | },
11 | "adminUsername": {
12 | "type": "string",
13 | "metadata": {
14 | "description": "Username for the Virtual Machine."
15 | }
16 | },
17 | "adminPassword": {
18 | "type": "securestring",
19 | "metadata": {
20 | "description": "Password for the Virtual Machine."
21 | }
22 | },
23 | "dnsNameForPublicIP": {
24 | "type": "string",
25 | "metadata": {
26 | "description": "Unique DNS Name for the Public IP used to access the Virtual Machine."
27 | }
28 | },
29 | "windowsOSVersion": {
30 | "type": "string",
31 | "defaultValue": "2012-R2-Datacenter",
32 | "allowedValues": [
33 | "2008-R2-SP1",
34 | "2012-Datacenter",
35 | "2012-R2-Datacenter"
36 | ],
37 | "metadata": {
38 | "description": "The Windows version for the VM. This will pick a fully patched image of this given Windows version. Allowed values: 2008-R2-SP1, 2012-Datacenter, 2012-R2-Datacenter."
39 | }
40 | }
41 | },
42 | "variables": {
43 | "location": "West US",
44 | "imagePublisher": "MicrosoftWindowsServer",
45 | "imageOffer": "WindowsServer",
46 | "OSDiskName": "osdiskforwindowssimple",
47 | "nicName": "myVMNic",
48 | "addressPrefix": "10.0.0.0/16",
49 | "subnetName": "Subnet",
50 | "subnetPrefix": "10.0.0.0/24",
51 | "storageAccountType": "Standard_LRS",
52 | "publicIPAddressName": "myPublicIP",
53 | "publicIPAddressType": "Dynamic",
54 | "vmStorageAccountContainerName": "vhds",
55 | "vmName": "MyWindowsVM",
56 | "vmSize": "Standard_A2",
57 | "virtualNetworkName": "MyVNET",
58 | "vnetID": "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]",
59 | "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]"
60 | },
61 | "resources": [
62 | {
63 | "type": "Microsoft.Storage/storageAccounts",
64 | "name": "[parameters('newStorageAccountName')]",
65 | "apiVersion": "2015-05-01-preview",
66 | "location": "[variables('location')]",
67 | "properties": {
68 | "accountType": "[variables('storageAccountType')]"
69 | }
70 | },
71 | {
72 | "apiVersion": "2015-05-01-preview",
73 | "type": "Microsoft.Network/publicIPAddresses",
74 | "name": "[variables('publicIPAddressName')]",
75 | "location": "[variables('location')]",
76 | "properties": {
77 | "publicIPAllocationMethod": "[variables('publicIPAddressType')]",
78 | "dnsSettings": {
79 | "domainNameLabel": "[parameters('dnsNameForPublicIP')]"
80 | }
81 | }
82 | },
83 | {
84 | "apiVersion": "2015-05-01-preview",
85 | "type": "Microsoft.Network/virtualNetworks",
86 | "name": "[variables('virtualNetworkName')]",
87 | "location": "[variables('location')]",
88 | "properties": {
89 | "addressSpace": {
90 | "addressPrefixes": [
91 | "[variables('addressPrefix')]"
92 | ]
93 | },
94 | "subnets": [
95 | {
96 | "name": "[variables('subnetName')]",
97 | "properties": {
98 | "addressPrefix": "[variables('subnetPrefix')]"
99 | }
100 | }
101 | ]
102 | }
103 | },
104 | {
105 | "apiVersion": "2015-05-01-preview",
106 | "type": "Microsoft.Network/networkInterfaces",
107 | "name": "[variables('nicName')]",
108 | "location": "[variables('location')]",
109 | "dependsOn": [
110 | "[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
111 | "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
112 | ],
113 | "properties": {
114 | "ipConfigurations": [
115 | {
116 | "name": "ipconfig1",
117 | "properties": {
118 | "privateIPAllocationMethod": "Dynamic",
119 | "publicIPAddress": {
120 | "id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]"
121 | },
122 | "subnet": {
123 | "id": "[variables('subnetRef')]"
124 | }
125 | }
126 | }
127 | ]
128 | }
129 | },
130 | {
131 | "apiVersion": "2015-06-15",
132 | "type": "Microsoft.Compute/virtualMachines",
133 | "name": "[variables('vmName')]",
134 | "location": "[variables('location')]",
135 | "dependsOn": [
136 | "[concat('Microsoft.Storage/storageAccounts/', parameters('newStorageAccountName'))]",
137 | "[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
138 | ],
139 | "properties": {
140 | "hardwareProfile": {
141 | "vmSize": "[variables('vmSize')]"
142 | },
143 | "osProfile": {
144 | "computername": "[variables('vmName')]",
145 | "adminUsername": "[parameters('adminUsername')]",
146 | "adminPassword": "[parameters('adminPassword')]"
147 | },
148 | "storageProfile": {
149 | "imageReference": {
150 | "publisher": "[variables('imagePublisher')]",
151 | "offer": "[variables('imageOffer')]",
152 | "sku": "[parameters('windowsOSVersion')]",
153 | "version": "latest"
154 | },
155 | "osDisk": {
156 | "name": "osdisk",
157 | "vhd": {
158 | "uri": "[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',variables('OSDiskName'),'.vhd')]"
159 | },
160 | "caching": "ReadWrite",
161 | "createOption": "FromImage"
162 | }
163 | },
164 | "networkProfile": {
165 | "networkInterfaces": [
166 | {
167 | "id": "[resourceId('Microsoft.Network/networkInterfaces',variables('nicName'))]"
168 | }
169 | ]
170 | },
171 | "diagnosticsProfile": {
172 | "bootDiagnostics": {
173 | "enabled": "true",
174 | "storageUri": "[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net')]"
175 | }
176 | }
177 | }
178 | }
179 | ]
180 | }
181 |
182 |
--------------------------------------------------------------------------------
/lab04/Lab04Start.ps1:
--------------------------------------------------------------------------------
1 | <#
2 | .SYNOPSIS
3 | This script, in combination with an ARM template called by the script, is used to create the infrastructure
4 | starting point for Lab 04 of the Azure ITPRO Camp lab exercises.The script creates two storage accounts:
5 | one in East US, and the other in East US 2. The script creates two virtual machines in East US. These
6 | virtual machines are used as the source and process server to configure and test ASR.The script uses classic
7 | mode to create a virtual network in East US 2.
8 |
9 |
10 | .DESCRIPTION | USAGE
11 | The script first attempts to remove any local Azure subscription certificates that might interfere with
12 | logging into the subscription. You can ignore any errors, if they appear, before you are prompted to log on
13 | to your Azure subscription.
14 |
15 | IMPORTANT: Before running this script, please note that you will be prompted to provide your initials.
16 | The intials are used to determine a unique name for the storage account and public DNS name.
17 |
18 |
19 | Finally, just before the deployment begins, you will be prompted to provide the Admin password.
20 |
21 |
22 | The scipt may take anywhere from 10 - 20 or more minutes to complete after you enter the Admin password.
23 |
24 | #>
25 |
26 | # Prompt for initals to use to create unique names required by the deployment.
27 |
28 | $init = Read-Host -Prompt "Please type your initials in lower case, and then press ENTER."
29 | Write-Host ""
30 | # FORCE lowercase for users who do not read
31 | $init = $init.ToLower()
32 |
33 |
34 | #Remove any subscription information that could interfere with then sign out before signing into the Azure account.
35 |
36 | Write-Host "Removing local Azure subscription certificates..."
37 | foreach ($sub in Get-AzureSubscription)
38 | {
39 | if ($sub.Name)
40 | {
41 | Remove-AzureSubscription $sub.Name -Force
42 | }
43 | }
44 | Write-Host "Signing out of Azure..."
45 | foreach ($acct in Get-AzureAccount)
46 | {
47 | Remove-AzureAccount $acct.Name -Force
48 | }
49 |
50 | # Sign into Azure
51 | Add-AzureAccount
52 |
53 | # Get the default subscription name and use it in $subname variable
54 | $subname = ""
55 | foreach ($sub in Get-AzureSubscription)
56 | {
57 | if ($sub.IsDefault -eq "True")
58 | {
59 | $subname = $sub.SubscriptionName
60 | }
61 | }
62 |
63 | # Make the default subscription the current subscription.
64 | # If you wish to use a subscription other than the default, replace $subname with the name of the subscription.
65 |
66 | Select-AzureSubscription -SubscriptionName $subname
67 |
68 | #Declare variables for use in the script.
69 |
70 | $loc1 = "East US"
71 | $loc2 = "Central US"
72 | $rand = Get-Random -Minimum 10000 -Maximum 99999
73 | $publicDNSname = "$init" + "$rand"
74 | $AdminName = "ITCampAdmin"
75 | $rgname1 = "RG-AZITCAMP-LAB04-S"
76 | $rgname2 = "RG-AZITCAMP-LAB04-T"
77 | $deploymentname = "ASR-LAB"
78 | $templatefilepath = "C:\LabFiles\AZITPROCamp\Lab04\azuredeploy.json"
79 | $templatefileURI = "https://raw.githubusercontent.com/AZITCAMP/Labfiles/master/lab04/azuredeploy.json"
80 | $parameterfilepath = "C:\LabFiles\AZITPROCamp\Lab04\azuredeploy.parameters.json"
81 | $parameterfileURI = "https://raw.githubusercontent.com/AZITCAMP/Labfiles/master/lab04/azuredeploy.parameters.json"
82 | $assetlocation = "https://github.com/AZITCAMP/Labfiles/raw/master"
83 |
84 |
85 |
86 | # Use Test-Azure to determine unique name for storage account.
87 | # This cmdlet requires that we be in Serive Management mode
88 |
89 | #Ensure we are in Service Management mode to run the Test-AzureName cmdlet.
90 | Switch-AzureMode AzureServiceManagement
91 |
92 | $uniquename = $false
93 | $counter = 0
94 | while ($uniqueName -eq $false)
95 | {
96 | $counter ++
97 | #
98 | $sstoreName = "$init" + "sstore" + "$counter"
99 | if (!(Test-AzureName -Storage $sstoreName))
100 | {
101 | $uniquename = $true
102 | }
103 | }
104 |
105 |
106 |
107 | $uniquename = $false
108 | $counter = 0
109 | while ($uniqueName -eq $false)
110 | {
111 | $counter ++
112 | $tstoreName = "$init" + "tstore" + "$counter"
113 | $cloudsvcname = "$init" + "tcloudsvc" + "$counter"
114 | if (!(Test-AzureName -Storage $tstoreName))
115 | {
116 | if (!(Test-AzureName -Service $cloudsvcname))
117 | {
118 | $uniquename = $true
119 | }
120 | }
121 | }
122 |
123 | # Write-Host "Creating cloud service $cloudsvcname in $loc2"
124 | # New-AzureService -ServiceName $cloudsvcname -Location $loc2
125 |
126 | Write-Host ""
127 |
128 | Write-Host "Creating storage account $tstorename in $loc2"
129 | New-AzureStorageAccount -StorageAccountName $tstoreName -Location $loc2
130 |
131 | #Create VNET and subnet using classic mode
132 |
133 | $dir = "c:\Source"
134 | $FileURI = "https://github.com/AZITCAMP/Labfiles/raw/master/lab04/AzureNetwork.netcfg"
135 | if(!(Test-path $dir)){New-Item $dir -ItemType directory}
136 | $output = "$dir\AzureNetwork.netcfg"
137 | (New-Object System.Net.WebClient).DownloadFile($FileURI,$output)
138 |
139 | Write-Host "Creating Virtual Network"
140 | Set-AzureVNetConfig -ConfigurationPath $output
141 |
142 | Write-Host ""
143 |
144 | Write-host "Switching to Azure Resource Manager mode"
145 |
146 | Write-Host ""
147 |
148 | #Switch to AzureResource Manager mode.
149 |
150 | Switch-AzureMode AzureResourceManager
151 |
152 | # Create resource group
153 |
154 | New-AzureResourceGroup -Name $rgname1 -Location $loc1
155 | New-AzureResourceGroup -Name $rgname2 -Location $loc2
156 |
157 |
158 | # Read the values from the parameters file and create a hashtable. We do this because we need to modify some of
159 | # of the parameters.
160 |
161 | # First, get the parameters json file from a GitHub repo:
162 |
163 | $dir = "c:\Source"
164 | $FileURI = "https://raw.githubusercontent.com/AZITCAMP/Labfiles/master/lab04/azuredeploy.parameters.json"
165 | If (!(Test-Path $dir -PathType Container ) )
166 | {
167 | New-Item $dir -ItemType directory
168 | }
169 | $parameterFile = "$dir\azuredeploy.parameters.json"
170 | (New-Object System.Net.WebClient).DownloadFile($FileURI,$parameterFile)
171 |
172 | # Then, create a hash table from the file
173 |
174 | $parameters = New-Object -TypeName hashtable
175 | $jsonContent = Get-Content $ParameterFile -Raw | ConvertFrom-Json
176 | $jsonContent.parameters | Get-Member -MemberType NoteProperty | ForEach-Object {
177 | $parameters.Add($_.Name, $jsonContent.parameterValues.($_.Name))
178 | }
179 |
180 | # Set the StorageAccount and the PublicDNSName parameters to the unique value determined earlier by this script.
181 | # And, then set other parameters in the hash table to appropriate values.
182 |
183 | # $parameters.storageAccountfromTemplate = $storeName
184 | $parameters.storageAccount = $sstoreName
185 | $parameters.publicDNSName = $publicDNSname
186 | $parameters.adminUsername = $AdminName
187 | $parameters.assetlocation = $assetlocation
188 |
189 | # Create a new resource group deployment using the template file and template parameters stored in the hash table.
190 |
191 | New-AzureResourceGroupdeployment -Name $deploymentname -ResourceGroupName $rgname1 -TemplateParameterObject $parameters -TemplateUri $templatefileURI -Force
192 |
193 |
194 |
195 |
196 |
197 | # Get-AzurePublicIpAddress -ResourceGroupName $rgname1 | select name, IPaddress
198 |
199 | # Get-AzureResourceGroup | Remove-AzureResourceGroup -force
200 |
--------------------------------------------------------------------------------
/lab03/Lab03Start.ps1:
--------------------------------------------------------------------------------
1 | <#
2 | .SYNOPSIS
3 | This script is used to create the infrastructure starting point for Lab 03 of the Azure ITPRO Camp lab exercises.
4 | The script creates a new resource group and a new resource group deployment that comprises 2 virtual machines
5 | and 3 subnets. The scrip requires that you provide your initials. It uses these initials to create the unique names
6 | required by the deployment.
7 |
8 | .DESCRIPTION | USAGE
9 | The script first attempts to remove any local Azure subscription certificates that might interfere with
10 | logging into the subscription. You can ignore any errors, if they appear, before you are prompted to log on
11 | to your Azure subscription.
12 |
13 | IMPORTANT: Before running this script, please note that you will be prompted to provide your initials
14 | and the IP address of your VPN device (if you are using the lab environment, this is the external IP
15 | address of the EDGE virtual machine). *In the lab environment, you need to reconfigure the Edge
16 | virtual machine to get a public IP address, as per the lab instructions. If you are doing this lab
17 | using your own environment, please keep in mind that your VPN endpoint cannot be behind a NAT device.
18 | If you do not have a VPN endpoint, you can enter a random IP address. You will still be able to most
19 | of the lab steps.
20 |
21 | The intials are used to determine a unique name for the storage account and public DNS name.
22 |
23 |
24 | Finally, just before the deployment begins, you will be prompted to provide the Admin password and the publick IP address
25 | of the public IP address of the VPN endpoint (the onprem VPN device or remote site) you are going to use for the lab
26 | exercises.
27 |
28 |
29 | The scipt may take anywhere from 10 - 20 or more minutes to complete after you enter the Admin password. The VPN gateway takes some
30 | time to provision, and will be the last element to be provisioned. Please be patient. You can log in to the Azure
31 | to watch the progress of the deployment provisioning process.
32 |
33 | #>
34 |
35 | # Prompt for initals to use to create unique names required by the deployment.
36 |
37 | $init = Read-Host -Prompt "Please type your initials in lower case, and then press ENTER."
38 | Write-Host ""
39 |
40 |
41 | #Remove any subscription information that could interfere with then sign out before signing into the Azure account.
42 |
43 | Write-Host "Removing local Azure subscription certificates..."
44 | foreach ($sub in Get-AzureSubscription)
45 | {
46 | if ($sub.Name)
47 | {
48 | Remove-AzureSubscription $sub.Name -Force
49 | }
50 | }
51 | Write-Host "Signing out of Azure..."
52 | foreach ($acct in Get-AzureAccount)
53 | {
54 | Remove-AzureAccount $acct.Name -Force
55 | }
56 |
57 | # Sign into Azure
58 | Add-AzureAccount
59 |
60 | # Get the default subscription name and use it in $subname variable
61 | $subname = ""
62 | foreach ($sub in Get-AzureSubscription)
63 | {
64 | if ($sub.IsDefault -eq "True")
65 | {
66 | $subname = $sub.SubscriptionName
67 | }
68 | }
69 |
70 | # Make the default subscription the current subscription.
71 | # If you wish to use a subscription other than the default, replace $subname with the name of the subscription.
72 |
73 | Select-AzureSubscription -SubscriptionName $subname
74 |
75 | #Declare variables for use in the script.
76 |
77 | $loc = "West US"
78 | $rand = Get-Random -Minimum 10000 -Maximum 99999
79 | $publicDNSname = "$init" + "$rand"
80 | $AdminName = "ITCampAdmin"
81 | $rgname = "RG-AZITCAMP-LAB03"
82 | $rgname1 = "RG-AZITCAMP-STD"
83 | $rgname2 = "RG-AZITCAMP-PREM"
84 | $deploymentname = "Multi-VM-Subnet"
85 | $templatefilepath = "C:\LabFiles\AZITPROCamp\Lab03\azuredeploy.json"
86 | $templatefileURI = "https://raw.githubusercontent.com/AZITCAMP/Labfiles/master/lab03/azuredeploy.json"
87 | $parameterfilepath = "C:\LabFiles\AZITPROCamp\Lab03\azuredeploy.parameters.json"
88 | $parameterfileURI = "https://raw.githubusercontent.com/AZITCAMP/Labfiles/master/lab03/azuredeploy.parameters.json"
89 | $assetlocation = "https://github.com/AZITCAMP/Labfiles/raw/master"
90 |
91 |
92 |
93 | # Use Test-Azure to determine unique name for storage account.
94 | # This cmdlet requires that we be in Serive Management mode
95 |
96 | #Ensure we are in Service Management mode to run the Test-AzureName cmdlet.
97 | Switch-AzureMode AzureServiceManagement
98 |
99 | $uniquename = $false
100 | $counter = 0
101 | while ($uniqueName -eq $false)
102 | {
103 | $counter ++
104 | #
105 | $storeName = "$init" + "store" + "$counter"
106 | if (!(Test-AzureName -Storage $storeName))
107 | {
108 | $uniquename = $true
109 | }
110 | }
111 |
112 |
113 | Write-Host ""
114 | Write-Host "Please note and use the following as the names for your storage and public DNS name in the subsequent lab exercises:"
115 | "`n"
116 | Write-Host "$storename" -ForegroundColor Black -BackgroundColor Green
117 | "`n"
118 | Write-host "$publicDNSName" -ForegroundColor Black -BackgroundColor Green
119 | # "`n"
120 |
121 | Pause
122 |
123 | #Switch to AzureResource Manager mode.
124 |
125 | Switch-AzureMode AzureResourceManager
126 |
127 | # Create resource group
128 |
129 | New-AzureResourceGroup -Name $rgname -Location $loc
130 |
131 | # Read the values from the parameters file and create a hashtable. We do this because we need to modify some of
132 | # of the parameters.
133 |
134 | # First, get the parameters json file from a GitHub repo:
135 |
136 | $dir = "c:\Source"
137 | $FileURI = "https://raw.githubusercontent.com/AZITCAMP/Labfiles/master/lab03/azuredeploy.parameters.json"
138 | If (!(Test-Path $dir -PathType Container ) )
139 | {
140 | New-Item $dir -ItemType directory
141 | }
142 | $parameterFile = "$dir\azuredeploy.parameters.json"
143 | (New-Object System.Net.WebClient).DownloadFile($FileURI,$parameterFile)
144 |
145 | # Then, create a hash table from the file
146 |
147 | $parameters = New-Object -TypeName hashtable
148 | $jsonContent = Get-Content $ParameterFile -Raw | ConvertFrom-Json
149 | $jsonContent.parameters | Get-Member -MemberType NoteProperty | ForEach-Object {
150 | $parameters.Add($_.Name, $jsonContent.parameterValues.($_.Name))
151 | }
152 |
153 | # Set the StorageAccount and the PublicDNSName parameters to the unique value determined earlier by this script.
154 | # And, then set other parameters in the hash table to appropriate values.
155 |
156 | # $parameters.storageAccountfromTemplate = $storeName
157 | $parameters.storageAccount = $storeName
158 | $parameters.publicDNSName = $publicDNSname
159 | $parameters.adminUsername = $AdminName
160 | $parameters.assetlocation = $assetlocation
161 |
162 | # Create a new resource group deployment using the template file and template parameters stored in the hash table.
163 |
164 | New-AzureResourceGroupdeployment -Name $deploymentname -ResourceGroupName $rgname -TemplateParameterObject $parameters -TemplateUri $templatefileURI -Force
165 |
166 |
167 | # Display the public IP addresses used by the deployment
168 |
169 | Write-Host ""
170 | Write-Host "The following shows the public IP addresses used by the deployment. PubiP0 corresponds to FE1; PubIP1 corresponds to BE1."
171 |
172 | Get-AzurePublicIpAddress | select name, IPaddress
173 |
174 | Write-Host ""
175 | Write-host "The fqdn for FE1 is:"
176 | Write-host ""
177 | Write-host "$publicDNSname.westus.cloudapp.azure.com"
178 | Write-host ""
179 | Write-host "BE1 does not have a corresponding DNS name. This is by design."
180 |
--------------------------------------------------------------------------------
/Solutions/Lab01/101-simple-windows-vm/azuredeploy.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
3 | "contentVersion": "1.0.0.0",
4 | "parameters": {
5 | "newStorageAccountName": {
6 | "type": "string",
7 | "metadata": {
8 | "description": "Unique DNS Name for the Storage Account where the Virtual Machine's disks will be placed."
9 | }
10 | },
11 | "adminUsername": {
12 | "type": "string",
13 | "metadata": {
14 | "description": "Username for the Virtual Machine."
15 | }
16 | },
17 | "adminPassword": {
18 | "type": "securestring",
19 | "metadata": {
20 | "description": "Password for the Virtual Machine."
21 | }
22 | },
23 | "dnsNameForPublicIP": {
24 | "type": "string",
25 | "metadata": {
26 | "description": "Unique DNS Name for the Public IP used to access the Virtual Machine."
27 | }
28 | },
29 | "location": {
30 | "type": "string",
31 | "defaultValue": "West US",
32 | "allowedValues": [
33 | "West US",
34 | "East US 2"
35 | ],
36 | "metadata": {
37 | "description": "Restrict choices"
38 | }
39 | },
40 | "windowsOSVersion": {
41 | "type": "string",
42 | "defaultValue": "2012-R2-Datacenter",
43 | "allowedValues": [
44 | "2008-R2-SP1",
45 | "2012-Datacenter",
46 | "2012-R2-Datacenter"
47 | ],
48 | "metadata": {
49 | "description": "The Windows version for the VM. This will pick a fully patched image of this given Windows version. Allowed values: 2008-R2-SP1, 2012-Datacenter, 2012-R2-Datacenter."
50 | }
51 | },
52 | "sizeOfDiskInGB": {
53 | "type": "string",
54 | "metadata": {
55 | "description": "Size of the empty data disk in GB"
56 | }
57 | }
58 | },
59 | "variables": {
60 | "imagePublisher": "MicrosoftWindowsServer",
61 | "imageOffer": "WindowsServer",
62 | "OSDiskName": "osdiskforwindowssimple",
63 | "nicName": "myVMNic",
64 | "addressPrefix": "10.0.0.0/16",
65 | "subnetName": "Subnet",
66 | "subnetPrefix": "10.0.0.0/24",
67 | "storageAccountType": "Standard_LRS",
68 | "publicIPAddressName": "myPublicIP",
69 | "publicIPAddressType": "Dynamic",
70 | "vmStorageAccountContainerName": "vhds",
71 | "vmName": "MyWindowsVM",
72 | "vmSize": "Standard_A2",
73 | "virtualNetworkName": "MyVNET",
74 | "vnetID": "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]",
75 | "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
76 | "dataDisk1VhdName": "[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',variables('vmName'),'dataDisk1.vhd')]"
77 | },
78 | "resources": [
79 | {
80 | "type": "Microsoft.Storage/storageAccounts",
81 | "name": "[parameters('newStorageAccountName')]",
82 | "apiVersion": "2015-05-01-preview",
83 | "location": "[parameters('location')]",
84 | "properties": {
85 | "accountType": "[variables('storageAccountType')]"
86 | }
87 | },
88 | {
89 | "apiVersion": "2015-05-01-preview",
90 | "type": "Microsoft.Network/publicIPAddresses",
91 | "name": "[variables('publicIPAddressName')]",
92 | "location": "[parameters('location')]",
93 | "properties": {
94 | "publicIPAllocationMethod": "[variables('publicIPAddressType')]",
95 | "dnsSettings": {
96 | "domainNameLabel": "[parameters('dnsNameForPublicIP')]"
97 | }
98 | }
99 | },
100 | {
101 | "apiVersion": "2015-05-01-preview",
102 | "type": "Microsoft.Network/virtualNetworks",
103 | "name": "[variables('virtualNetworkName')]",
104 | "location": "[parameters('location')]",
105 | "properties": {
106 | "addressSpace": {
107 | "addressPrefixes": [
108 | "[variables('addressPrefix')]"
109 | ]
110 | },
111 | "subnets": [
112 | {
113 | "name": "[variables('subnetName')]",
114 | "properties": {
115 | "addressPrefix": "[variables('subnetPrefix')]"
116 | }
117 | }
118 | ]
119 | }
120 | },
121 | {
122 | "apiVersion": "2015-05-01-preview",
123 | "type": "Microsoft.Network/networkInterfaces",
124 | "name": "[variables('nicName')]",
125 | "location": "[parameters('location')]",
126 | "dependsOn": [
127 | "[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
128 | "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
129 | ],
130 | "properties": {
131 | "ipConfigurations": [
132 | {
133 | "name": "ipconfig1",
134 | "properties": {
135 | "privateIPAllocationMethod": "Dynamic",
136 | "publicIPAddress": {
137 | "id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]"
138 | },
139 | "subnet": {
140 | "id": "[variables('subnetRef')]"
141 | }
142 | }
143 | }
144 | ]
145 | }
146 | },
147 | {
148 | "apiVersion": "2015-06-15",
149 | "type": "Microsoft.Compute/virtualMachines",
150 | "name": "[variables('vmName')]",
151 | "location": "[parameters('location')]",
152 | "dependsOn": [
153 | "[concat('Microsoft.Storage/storageAccounts/', parameters('newStorageAccountName'))]",
154 | "[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
155 | ],
156 | "properties": {
157 | "hardwareProfile": {
158 | "vmSize": "[variables('vmSize')]"
159 | },
160 | "osProfile": {
161 | "computername": "[variables('vmName')]",
162 | "adminUsername": "[parameters('adminUsername')]",
163 | "adminPassword": "[parameters('adminPassword')]"
164 | },
165 | "storageProfile": {
166 | "imageReference": {
167 | "publisher": "[variables('imagePublisher')]",
168 | "offer": "[variables('imageOffer')]",
169 | "sku": "[parameters('windowsOSVersion')]",
170 | "version": "latest"
171 | },
172 | "osDisk": {
173 | "name": "osdisk",
174 | "vhd": {
175 | "uri": "[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',variables('OSDiskName'),'.vhd')]"
176 | },
177 | "caching": "ReadWrite",
178 | "createOption": "FromImage"
179 | },
180 | "dataDisks": [
181 | {
182 | "name": "datadisk1",
183 | "diskSizeGB": "[parameters('sizeOfDiskInGB')]",
184 | "lun": 0,
185 | "vhd": {
186 | "Uri": "[variables('dataDisk1VhdName')]"
187 | },
188 | "createOption": "Empty"
189 | }
190 | ]
191 | },
192 | "networkProfile": {
193 | "networkInterfaces": [
194 | {
195 | "id": "[resourceId('Microsoft.Network/networkInterfaces',variables('nicName'))]"
196 | }
197 | ]
198 | },
199 | "diagnosticsProfile": {
200 | "bootDiagnostics": {
201 | "enabled": "true",
202 | "storageUri": "[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net')]"
203 | }
204 | }
205 | }
206 | }
207 | ]
208 | }
209 |
210 |
--------------------------------------------------------------------------------
/lab02/azuredeploy.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
3 | "contentVersion": "1.0.0.0",
4 | "parameters": {
5 | "newStorageAccountName": {
6 | "type": "string",
7 | "metadata": {
8 | "description": "This is the name of the your storage account"
9 | }
10 | },
11 | "dnsNameForPublicIP": {
12 | "type": "string",
13 | "metadata": {
14 | "description": "Unique DNS Name for the Storage Account where the Virtual Machine's disks will be placed."
15 | }
16 | },
17 | "adminUsername": {
18 | "type": "string",
19 | "defaultValue": "itcampadmin",
20 | "metadata": {
21 | "description": "Username for the Virtual Machine."
22 | }
23 | },
24 | "adminPassword": {
25 | "type": "securestring",
26 | "metadata": {
27 | "description": "Password for the Virtual Machine."
28 | }
29 | },
30 | "vmSize": {
31 | "type": "string",
32 | "metadata": {
33 | "description": "Virtual Machine Size"
34 | },
35 | "defaultValue": "Standard_D2",
36 | "allowedValues": [
37 | "Standard_D1",
38 | "Standard_D2",
39 | "Standard_D3",
40 | "Standard_D4"
41 | ]
42 | },
43 | "location": {
44 | "type": "string",
45 | "defaultValue": "West US",
46 | "allowedValues": [
47 | "West US",
48 | "East US 2"
49 | ],
50 | "metadata": {
51 | "description": "Restrict choices to data centers that provide premium storage"
52 | }
53 | },
54 | "sizeOfEachDataDiskInGB": {
55 | "type": "string",
56 | "defaultValue": "128",
57 | "allowedValues": [
58 | "128",
59 | "512",
60 | "1023"
61 | ],
62 | "metadata": {
63 | "description": "There will be 4 data disks created of this size and then striped. The total capacity will be 4x whatever you specify here"
64 | }
65 | },
66 | "modulesUrl": {
67 | "type": "string",
68 | "defaultValue": "https://github.com/AZITCAMP/Labfiles/blob/master/lab02/ConfigureVM.ps1.zip?raw=true",
69 | "metadata": {
70 | "description": "URL for the DSC configuration module. NOTE: Can be a Github url(raw) to the zip file"
71 | }
72 | }
73 | },
74 | "variables": {
75 | "addressPrefix": "10.0.0.0/16",
76 | "subnet1Name": "Subnet-1",
77 | "subnet1Prefix": "10.0.0.0/24",
78 | "vmStorageAccountContainerName": "vhds",
79 | "imagePublisher": "MicrosoftWindowsServer",
80 | "imageOffer": "WindowsServer",
81 | "imageSKU": "2012-R2-Datacenter",
82 | "imageVersion": "latest",
83 | "publicIPAddressName": "myPublicIP",
84 | "publicIPAddressType": "Dynamic",
85 | "storageAccountType": "Standard_LRS",
86 | "virtualNetworkName": "VNET1",
87 | "vmName": "STD-D2-VM",
88 | "vnetID": "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]",
89 | "nicName": "VMNic",
90 | "subnet1Ref": "[concat(variables('vnetID'),'/subnets/',variables('subnet1Name'))]",
91 | "configurationFunction": "ConfigureVM.ps1\\ConfigureVM",
92 | "DscExtensionName": "DscExtension",
93 | "dataDisk1VhdName": "[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',variables('vmName'),'dataDisk1.vhd')]",
94 | "dataDisk2VhdName": "[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',variables('vmName'),'dataDisk2.vhd')]",
95 | "dataDisk3VhdName": "[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',variables('vmName'),'dataDisk3.vhd')]",
96 | "dataDisk4VhdName": "[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',variables('vmName'),'dataDisk4.vhd')]"
97 | },
98 | "resources": [
99 | {
100 | "type": "Microsoft.Storage/storageAccounts",
101 | "name": "[parameters('newStorageAccountName')]",
102 | "apiVersion": "2015-05-01-preview",
103 | "location": "[parameters('location')]",
104 | "properties": {
105 | "accountType": "[variables('storageAccountType')]"
106 | }
107 | },
108 | {
109 | "apiVersion": "2015-05-01-preview",
110 | "type": "Microsoft.Network/publicIPAddresses",
111 | "name": "[variables('publicIPAddressName')]",
112 | "location": "[parameters('location')]",
113 | "properties": {
114 | "publicIPAllocationMethod": "[variables('publicIPAddressType')]",
115 | "dnsSettings": {
116 | "domainNameLabel": "[parameters('dnsNameForPublicIP')]"
117 | }
118 | }
119 | },
120 | {
121 | "apiVersion": "2015-05-01-preview",
122 | "type": "Microsoft.Network/virtualNetworks",
123 | "name": "[variables('virtualNetworkName')]",
124 | "location": "[parameters('location')]",
125 | "properties": {
126 | "addressSpace": {
127 | "addressPrefixes": [
128 | "[variables('addressPrefix')]"
129 | ]
130 | },
131 | "subnets": [
132 | {
133 | "name": "[variables('subnet1Name')]",
134 | "properties": {
135 | "addressPrefix": "[variables('subnet1Prefix')]"
136 | }
137 | }
138 | ]
139 | }
140 | },
141 | {
142 | "apiVersion": "2015-05-01-preview",
143 | "type": "Microsoft.Network/networkInterfaces",
144 | "name": "[variables('nicName')]",
145 | "location": "[parameters('location')]",
146 | "dependsOn": [
147 | "[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
148 | "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
149 | ],
150 | "properties": {
151 | "ipConfigurations": [
152 | {
153 | "name": "ipconfig1",
154 | "properties": {
155 | "privateIPAllocationMethod": "Dynamic",
156 | "publicIPAddress": {
157 | "id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]"
158 | },
159 | "subnet": {
160 | "id": "[variables('subnet1Ref')]"
161 | }
162 | }
163 | }
164 | ]
165 | }
166 | },
167 | {
168 | "apiVersion": "2015-06-15",
169 | "type": "Microsoft.Compute/virtualMachines",
170 | "name": "[variables('vmName')]",
171 | "location": "[parameters('location')]",
172 | "dependsOn": [
173 | "[concat('Microsoft.Storage/storageAccounts/', parameters('newStorageAccountName'))]",
174 | "[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
175 | ],
176 | "properties": {
177 | "hardwareProfile": {
178 | "vmSize": "[parameters('vmSize')]"
179 | },
180 | "osProfile": {
181 | "computername": "[variables('vmName')]",
182 | "adminUsername": "[parameters('adminUsername')]",
183 | "adminPassword": "[parameters('adminPassword')]"
184 | },
185 | "storageProfile": {
186 | "imageReference": {
187 | "publisher": "[variables('imagePublisher')]",
188 | "offer": "[variables('imageOffer')]",
189 | "sku": "[variables('imageSKU')]",
190 | "version": "[variables('imageVersion')]"
191 | },
192 | "dataDisks": [
193 | {
194 | "name": "datadisk1",
195 | "diskSizeGB": "[parameters('sizeOfEachDataDiskInGB')]",
196 | "lun": 0,
197 | "caching": "ReadOnly",
198 | "vhd": {
199 | "Uri": "[variables('dataDisk1VhdName')]"
200 | },
201 | "createOption": "Empty"
202 | },
203 | {
204 | "name": "datadisk2",
205 | "diskSizeGB": "[parameters('sizeOfEachDataDiskInGB')]",
206 | "lun": 1,
207 | "caching": "ReadOnly",
208 | "vhd": {
209 | "Uri": "[variables('dataDisk2VhdName')]"
210 | },
211 | "createOption": "Empty"
212 | },
213 | {
214 | "name": "datadisk3",
215 | "diskSizeGB": "[parameters('sizeOfEachDataDiskInGB')]",
216 | "lun": 2,
217 | "caching": "ReadOnly",
218 | "vhd": {
219 | "Uri": "[variables('dataDisk3VhdName')]"
220 | },
221 | "createOption": "Empty"
222 | },
223 | {
224 | "name": "datadisk4",
225 | "diskSizeGB": "[parameters('sizeOfEachDataDiskInGB')]",
226 | "lun": 3,
227 | "caching": "ReadOnly",
228 | "vhd": {
229 | "Uri": "[variables('dataDisk4VhdName')]"
230 | },
231 | "createOption": "Empty"
232 | }
233 | ],
234 | "osDisk": {
235 | "caching": "ReadWrite",
236 | "name": "osdisk1",
237 | "vhd": {
238 | "uri": "[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/','osdisk1.vhd')]"
239 | },
240 | "createOption": "FromImage"
241 | }
242 | },
243 | "networkProfile": {
244 | "networkInterfaces": [
245 | {
246 | "id": "[resourceId('Microsoft.Network/networkInterfaces',variables('nicName'))]"
247 | }
248 | ]
249 | }
250 | }
251 | },
252 | {
253 | "type": "Microsoft.Compute/virtualMachines/extensions",
254 | "name": "[concat(variables('vmName'),'/', variables('DscExtensionName'))]",
255 | "apiVersion": "2015-05-01-preview",
256 | "location": "[parameters('location')]",
257 | "dependsOn": [
258 | "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
259 | ],
260 | "properties": {
261 | "publisher": "Microsoft.Powershell",
262 | "type": "DSC",
263 | "typeHandlerVersion": "2.8",
264 | "settings": {
265 | "ModulesUrl": "[parameters('modulesUrl')]",
266 | "SasToken": "",
267 | "ConfigurationFunction": "[variables('configurationFunction')]",
268 | "Properties": {
269 | "MachineName": "[variables('vmName')]"
270 | }
271 | },
272 | "protectedSettings": null
273 | }
274 | }
275 | ]
276 | }
277 |
278 |
--------------------------------------------------------------------------------
/Solutions/Lab02/azuredeploy-premstorage.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
3 | "contentVersion": "1.0.0.0",
4 | "parameters": {
5 | "newStorageAccountName": {
6 | "type": "string",
7 | "metadata": {
8 | "description": "This is the name of the your storage account"
9 | }
10 | },
11 | "dnsNameForPublicIP": {
12 | "type": "string",
13 | "metadata": {
14 | "description": "Unique DNS Name for the Storage Account where the Virtual Machine's disks will be placed."
15 | }
16 | },
17 | "adminUsername": {
18 | "type": "string",
19 | "defaultValue": "itcampadmin",
20 | "metadata": {
21 | "description": "Username for the Virtual Machine."
22 | }
23 | },
24 | "adminPassword": {
25 | "type": "securestring",
26 | "metadata": {
27 | "description": "Password for the Virtual Machine."
28 | }
29 | },
30 | "vmSize": {
31 | "type": "string",
32 | "metadata": {
33 | "description": "Virtual Machine Size"
34 | },
35 | "defaultValue": "Standard_DS2",
36 | "allowedValues": [
37 | "Standard_DS1",
38 | "Standard_DS2",
39 | "Standard_DS3",
40 | "Standard_DS4"
41 | ]
42 | },
43 | "location": {
44 | "type": "string",
45 | "defaultValue": "West US",
46 | "allowedValues": [
47 | "West US",
48 | "East US 2"
49 | ],
50 | "metadata": {
51 | "description": "Restrict choices to data centers that provide premium storage"
52 | }
53 | },
54 | "sizeOfEachDataDiskInGB": {
55 | "type": "string",
56 | "defaultValue": "128",
57 | "allowedValues": [
58 | "128",
59 | "512",
60 | "1023"
61 | ],
62 | "metadata": {
63 | "description": "There will be 4 data disks created of this size and then striped. The total capacity will be 4x whatever you specify here"
64 | }
65 | },
66 | "modulesUrl": {
67 | "type": "string",
68 | "defaultValue": "https://github.com/AZITCAMP/Labfiles/blob/master/lab02/ConfigureVM.ps1.zip?raw=true",
69 | "metadata": {
70 | "description": "URL for the DSC configuration module. NOTE: Can be a Github url(raw) to the zip file"
71 | }
72 | }
73 | },
74 | "variables": {
75 | "addressPrefix": "10.0.0.0/16",
76 | "subnet1Name": "Subnet-1",
77 | "subnet1Prefix": "10.0.0.0/24",
78 | "vmStorageAccountContainerName": "vhds",
79 | "imagePublisher": "MicrosoftWindowsServer",
80 | "imageOffer": "WindowsServer",
81 | "imageSKU": "2012-R2-Datacenter",
82 | "imageVersion": "latest",
83 | "publicIPAddressName": "myPublicIP",
84 | "publicIPAddressType": "Dynamic",
85 | "storageAccountType": "Premium_LRS",
86 | "virtualNetworkName": "VNET1",
87 | "vmName": "PRM-DS2-VM",
88 | "vnetID": "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]",
89 | "nicName": "VMNic",
90 | "subnet1Ref": "[concat(variables('vnetID'),'/subnets/',variables('subnet1Name'))]",
91 | "configurationFunction": "ConfigureVM.ps1\\ConfigureVM",
92 | "DscExtensionName": "DscExtension",
93 | "dataDisk1VhdName": "[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',variables('vmName'),'dataDisk1.vhd')]",
94 | "dataDisk2VhdName": "[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',variables('vmName'),'dataDisk2.vhd')]",
95 | "dataDisk3VhdName": "[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',variables('vmName'),'dataDisk3.vhd')]",
96 | "dataDisk4VhdName": "[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',variables('vmName'),'dataDisk4.vhd')]"
97 | },
98 | "resources": [
99 | {
100 | "type": "Microsoft.Storage/storageAccounts",
101 | "name": "[parameters('newStorageAccountName')]",
102 | "apiVersion": "2015-05-01-preview",
103 | "location": "[parameters('location')]",
104 | "properties": {
105 | "accountType": "[variables('storageAccountType')]"
106 | }
107 | },
108 | {
109 | "apiVersion": "2015-05-01-preview",
110 | "type": "Microsoft.Network/publicIPAddresses",
111 | "name": "[variables('publicIPAddressName')]",
112 | "location": "[parameters('location')]",
113 | "properties": {
114 | "publicIPAllocationMethod": "[variables('publicIPAddressType')]",
115 | "dnsSettings": {
116 | "domainNameLabel": "[parameters('dnsNameForPublicIP')]"
117 | }
118 | }
119 | },
120 | {
121 | "apiVersion": "2015-05-01-preview",
122 | "type": "Microsoft.Network/virtualNetworks",
123 | "name": "[variables('virtualNetworkName')]",
124 | "location": "[parameters('location')]",
125 | "properties": {
126 | "addressSpace": {
127 | "addressPrefixes": [
128 | "[variables('addressPrefix')]"
129 | ]
130 | },
131 | "subnets": [
132 | {
133 | "name": "[variables('subnet1Name')]",
134 | "properties": {
135 | "addressPrefix": "[variables('subnet1Prefix')]"
136 | }
137 | }
138 | ]
139 | }
140 | },
141 | {
142 | "apiVersion": "2015-05-01-preview",
143 | "type": "Microsoft.Network/networkInterfaces",
144 | "name": "[variables('nicName')]",
145 | "location": "[parameters('location')]",
146 | "dependsOn": [
147 | "[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
148 | "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
149 | ],
150 | "properties": {
151 | "ipConfigurations": [
152 | {
153 | "name": "ipconfig1",
154 | "properties": {
155 | "privateIPAllocationMethod": "Dynamic",
156 | "publicIPAddress": {
157 | "id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]"
158 | },
159 | "subnet": {
160 | "id": "[variables('subnet1Ref')]"
161 | }
162 | }
163 | }
164 | ]
165 | }
166 | },
167 | {
168 | "apiVersion": "2015-06-15",
169 | "type": "Microsoft.Compute/virtualMachines",
170 | "name": "[variables('vmName')]",
171 | "location": "[parameters('location')]",
172 | "dependsOn": [
173 | "[concat('Microsoft.Storage/storageAccounts/', parameters('newStorageAccountName'))]",
174 | "[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
175 | ],
176 | "properties": {
177 | "hardwareProfile": {
178 | "vmSize": "[parameters('vmSize')]"
179 | },
180 | "osProfile": {
181 | "computername": "[variables('vmName')]",
182 | "adminUsername": "[parameters('adminUsername')]",
183 | "adminPassword": "[parameters('adminPassword')]"
184 | },
185 | "storageProfile": {
186 | "imageReference": {
187 | "publisher": "[variables('imagePublisher')]",
188 | "offer": "[variables('imageOffer')]",
189 | "sku": "[variables('imageSKU')]",
190 | "version": "[variables('imageVersion')]"
191 | },
192 | "dataDisks": [
193 | {
194 | "name": "datadisk1",
195 | "diskSizeGB": "[parameters('sizeOfEachDataDiskInGB')]",
196 | "lun": 0,
197 | "caching": "ReadOnly",
198 | "vhd": {
199 | "Uri": "[variables('dataDisk1VhdName')]"
200 | },
201 | "createOption": "Empty"
202 | },
203 | {
204 | "name": "datadisk2",
205 | "diskSizeGB": "[parameters('sizeOfEachDataDiskInGB')]",
206 | "lun": 1,
207 | "caching": "ReadOnly",
208 | "vhd": {
209 | "Uri": "[variables('dataDisk2VhdName')]"
210 | },
211 | "createOption": "Empty"
212 | },
213 | {
214 | "name": "datadisk3",
215 | "diskSizeGB": "[parameters('sizeOfEachDataDiskInGB')]",
216 | "lun": 2,
217 | "caching": "ReadOnly",
218 | "vhd": {
219 | "Uri": "[variables('dataDisk3VhdName')]"
220 | },
221 | "createOption": "Empty"
222 | },
223 | {
224 | "name": "datadisk4",
225 | "diskSizeGB": "[parameters('sizeOfEachDataDiskInGB')]",
226 | "lun": 3,
227 | "caching": "ReadOnly",
228 | "vhd": {
229 | "Uri": "[variables('dataDisk4VhdName')]"
230 | },
231 | "createOption": "Empty"
232 | }
233 | ],
234 | "osDisk": {
235 | "caching": "ReadWrite",
236 | "name": "osdisk1",
237 | "vhd": {
238 | "uri": "[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/','osdisk1.vhd')]"
239 | },
240 | "createOption": "FromImage"
241 | }
242 | },
243 | "networkProfile": {
244 | "networkInterfaces": [
245 | {
246 | "id": "[resourceId('Microsoft.Network/networkInterfaces',variables('nicName'))]"
247 | }
248 | ]
249 | }
250 | }
251 | },
252 | {
253 | "type": "Microsoft.Compute/virtualMachines/extensions",
254 | "name": "[concat(variables('vmName'),'/', variables('DscExtensionName'))]",
255 | "apiVersion": "2015-05-01-preview",
256 | "location": "[parameters('location')]",
257 | "dependsOn": [
258 | "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
259 | ],
260 | "properties": {
261 | "publisher": "Microsoft.Powershell",
262 | "type": "DSC",
263 | "typeHandlerVersion": "2.8",
264 | "settings": {
265 | "ModulesUrl": "[parameters('modulesUrl')]",
266 | "SasToken": "",
267 | "ConfigurationFunction": "[variables('configurationFunction')]",
268 | "Properties": {
269 | "MachineName": "[variables('vmName')]"
270 | }
271 | },
272 | "protectedSettings": null
273 | }
274 | }
275 | ]
276 | }
277 |
278 |
--------------------------------------------------------------------------------
/Solutions/Lab03/azuredeploy.nsg.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
3 | "contentVersion": "1.0.0.0",
4 | "parameters": {
5 | "FENSGName": {
6 | "type": "string",
7 | "defaultValue": "FE_NSG",
8 | "metadata": {
9 | "description": "This is name of the networkSecurityGroup that will be assigned to FrontEnd Subnet"
10 | }
11 | },
12 | "BENSGName": {
13 | "type": "string",
14 | "defaultValue": "BE_NSG",
15 | "metadata": {
16 | "description": "This is name of the networkSecurityGroup that will be assigned to BackEnd Subnet"
17 | }
18 | }
19 | },
20 | "variables": {
21 | "VirtualNetworkName": "Lab03_VNET",
22 | "addressPrefix" : "10.0.0.0/16",
23 | "FESubnetPrefix" : "10.0.0.0/24",
24 | "BESubnetPrefix" : "10.0.1.0/24",
25 | "GWSubnetPrefix" : "10.0.200.0/28",
26 | "OnPremSubnetPrefix": "192.168.10.0/24",
27 | "FESubnetName" : "FESubnet",
28 | "BESubnetName" : "BESubnet",
29 | "GWSubnetName" : "GatewaySubnet"
30 | },
31 | "resources": [
32 | {
33 | "apiVersion": "2015-05-01-preview",
34 | "type": "Microsoft.Network/networkSecurityGroups",
35 | "name": "[parameters('FENSGName')]",
36 | "location": "[resourceGroup().location]",
37 | "properties": {
38 | "securityRules": [
39 | {
40 | "name": "rpd-inbound-from-onprem",
41 | "properties": {
42 | "description": "Allow RDP from OnPrem",
43 | "protocol": "Tcp",
44 | "sourcePortRange": "*",
45 | "destinationPortRange": "3389",
46 | "sourceAddressPrefix": "[variables('OnPremSubnetPrefix')]",
47 | "destinationAddressPrefix": "*",
48 | "access": "Allow",
49 | "priority": 100,
50 | "direction": "Inbound"
51 | }
52 | },
53 | {
54 | "name": "allow-web-inbound",
55 | "properties": {
56 | "description": "Allow WEB from Internet",
57 | "protocol": "Tcp",
58 | "sourcePortRange": "*",
59 | "destinationPortRange": "80",
60 | "sourceAddressPrefix": "Internet",
61 | "destinationAddressPrefix": "*",
62 | "access": "Allow",
63 | "priority": 101,
64 | "direction": "Inbound"
65 | }
66 | },
67 | {
68 | "name": "Block-BE-Inbound",
69 | "properties": {
70 | "description": "Block BE Subnet",
71 | "protocol": "Tcp",
72 | "sourcePortRange": "*",
73 | "destinationPortRange": "*",
74 | "sourceAddressPrefix": "[variables('BESubnetPrefix')]",
75 | "destinationAddressPrefix": "*",
76 | "access": "Deny",
77 | "priority": 102,
78 | "direction": "Inbound"
79 | }
80 | },
81 | {
82 | "name": "web-inbound-from-onprem",
83 | "properties": {
84 | "description": "Allow Web from OnPrem",
85 | "protocol": "Tcp",
86 | "sourcePortRange": "*",
87 | "destinationPortRange": "80",
88 | "sourceAddressPrefix": "[variables('OnPremSubnetPrefix')]",
89 | "destinationAddressPrefix": "*",
90 | "access": "Allow",
91 | "priority": 103,
92 | "direction": "Inbound"
93 | }
94 | },
95 | {
96 | "name": "Block-onpremm-Inbound",
97 | "properties": {
98 | "description": "Block BE Subnet",
99 | "protocol": "Tcp",
100 | "sourcePortRange": "*",
101 | "destinationPortRange": "*",
102 | "sourceAddressPrefix": "[variables('OnPremSubnetPrefix')]",
103 | "destinationAddressPrefix": "*",
104 | "access": "Deny",
105 | "priority": 104,
106 | "direction": "Inbound"
107 | }
108 | },
109 | {
110 | "name": "Allow-KMS-Outbound",
111 | "properties": {
112 | "description": "Allow KMS Outbound",
113 | "protocol": "Tcp",
114 | "sourcePortRange": "*",
115 | "destinationPortRange": "1688",
116 | "sourceAddressPrefix": "*",
117 | "destinationAddressPrefix": "Internet",
118 | "access": "Allow",
119 | "priority": 150,
120 | "direction": "Outbound"
121 | }
122 | },
123 | {
124 | "name": "Block-Internet-Inbound",
125 | "properties": {
126 | "description": "Block Internet Inbound",
127 | "protocol": "*",
128 | "sourcePortRange": "*",
129 | "destinationPortRange": "*",
130 | "sourceAddressPrefix": "Internet",
131 | "destinationAddressPrefix": "*",
132 | "access": "Deny",
133 | "priority": 200,
134 | "direction": "Inbound"
135 | }
136 | },
137 | {
138 | "name": "Block-Internet-Outboud",
139 | "properties": {
140 | "description": "Block Internet Outbound",
141 | "protocol": "*",
142 | "sourcePortRange": "*",
143 | "destinationPortRange": "*",
144 | "sourceAddressPrefix": "*",
145 | "destinationAddressPrefix": "Internet",
146 | "access": "Deny",
147 | "priority": 201,
148 | "direction": "Outbound"
149 | }
150 | }
151 | ]
152 | }
153 | },
154 | {
155 | "apiVersion": "2015-05-01-preview",
156 | "type": "Microsoft.Network/networkSecurityGroups",
157 | "name": "[parameters('BENSGName')]",
158 | "location": "[resourceGroup().location]",
159 | "properties": {
160 | "securityRules": [
161 | {
162 | "name": "rpd-inbound-from-onprem",
163 | "properties": {
164 | "description": "Allow RDP from OnPrem",
165 | "protocol": "Tcp",
166 | "sourcePortRange": "*",
167 | "destinationPortRange": "3389",
168 | "sourceAddressPrefix": "[variables('OnPremSubnetPrefix')]",
169 | "destinationAddressPrefix": "*",
170 | "access": "Allow",
171 | "priority": 100,
172 | "direction": "Inbound"
173 | }
174 | },
175 | {
176 | "name": "Allow-FE-App-Inbound",
177 | "properties": {
178 | "description": "Allow FE Subnet for App",
179 | "protocol": "Tcp",
180 | "sourcePortRange": "*",
181 | "destinationPortRange": "23",
182 | "sourceAddressPrefix": "[variables('FESubnetPrefix')]",
183 | "destinationAddressPrefix": "*",
184 | "access": "Allow",
185 | "priority": 101,
186 | "direction": "Inbound"
187 | }
188 | },
189 | {
190 | "name": "Block_FE_Inbound",
191 | "properties": {
192 | "description": "Block FE Subnet",
193 | "protocol": "Tcp",
194 | "sourcePortRange": "*",
195 | "destinationPortRange": "*",
196 | "sourceAddressPrefix": "[variables('FESubnetPrefix')]",
197 | "destinationAddressPrefix": "*",
198 | "access": "Deny",
199 | "priority": 102,
200 | "direction": "Inbound"
201 | }
202 | },
203 | {
204 | "name": "Block-onpremm-Inbound",
205 | "properties": {
206 | "description": "Block BE Subnet",
207 | "protocol": "Tcp",
208 | "sourcePortRange": "*",
209 | "destinationPortRange": "*",
210 | "sourceAddressPrefix": "[variables('OnPremSubnetPrefix')]",
211 | "destinationAddressPrefix": "*",
212 | "access": "Deny",
213 | "priority": 103,
214 | "direction": "Inbound"
215 | }
216 | },
217 | {
218 | "name": "Allow-KMS-Outbound",
219 | "properties": {
220 | "description": "Allow KMS Outbound",
221 | "protocol": "Tcp",
222 | "sourcePortRange": "*",
223 | "destinationPortRange": "1688",
224 | "sourceAddressPrefix": "*",
225 | "destinationAddressPrefix": "Internet",
226 | "access": "Allow",
227 | "priority": 150,
228 | "direction": "Outbound"
229 | }
230 | },
231 | {
232 | "name": "Block-Internet-Inbound",
233 | "properties": {
234 | "description": "Block Interent Inbound",
235 | "protocol": "*",
236 | "sourcePortRange": "*",
237 | "destinationPortRange": "*",
238 | "sourceAddressPrefix": "Internet",
239 | "destinationAddressPrefix": "*",
240 | "access": "Deny",
241 | "priority": 200,
242 | "direction": "Inbound"
243 | }
244 | },
245 | {
246 | "name": "Block-Internet-Outbound",
247 | "properties": {
248 | "description": "Block Internet Outbound",
249 | "protocol": "*",
250 | "sourcePortRange": "*",
251 | "destinationPortRange": "*",
252 | "sourceAddressPrefix": "*",
253 | "destinationAddressPrefix": "Internet",
254 | "access": "Deny",
255 | "priority": 201,
256 | "direction": "Outbound"
257 | }
258 | }
259 | ]
260 | }
261 | },
262 | {
263 | "apiVersion": "2015-05-01-preview",
264 | "type": "Microsoft.Network/virtualNetworks",
265 | "name": "[variables('virtualNetworkName')]",
266 | "location": "[resourceGroup().location]",
267 | "dependsOn": [
268 | "[concat('Microsoft.Network/networkSecurityGroups/', parameters('FENSGName'))]",
269 | "[concat('Microsoft.Network/networkSecurityGroups/', parameters('BENSGName'))]"
270 | ],
271 | "properties": {
272 | "addressSpace": {
273 | "addressPrefixes": [
274 | "[variables('addressPrefix')]"
275 | ]
276 | },
277 | "subnets": [
278 | {
279 | "name": "[variables('FESubnetName')]",
280 | "properties": {
281 | "addressPrefix": "[variables('FESubnetPrefix')]",
282 | "networkSecurityGroup": {
283 | "id": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('FENSGName'))]"
284 | }
285 | }
286 | },
287 | {
288 | "name": "[variables('BESubnetName')]",
289 | "properties": {
290 | "addressPrefix": "[variables('BESubnetPrefix')]",
291 | "networkSecurityGroup": {
292 | "id": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('BENSGName'))]"
293 | }
294 | }
295 | },
296 | {
297 | "name": "[variables('GWSubnetName')]",
298 | "properties": {
299 | "addressPrefix": "[variables('GWSubnetPrefix')]"
300 | }
301 | }
302 | ]
303 | }
304 | }
305 | ]
306 | }
307 |
308 |
--------------------------------------------------------------------------------
/lab04/azuredeploy.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
3 | "contentVersion": "1.0.0.0",
4 | "parameters": {
5 | "publicDnsName": {
6 | "type": "string",
7 | "metadata": {
8 | "description": "Unique public DNS prefix for the deployment. The fqdn will look something like '.eastus.cloudapp.azure.com'. Up to 62 chars, digits or dashes, lowercase, should start with a letter: must conform to '^[a-z][a-z0-9-]{1,61}[a-z0-9]$'."
9 | }
10 | },
11 | "storageAccount": {
12 | "type": "string",
13 | "defaultValue": "useuniquenamehere",
14 | "metadata": {
15 | "description": "Name of the Storage Account. This has to be a uinique name, up to 24 chars, all lowercase."
16 | }
17 | },
18 | "adminUsername": {
19 | "type": "string",
20 | "defaultValue": "ITCampAdmin",
21 | "metadata": {
22 | "description": "The name of the administrator of the new VM and the domain. Exclusion list: 'admin','administrator'"
23 | }
24 | },
25 | "adminPassword": {
26 | "type": "securestring",
27 | "metadata": {
28 | "description": "The password for the administrator account of the new VM and the domain"
29 | }
30 | },
31 | "assetLocation": {
32 | "type": "string",
33 | "defaultValue": "https://github.com/AZITCAMP/Labfiles/raw/master",
34 | "metadata": {
35 | "description": "The location of resources such as templates and DSC modules that the script is dependent"
36 | }
37 | }
38 | },
39 | "variables": {
40 | "vmSizePS": "Standard_D3",
41 | "vmSizeSource": "Standard_A2",
42 | "imagePublisher": "MicrosoftWindowsServer",
43 | "imageOffer": "WindowsServer",
44 | "WindowsOSVersion": "2012-R2-Datacenter",
45 | "rgname1": "RG-AZITCAMP-LAB04-S",
46 | "rgname2": "RG-AZITCAMP-LAB04-S",
47 | "loc1": "East US",
48 | "loc2": "Central US",
49 | "SVNETName": "Lab04-S-VNET",
50 | "TVNETName": "Lab04-T-VNET",
51 | "psVMName": "onPremPS",
52 | "sourceVMName": "onPremSource",
53 | "SVNETID": "[resourceId('Microsoft.Network/virtualNetworks',variables('SVNETName'))]",
54 | "SourceSubnetPrefix": "10.0.0.0/24",
55 | "TargetSubnetPrefix": "10.0.0.0/24",
56 | "SourceSubnetName": "subnet1",
57 | "TargetSubnetName": "subnet2",
58 | "SourceSubnet-id": "[concat(variables('SVNETID'),'/subnets/',variables('SourceSubnetName'))]",
59 | "publicIPAddressName": "PubIP",
60 | "vnetAddressRange": "10.0.0.0/16",
61 | "subnetAddressRange": "10.0.0.0/24",
62 | "psConfigurationFunction": "ConfigurePsVM.ps1\\ConfigurePsVM",
63 | "sourceConfigurationFunction": "ConfigureSourceVM.ps1\\ConfigureSourceVM",
64 | "DscExtensionName": "DscExtension",
65 | "vmStorageAccountContainerName":"vhds",
66 | "sizeOfEachDataDiskInGB": "128"
67 | },
68 | "resources": [
69 | {
70 | "apiVersion": "2015-05-01-preview",
71 | "type": "Microsoft.Network/publicIPAddresses",
72 | "name": "[concat(variables('publicIPAddressName'),'0')]",
73 | "location": "[variables('loc1')]",
74 | "properties": {
75 | "publicIPAllocationMethod": "Dynamic",
76 | "dnsSettings": {
77 | "domainNameLabel": "[parameters('publicDnsName')]"
78 | }
79 | }
80 | },
81 | {
82 | "apiVersion": "2015-05-01-preview",
83 | "type": "Microsoft.Network/publicIPAddresses",
84 | "name": "[concat(variables('publicIPAddressName'),'1')]",
85 | "location": "[variables('loc1')]",
86 | "properties": {
87 | "publicIPAllocationMethod": "Dynamic"
88 | }
89 | },
90 | {
91 | "apiVersion": "2015-05-01-preview",
92 | "type": "Microsoft.Storage/storageAccounts",
93 | "name": "[parameters('storageAccount')]",
94 | "location": "[variables('loc1')]",
95 | "properties": {
96 | "accountType": "Standard_LRS"
97 | }
98 | },
99 | {
100 | "apiVersion": "2015-05-01-preview",
101 | "type": "Microsoft.Network/virtualNetworks",
102 | "name": "[variables('SVNETName')]",
103 | "location": "[variables('loc1')]",
104 | "properties": {
105 | "addressSpace": {
106 | "addressPrefixes": [
107 | "[variables('vnetAddressRange')]"
108 | ]
109 | },
110 | "subnets": [
111 | {
112 | "name": "[variables('SourceSubnetName')]",
113 | "properties": {
114 | "addressPrefix": "[variables('SourceSubnetPrefix')]"
115 | }
116 | }
117 | ]
118 | }
119 | },
120 | {
121 | "apiVersion": "2015-05-01-preview",
122 | "type": "Microsoft.Network/networkInterfaces",
123 | "name": "onPremPS-nif",
124 | "location": "[variables('loc1')]",
125 | "dependsOn": [
126 | "[concat('Microsoft.Network/virtualNetworks/', variables('SVNETName'))]"
127 | ],
128 | "properties": {
129 | "ipConfigurations": [
130 | {
131 | "name": "ipconfig",
132 | "properties": {
133 | "privateIPAllocationMethod": "Static",
134 | "privateIPAddress": "10.0.0.10",
135 | "publicIPAddress" : {
136 | "id": "[concat(resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName')),'0')]"
137 | },
138 | "subnet": {
139 | "id": "[variables('SourceSubnet-id')]"
140 | }
141 | }
142 | }
143 | ]
144 | }
145 | },
146 | {
147 | "apiVersion": "2015-06-15",
148 | "type": "Microsoft.Compute/virtualMachines",
149 | "name": "[variables('psVMName')]",
150 | "location": "[variables('loc1')]",
151 | "dependsOn": [
152 | "[resourceId('Microsoft.Storage/storageAccounts',parameters('storageAccount'))]",
153 | "[resourceId('Microsoft.Network/networkInterfaces','onPremPS-nif')]"
154 | ],
155 | "properties": {
156 | "hardwareProfile": {
157 | "vmSize": "[variables('vmSizePS')]"
158 | },
159 | "osProfile": {
160 | "computername": "[variables('psVMName')]",
161 | "adminUsername": "[parameters('adminUsername')]",
162 | "adminPassword": "[parameters('adminPassword')]"
163 | },
164 | "storageProfile": {
165 | "imageReference": {
166 | "publisher": "[variables('imagePublisher')]",
167 | "offer": "[variables('imageOffer')]",
168 | "sku": "[variables('windowsOSVersion')]",
169 | "version": "latest"
170 | },
171 | "dataDisks": [
172 | {
173 | "name": "datadisk1",
174 | "diskSizeGB": "[variables('sizeOfEachDataDiskInGB')]",
175 | "lun": 0,
176 | "caching": "ReadWrite",
177 | "vhd": {
178 | "Uri": "[concat('http://',parameters('storageAccount'),'.blob.core.windows.net/vhds/onPremPS-datadisk1.vhd')]"
179 | },
180 | "createOption": "Empty"
181 | },
182 | {
183 | "name": "datadisk2",
184 | "diskSizeGB": "[variables('sizeOfEachDataDiskInGB')]",
185 | "lun": 1,
186 | "caching": "ReadWrite",
187 | "vhd": {
188 | "Uri": "[concat('http://',parameters('storageAccount'),'.blob.core.windows.net/vhds/onPremPS-datadisk2.vhd')]"
189 | },
190 | "createOption": "Empty"
191 | },
192 | {
193 | "name": "datadisk3",
194 | "diskSizeGB": "[variables('sizeOfEachDataDiskInGB')]",
195 | "lun": 2,
196 | "caching": "ReadWrite",
197 | "vhd": {
198 | "Uri": "[concat('http://',parameters('storageAccount'),'.blob.core.windows.net/vhds/onPremPS-datadisk3.vhd')]"
199 | },
200 | "createOption": "Empty"
201 | },
202 | {
203 | "name": "datadisk4",
204 | "diskSizeGB": "[variables('sizeOfEachDataDiskInGB')]",
205 | "lun": 3,
206 | "caching": "ReadWrite",
207 | "vhd": {
208 | "Uri": "[concat('http://',parameters('storageAccount'),'.blob.core.windows.net/vhds/onPremPS-datadisk4.vhd')]"
209 | },
210 | "createOption": "Empty"
211 | },
212 | {
213 | "name": "datadisk5",
214 | "diskSizeGB": "[variables('sizeOfEachDataDiskInGB')]",
215 | "lun": 4,
216 | "caching": "ReadWrite",
217 | "vhd": {
218 | "Uri": "[concat('http://',parameters('storageAccount'),'.blob.core.windows.net/vhds/onPremPS-datadisk5.vhd')]"
219 | },
220 | "createOption": "Empty"
221 | }
222 | ],
223 | "osDisk": {
224 | "name": "osdisk",
225 | "vhd": {
226 | "uri": "[concat('http://',parameters('storageAccount'),'.blob.core.windows.net/vhds/onPremPS-osdisk.vhd')]"
227 | },
228 | "caching": "ReadWrite",
229 | "createOption": "FromImage"
230 | }
231 | },
232 | "networkProfile": {
233 | "networkInterfaces": [
234 | {
235 | "id": "[resourceId('Microsoft.Network/networkInterfaces','onPremPS-nif')]"
236 | }
237 | ]
238 | },
239 | "diagnosticsProfile": {
240 | "bootDiagnostics": {
241 | "enabled": "true",
242 | "storageUri": "[concat('http://',parameters('StorageAccount'),'.blob.core.windows.net')]"
243 | }
244 | }
245 | }
246 | },
247 | {
248 | "apiVersion": "2015-05-01-preview",
249 | "type": "Microsoft.Network/networkInterfaces",
250 | "name": "source-nif",
251 | "location": "[variables('loc1')]",
252 | "dependsOn": [
253 | "[concat('Microsoft.Network/virtualNetworks/', variables('SVNETName'))]"
254 | ],
255 | "properties": {
256 | "ipConfigurations": [
257 | {
258 | "name": "ipconfig",
259 | "properties": {
260 | "privateIPAllocationMethod": "Static",
261 | "privateIPAddress": "10.0.0.11",
262 | "publicIPAddress" : {
263 | "id": "[concat(resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName')),'1')]"
264 | },
265 | "subnet": {
266 | "id": "[variables('SourceSubnet-id')]"
267 | }
268 | }
269 | }
270 | ]
271 | }
272 | },
273 | {
274 | "type": "Microsoft.Compute/virtualMachines/extensions",
275 | "name": "[concat(variables('psVMName'),'/', variables('DscExtensionName'))]",
276 | "apiVersion": "2015-05-01-preview",
277 | "location": "[variables('loc1')]",
278 | "dependsOn": [
279 | "[concat('Microsoft.Compute/virtualMachines/', variables('psVMName'))]"
280 | ],
281 | "properties": {
282 | "publisher": "Microsoft.Powershell",
283 | "type": "DSC",
284 | "typeHandlerVersion": "2.8",
285 | "settings": {
286 | "ModulesUrl": "[concat(parameters('assetLocation'),'/lab04/ConfigurePsVM.zip')]",
287 | "SasToken": "",
288 | "ConfigurationFunction": "[variables('psConfigurationFunction')]",
289 | "Properties": {
290 | "MachineName": "[variables('psVMName')]"
291 | }
292 | },
293 | "protectedSettings": null
294 | }
295 | },
296 | {
297 | "apiVersion": "2015-05-01-preview",
298 | "type": "Microsoft.Compute/virtualMachines",
299 | "name": "[variables('sourceVMName')]",
300 | "location": "[variables('loc1')]",
301 | "dependsOn": [
302 | "[concat('Microsoft.Storage/storageAccounts/', parameters('storageAccount'))]",
303 | "Microsoft.Network/networkInterfaces/source-nif"
304 | ],
305 | "properties": {
306 | "hardwareProfile": {
307 | "vmSize": "[variables('vmSizeSource')]"
308 | },
309 | "osProfile": {
310 | "computername": "[variables('sourceVMName')]",
311 | "adminUsername": "[parameters('adminUsername')]",
312 | "adminPassword": "[parameters('adminPassword')]"
313 | },
314 | "storageProfile": {
315 | "imageReference": {
316 | "publisher": "[variables('imagePublisher')]",
317 | "offer": "[variables('imageOffer')]",
318 | "sku": "[variables('windowsOSVersion')]",
319 | "version": "latest"
320 | },
321 | "osDisk": {
322 | "name": "osdisk",
323 | "vhd": {
324 | "uri": "[concat('http://',parameters('storageAccount'),'.blob.core.windows.net/vhds/source-osdisk.vhd')]"
325 | },
326 | "caching": "ReadWrite",
327 | "createOption": "FromImage"
328 | }
329 | },
330 | "networkProfile": {
331 | "networkInterfaces": [
332 | {
333 | "id": "[resourceId('Microsoft.Network/networkInterfaces','source-nif')]"
334 | }
335 | ]
336 | }
337 | }
338 | },
339 | {
340 | "type": "Microsoft.Compute/virtualMachines/extensions",
341 | "name": "[concat(variables('sourceVMName'),'/', variables('DscExtensionName'))]",
342 | "apiVersion": "2015-05-01-preview",
343 | "location": "[variables('loc1')]",
344 | "dependsOn": [
345 | "[concat('Microsoft.Compute/virtualMachines/', variables('sourceVMName'))]"
346 | ],
347 | "properties": {
348 | "publisher": "Microsoft.Powershell",
349 | "type": "DSC",
350 | "typeHandlerVersion": "2.8",
351 | "settings": {
352 | "ModulesUrl": "[concat(parameters('assetLocation'),'/lab04/ConfigureSourceVM.zip')]",
353 | "SasToken": "",
354 | "ConfigurationFunction": "[variables('sourceConfigurationFunction')]",
355 | "Properties": {
356 | "MachineName": "[variables('sourceVMName')]"
357 | }
358 | },
359 | "protectedSettings": null
360 | }
361 | }
362 | ]
363 | }
364 |
365 |
--------------------------------------------------------------------------------
/lab03/azuredeploy.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
3 | "contentVersion": "1.0.0.0",
4 | "parameters": {
5 | "publicDnsName": {
6 | "type": "string",
7 | "metadata": {
8 | "description": "Unique public DNS prefix for the deployment. The fqdn will look something like '.westus.cloudapp.azure.com'. Up to 62 chars, digits or dashes, lowercase, should start with a letter: must conform to '^[a-z][a-z0-9-]{1,61}[a-z0-9]$'."
9 | }
10 | },
11 | "storageAccount": {
12 | "type": "string",
13 | "defaultValue": "useuniquenamehere",
14 | "metadata": {
15 | "description": "Name of the Storage Account. This has to be a uinique name, up to 24 chars, all lowercase."
16 | }
17 | },
18 | "adminUsername": {
19 | "type": "string",
20 | "defaultValue": "ITCampAdmin",
21 | "metadata": {
22 | "description": "The name of the administrator of the new VM and the domain. Exclusion list: 'admin','administrator'"
23 | }
24 | },
25 | "adminPassword": {
26 | "type": "securestring",
27 | "metadata": {
28 | "description": "The password for the administrator account of the new VM and the domain"
29 | }
30 | },
31 | "localGatewayIpAddress": {
32 | "type": "string",
33 | "metadata": {
34 | "description": "Public IP address for the gateway to connect to (from other VNet/on-prem)"
35 | }
36 | },
37 | "assetLocation": {
38 | "type": "string",
39 | "defaultValue": "https://github.com/AZITCAMP/Labfiles/raw/master",
40 | "metadata": {
41 | "description": "The location of resources such as templates and DSC modules that the script is dependent"
42 | }
43 | }
44 | },
45 | "variables": {
46 | "vmSize": "Standard_A2",
47 | "imagePublisher": "MicrosoftWindowsServer",
48 | "imageOffer": "WindowsServer",
49 | "WindowsOSVersion": "2012-R2-Datacenter",
50 | "VNETName": "Lab03_VNET",
51 | "VNETID": "[resourceId('Microsoft.Network/virtualNetworks',variables('VNETName'))]",
52 | "FESubnetPrefix": "10.0.0.0/24",
53 | "FESubnetName": "FESubnet",
54 | "FESubnet-id": "[concat(variables('VNETID'),'/subnets/',variables('FESubnetName'))]",
55 | "BESubnetPrefix": "10.0.1.0/24",
56 | "BESubnetName": "BESubnet",
57 | "BESubnet-id": "[concat(variables('VNETID'),'/subnets/',variables('BESubnetName'))]",
58 | "GWSubnetPrefix": "10.0.200.0/28",
59 | "GWSubnetName": "GatewaySubnet",
60 | "GWSubnet-id": "[concat(variables('VNETID'),'/subnets/',variables('GWSubnetName'))]",
61 | "publicIPAddressName": "PubIP",
62 | "enableBgp": "false",
63 | "gatewayType": "vpn",
64 | "vpnType": "RouteBased",
65 | "localGatewayName": "LocalSiteGW",
66 | "localGatewayAddressPrefix": "192.168.10.0/24",
67 | "gatewayPublicIPName": "GWIP",
68 | "gatewayName": "VNETGW",
69 | "connectionName": "VNETGatewayConfig",
70 | "vnetAddressRange": "10.0.0.0/16",
71 | "subnetAddressRange": "10.0.0.0/24",
72 | "dnsServerPrivateIp": "10.0.0.8"
73 | },
74 | "resources": [
75 | {
76 | "apiVersion": "2015-05-01-preview",
77 | "type": "Microsoft.Network/publicIPAddresses",
78 | "name": "[concat(variables('publicIPAddressName'),'0')]",
79 | "location": "[resourceGroup().location]",
80 | "properties": {
81 | "publicIPAllocationMethod": "Dynamic",
82 | "dnsSettings": {
83 | "domainNameLabel": "[parameters('publicDnsName')]"
84 | }
85 | }
86 | },
87 | {
88 | "apiVersion": "2015-05-01-preview",
89 | "type": "Microsoft.Network/publicIPAddresses",
90 | "name": "[concat(variables('publicIPAddressName'),'1')]",
91 | "location": "[resourceGroup().location]",
92 | "properties": {
93 | "publicIPAllocationMethod": "Dynamic"
94 | }
95 | },
96 | {
97 | "apiVersion": "2015-05-01-preview",
98 | "type": "Microsoft.Network/publicIPAddresses",
99 | "name": "[variables('gatewayPublicIPName')]",
100 | "location": "[resourceGroup().location]",
101 | "properties": {
102 | "publicIPAllocationMethod": "Dynamic"
103 | }
104 | },
105 | {
106 | "apiVersion": "2015-05-01-preview",
107 | "type": "Microsoft.Storage/storageAccounts",
108 | "name": "[parameters('storageAccount')]",
109 | "location": "[resourceGroup().location]",
110 | "properties": {
111 | "accountType": "Standard_LRS"
112 | }
113 | },
114 | {
115 | "apiVersion": "2015-05-01-preview",
116 | "type": "Microsoft.Network/virtualNetworks",
117 | "name": "[variables('VNETName')]",
118 | "location": "[resourceGroup().location]",
119 | "properties": {
120 | "addressSpace": {
121 | "addressPrefixes": [
122 | "[variables('vnetAddressRange')]"
123 | ]
124 | },
125 | "subnets": [
126 | {
127 | "name": "[variables('FESubnetName')]",
128 | "properties": {
129 | "addressPrefix": "[variables('FESubnetPrefix')]"
130 | }
131 | },
132 | {
133 | "name": "[variables('BESubnetName')]",
134 | "properties": {
135 | "addressPrefix": "[variables('BESubnetPrefix')]"
136 | }
137 | },
138 | {
139 | "name": "[variables('GWSubnetName')]",
140 | "properties": {
141 | "addressPrefix": "[variables('GWSubnetPrefix')]"
142 | }
143 | }
144 | ]
145 | }
146 | },
147 | {
148 | "apiVersion": "2015-05-01-preview",
149 | "type": "Microsoft.Network/localNetworkGateways",
150 | "name": "[variables('localGatewayName')]",
151 | "location": "[resourceGroup().location]",
152 | "properties": {
153 | "localNetworkAddressSpace": {
154 | "addressPrefixes": [
155 | "[variables('localGatewayAddressPrefix')]"
156 | ]
157 | },
158 | "gatewayIpAddress": "[parameters('localGatewayIpAddress')]"
159 | }
160 | },
161 | {
162 | "apiVersion": "2015-05-01-preview",
163 | "type": "Microsoft.Network/virtualNetworkGateways",
164 | "name": "[variables('gatewayName')]",
165 | "location": "[resourceGroup().location]",
166 | "dependsOn": [
167 | "[concat('Microsoft.Network/publicIPAddresses/', variables('gatewayPublicIPName'))]",
168 | "[concat('Microsoft.Network/virtualNetworks/', variables('VNetName'))]"
169 | ],
170 | "properties": {
171 | "ipConfigurations": [
172 | {
173 | "properties": {
174 | "privateIPAllocationMethod": "Dynamic",
175 | "subnet": {
176 | "id": "[variables('GWsubnet-id')]"
177 | },
178 | "publicIPAddress": {
179 | "id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('gatewayPublicIPName'))]"
180 | }
181 | },
182 | "name": "vnetGatewayConfig"
183 | }
184 | ],
185 | "gatewayType": "Vpn",
186 | "vpnType": "RouteBased",
187 | "enableBgp": false
188 | }
189 | },
190 | {
191 | "apiVersion": "2015-05-01-preview",
192 | "type": "Microsoft.Network/networkInterfaces",
193 | "name": "fe1-nif",
194 | "location": "[resourceGroup().location]",
195 | "dependsOn": [
196 | "[concat('Microsoft.Network/virtualNetworks/', variables('VNetName'))]"
197 | ],
198 | "properties": {
199 | "ipConfigurations": [
200 | {
201 | "name": "ipconfig",
202 | "properties": {
203 | "privateIPAllocationMethod": "Dynamic",
204 | "publicIPAddress" : {
205 | "id": "[concat(resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName')),'0')]"
206 | },
207 | "subnet": {
208 | "id": "[variables('FESubnet-id')]"
209 | }
210 | }
211 | }
212 | ]
213 | }
214 | },
215 | {
216 | "apiVersion": "2015-06-15",
217 | "type": "Microsoft.Compute/virtualMachines",
218 | "name": "fe1",
219 | "location": "[resourceGroup().location]",
220 | "dependsOn": [
221 | "[resourceId('Microsoft.Storage/storageAccounts',parameters('storageAccount'))]",
222 | "[resourceId('Microsoft.Network/networkInterfaces','fe1-nif')]"
223 | ],
224 | "properties": {
225 | "hardwareProfile": {
226 | "vmSize": "[variables('vmSize')]"
227 | },
228 | "osProfile": {
229 | "computername": "fe1",
230 | "adminUsername": "[parameters('adminUsername')]",
231 | "adminPassword": "[parameters('adminPassword')]"
232 | },
233 | "storageProfile": {
234 | "imageReference": {
235 | "publisher": "[variables('imagePublisher')]",
236 | "offer": "[variables('imageOffer')]",
237 | "sku": "[variables('windowsOSVersion')]",
238 | "version": "latest"
239 | },
240 | "osDisk": {
241 | "name": "osdisk",
242 | "vhd": {
243 | "uri": "[concat('http://',parameters('storageAccount'),'.blob.core.windows.net/vhds/fe1-osdisk.vhd')]"
244 | },
245 | "caching": "ReadWrite",
246 | "createOption": "FromImage"
247 | }
248 | },
249 | "networkProfile": {
250 | "networkInterfaces": [
251 | {
252 | "id": "[resourceId('Microsoft.Network/networkInterfaces','fe1-nif')]"
253 | }
254 | ]
255 | },
256 | "diagnosticsProfile": {
257 | "bootDiagnostics": {
258 | "enabled": "true",
259 | "storageUri": "[concat('http://',parameters('StorageAccount'),'.blob.core.windows.net')]"
260 | }
261 | }
262 | },
263 | "resources": [
264 | {
265 | "type": "Microsoft.Compute/virtualMachines/extensions",
266 | "name": "fe1/configurefe1",
267 | "apiVersion": "2015-05-01-preview",
268 | "location": "[resourceGroup().location]",
269 | "dependsOn": [
270 | "[resourceId('Microsoft.Compute/virtualMachines', 'fe1')]"
271 | ],
272 | "properties": {
273 | "publisher": "Microsoft.Powershell",
274 | "type": "DSC",
275 | "typeHandlerVersion": "2.8",
276 | "settings": {
277 | "ModulesUrl": "[concat(parameters('assetLocation'),'/lab03/ConfigureFE1.zip')]",
278 | "ConfigurationFunction": "ConfigureFE1.ps1\\ConfigureFE1",
279 | "Properties": {
280 | "MachineName": "fe1"
281 | }
282 | },
283 | "protectedSettings": null
284 | }
285 | }
286 | ]
287 | },
288 | {
289 | "apiVersion": "2015-05-01-preview",
290 | "type": "Microsoft.Network/networkInterfaces",
291 | "name": "be1-nif",
292 | "location": "[resourceGroup().location]",
293 | "dependsOn": [
294 | "[concat('Microsoft.Network/virtualNetworks/', variables('VNetName'))]"
295 | ],
296 | "properties": {
297 | "ipConfigurations": [
298 | {
299 | "name": "ipconfig",
300 | "properties": {
301 | "privateIPAllocationMethod": "Dynamic",
302 | "publicIPAddress" : {
303 | "id": "[concat(resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName')),'1')]"
304 | },
305 | "subnet": {
306 | "id": "[variables('besubnet-id')]"
307 | }
308 | }
309 | }
310 | ]
311 | }
312 | },
313 | {
314 | "apiVersion": "2015-05-01-preview",
315 | "type": "Microsoft.Compute/virtualMachines",
316 | "name": "be1",
317 | "location": "[resourceGroup().location]",
318 | "dependsOn": [
319 | "[concat('Microsoft.Storage/storageAccounts/', parameters('storageAccount'))]",
320 | "Microsoft.Network/networkInterfaces/be1-nif"
321 | ],
322 | "properties": {
323 | "hardwareProfile": {
324 | "vmSize": "[variables('vmSize')]"
325 | },
326 | "osProfile": {
327 | "computername": "be1",
328 | "adminUsername": "[parameters('adminUsername')]",
329 | "adminPassword": "[parameters('adminPassword')]"
330 | },
331 | "storageProfile": {
332 | "imageReference": {
333 | "publisher": "[variables('imagePublisher')]",
334 | "offer": "[variables('imageOffer')]",
335 | "sku": "[variables('windowsOSVersion')]",
336 | "version": "latest"
337 | },
338 | "osDisk": {
339 | "name": "osdisk",
340 | "vhd": {
341 | "uri": "[concat('http://',parameters('storageAccount'),'.blob.core.windows.net/vhds/be1-osdisk.vhd')]"
342 | },
343 | "caching": "ReadWrite",
344 | "createOption": "FromImage"
345 | }
346 | },
347 | "networkProfile": {
348 | "networkInterfaces": [
349 | {
350 | "id": "[resourceId('Microsoft.Network/networkInterfaces','be1-nif')]"
351 | }
352 | ]
353 | }
354 | }
355 | },
356 | {
357 | "type": "Microsoft.Compute/virtualMachines/extensions",
358 | "name": "be1/configurebe1",
359 | "apiVersion": "2015-05-01-preview",
360 | "location": "[resourceGroup().location]",
361 | "dependsOn": [
362 | "[resourceId('Microsoft.Compute/virtualMachines', 'be1')]"
363 | ],
364 | "properties": {
365 | "publisher": "Microsoft.Powershell",
366 | "type": "DSC",
367 | "typeHandlerVersion": "2.8",
368 | "settings": {
369 | "ModulesUrl": "[concat(parameters('assetLocation'),'/lab03/ConfigureBE1.zip')]",
370 | "ConfigurationFunction": "Configurebe1.ps1\\Configurebe1",
371 | "Properties": {
372 | "MachineName": "be1"
373 | }
374 | },
375 | "protectedSettings": null
376 | }
377 | }
378 | ]
379 | }
380 |
381 |
--------------------------------------------------------------------------------