Created
May 3, 2015 13:03
-
-
Save pkirch/6220a3d43e35afbf582d to your computer and use it in GitHub Desktop.
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
# Microsoft Virtual Academy | |
# Automatisierte Konfiguration in Azure im Überblick | |
# 402 - http://aka.ms/mva-1505-402 | |
# Settings | |
$subscriptionName = "MSFT MVA Live" # Get-AzureSubscription | |
$location = "West Europe" # Get-AzureLocation | |
$serviceName = "mvaconfig402" | |
$storageAccountName = "mvaconfig401" # Reuse storage account with already published PS configurations. | |
$adminUsername = "adm_demo" | |
$adminPassword = "Azureisttoll!" | |
$imageFamily = "Windows Server 2012 R2 Datacenter" | |
$vmName = $serviceName | |
$instanceSize = "Medium" # Get-AzureRoleSize | |
# In case you have more than one Azure subscription, select one. | |
Select-AzureSubscription -SubscriptionName $subscriptionName | |
# Get latest image for defined image family. | |
# MVA03-Images.ps1 / https://gist.github.com/pkirch/058d757a799fa0087241 | |
$imageName = Get-AzureVMImage | | |
Where-Object -Property ImageFamily -eq $imageFamily | | |
Sort-Object -Property PublishedDate -Descending | | |
Select-Object -ExpandProperty ImageName -First 1 | |
# Create storage account and set is as current. | |
#New-AzureStorageAccount -Location $location -StorageAccountName $storageAccountName -Type Standard_LRS | |
Set-AzureSubscription -SubscriptionName $subscriptionName -CurrentStorageAccountName $storageAccountName | |
# Create new VM configuration, add provisioning data to it, and start it. | |
New-AzureVMConfig -ImageName $imageName -InstanceSize $instanceSize -Name $vmName | | |
Add-AzureProvisioningConfig -Windows -AdminUsername $adminUsername -Password $adminPassword | | |
Add-AzureEndpoint -LocalPort 80 -Name HTTP -Protocol tcp -PublicPort 80 | | |
Set-AzureVMDSCExtension -ConfigurationArchive "IISInstall.ps1.zip" -ConfigurationName "IISInstall" | | |
Set-AzureVMDSCExtension -ConfigurationArchive "ADDSInstall.ps1.zip" -ConfigurationName "ADDSInstall" | | |
New-AzureVM -ServiceName $serviceName -Location $location |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment