To run Windows Azure PowerShell Cmdlets, first acquire a Windows Azure subscription. If not having one already, from https://aka.ms/200 you can easily get a free 30-day trial subscription with $200 credit. Then simply follow the instructions at https://aka.ms/AzureCmdlets.
Overall, here are the steps while running as a local administrator:
- Go to https://aka.ms/AzureCmdlets and install the PowerShell module. Once installed, it adds a Windows Azure group of tiles in Apps screen.
- In PowerShell, Set-ExecutionPolicy RemoteSigned
- In PowerShell, Import-Module ‘c:\Program Files (x86)\Microsoft SDKs\Windows Azure\PowerShell\Azure\Azure.psd1’ here assuming the local machine is 64-bit
- In PowerShell, Get-AzurePublishSettingsFile and log in your Windows Azure subscription, if not already, and save the publishsettings file
- In PowerShell, Import-AzurePublishSettingsFile <mysettings>.publishsettings
- In PowerShell, test it out by issuing Windows Azure Cmdlets like a simple query, Get-AzureLocation, to query Windows Azure form your local machine
Once Windows Azure Cmdlets are configured, one can then employ the two Set-AzureSubscription statements to execute cmdlets when deploying resources to the subscription.
- Set-AzureSubscription -DefaultSubscription $subscription
- Set-AzureSubscription -SubscriptionName ‘the Windows Azure subscription name’ -CurrentStorageAccount ‘an intended storage account’
Windows Azure PowerShell is something that every IT pros really should install and master. It should be clear to all that PowerShell is the strategic automation tool in any Windows environment. Specifically on Windows Azure PowerShell Cmdlets, you can set up and test an automation the automation you can develop is numerous. With Windows Azure Cmdlets, you now have an access to Microsoft data centers globally available from your local device without the need to log into Windows Azure Management Portal.
In upcoming blogs, I will go through the script I used to automate the IaaS deployment to a virtual network in Windows Azure.