better together: microsoft azure virtual machines & powershell desired state configuration

Post on 02-Jul-2015

277 Views

Category:

Technology

3 Downloads

Preview:

Click to see full reader

DESCRIPTION

In this session you'll be introduced to the modern way of configuring Microsoft Windows Server using Powershell Desired State Configuration (DSC) and learn how DSC could be applied to any Virtual Machine in the Microsoft Azure to gain more consistency and velocity.

TRANSCRIPT

$featureName = "telnet-client"

$result = Get-WindowsFeature $featurename

if ($result.InstallState -eq "Installed") {

Write-host "$featureName already installed"}

else{

Write-host "$featureName is not installed, going to install it"Install-WindowsFeature $featureName

}

$node = "localhost"

Configuration SecondDimension{

node $node{

WindowsFeature TelnetClient{

Ensure = "Present"Name = "telnet-client"

} }

}

SecondDimensionStart-DscConfiguration -Wait -Verbose -Path .\SecondDimension -force

$subscriptionname = 'Платформы MSDN'$storageaccountname = 'dimensionsstg'$configurationpath = 'C:\Dimensions\Dimensions.ps1'$vmname = 'Dimensions-SP1'$servicename = 'dimensions'$configurationarchive = 'Dimensions.ps1.zip'$configurationname = 'Dimensions'

#Select subscriptionSelect-AzureSubscription $subscriptionname

#Select storage account where DSC configuration will be storedSet-AzureSubscription $subscriptionname -CurrentStorageAccountName $storageaccountname

#Upload configuration into the storage account. Publish-AzureVMDscConfiguration -ConfigurationPath $configurationpath -Force

#Apply DSC configuration to the $vmname$vmtoupdate = Get-AzureVM -Name $vmname -ServiceName $servicename$vmtoupdate = Set-AzureVMDSCExtension -VM $vmtoupdate `

–ConfigurationArchive $configurationarchive -ConfigurationName $configurationname$vmtoupdate | Update-AzureVM

Configuration Dimensions

{ Import-DscResource -ModuleName xSharepoint2010SP2

node 'localhost'{

xSharepoint2010SP2 Install{

Ensure = 'Present'Key = ‘ABCDE-FGHIJ-KLMNO-PQRST-12345'DownloadLink = 'https://enterurl.com/en_sharepoint_server_2010.iso'MD5FileHash = '16B6B4781336659A28898120F8EA603D'TempFolder = 'C:\Install'

}

} }

http://www.slideshare.net/jallspaw/10-deploys-per-day-dev-and-ops-cooperation-at-flickr

http://blogs.technet.com/b/privatecloud/archive/2013/08/30/introducing-powershell-desired-state-configuration-dsc.aspx

http://blogs.msdn.com/b/powershell/archive/2014/08/07/introducing-the-azure-powershell-dsc-desired-state-configuration-extension.aspx

http://technet.microsoft.com/en-us/library/dn249927.aspx

https://gallery.technet.microsoft.com/scriptcenter/DSC-Resource-Kit-All-c449312d

top related