Created
May 9, 2018 17:53
-
-
Save CodeHeight/d409d5bfc0f3fe63ce2cfe2d214806d9 to your computer and use it in GitHub Desktop.
Build and Deploy Private Virtual Machine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Define Deployment Variables | |
{ | |
$location = 'southcentralus' | |
$resourceGroupName = 'rg874826' | |
$resourceDeploymentName = 'contoso-iaas-deployment' | |
$templatePath = $env:SystemDrive + '\Users\LabUser\Documents\HOL_Lab_Files\3_Deploying_Virtual_Machines' | |
$templateFile = 'contosoIaaS_3.json' | |
$template = $templatePath + '\' + $templateFile | |
$password = "C0nts0sP@55" | |
$securePassword = $password | ConvertTo-SecureString -AsPlainText -Force | |
} | |
### Deploy Resources | |
{ | |
$additionalParameters = New-Object -TypeName Hashtable | |
$additionalParameters['vmPrivateAdminPassword'] = $securePassword | |
New-AzureRmResourceGroupDeployment ` | |
-Name $resourceDeploymentName ` | |
-ResourceGroupName $resourceGroupName ` | |
-TemplateFile $template ` | |
@additionalParameters ` | |
-Verbose -Force | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment