Last active
August 29, 2015 14:20
-
-
Save pkirch/69e733b22ed479fc3751 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 | |
# 401 - http://aka.ms/mva-1505-401 | |
configuration ADDSInstall | |
{ | |
node ("localhost") | |
{ | |
WindowsFeature ADDS | |
{ | |
Ensure = "Present" | |
Name = "AD-Domain-Services" | |
} | |
} | |
} |
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 | |
# 401 - http://aka.ms/mva-1505-401 | |
configuration IISInstall | |
{ | |
node ("localhost") | |
{ | |
WindowsFeature IIS | |
{ | |
Ensure = "Present" | |
Name = "Web-Server" | |
} | |
} | |
} |
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 | |
# 401 - http://aka.ms/mva-1505-401 | |
#region Create VM | |
# Settings | |
$subscriptionName = "MSFT MVA Live" # Get-AzureSubscription | |
$location = "West Europe" # Get-AzureLocation | |
$serviceName = "mvaconfig401" | |
$storageAccountName = $serviceName | |
$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 | | |
New-AzureVM -ServiceName $serviceName -Location $location -WaitForBoot | |
#endregion | |
# Package configuration for IIS installation | |
Publish-AzureVMDscConfiguration -ConfigurationPath "C:\Users\pkirch\OneDrive @ Microsoft\FY15\Content\2015-02-28 MVA Deployments\4 DSC\IISInstall.ps1" | |
# Apply configuration for IIS installation | |
Get-AzureVM -ServiceName $serviceName -Name $vmName | | |
Set-AzureVMDSCExtension -ConfigurationArchive "IISInstall.ps1.zip" -ConfigurationName "IISInstall" | | |
Update-AzureVM | |
# Package configuration for ADDS installation | |
Publish-AzureVMDscConfiguration -ConfigurationPath "C:\Users\pkirch\OneDrive @ Microsoft\FY15\Content\2015-02-28 MVA Deployments\4 DSC\ADDSInstall.ps1" | |
# Apply configuration for ADDS installation | |
Get-AzureVM -ServiceName $serviceName -Name $vmName | | |
Set-AzureVMDSCExtension -ConfigurationArchive "ADDSInstall.ps1.zip" -ConfigurationName "ADDSInstall" | | |
Update-AzureVM | |
# Get configuration status | |
Get-AzureVMDscExtensionStatus -ServiceName $serviceName -Name $vmName | |
Get-AzureVM -ServiceName $serviceName -Name $vmName | | |
Get-AzureVMDscExtension |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment