Step-By-Step: Installing and Configuring Azure PowerShell
“IT administrators have nothing but time on their hands…”
A comment heard from time to time by those unfamiliar with the daily rigors of an IT Professional. PowerShell, when harnessed correctly, can be a great time saver to ensure all pertinent tasks are not only completed but automated to alleviate IT workloads. PowerShell helps address the “doing less with more” pressures most businesses place on IT.
While PowerShell has championed enabling on-premise automation, it was only natural that the offering would be extended to service the cloud as well. PowerShell can be utilized to perform a variety of tasks in Azure, via a command prompt or through automated scripts, and provides specific cmdlets to manage Azure. Cmdlets can be used to create, test, deploy, and manage services delivered via Azure thus quickening steps usually conducted through the Azure Management Portal. This Step-By-Step will detail how to get started.
Prerequisites
- Sign up for the 30 day Azure Trial
NOTE: When activating your FREE Trial for Microsoft Azure, you will be prompted for credit card information. This information is used only to validate your identity and your credit card will not be charged, unless you explicitly convert your FREE Trial account to a paid subscription at a later point in time.
- Download and install the Azure PowerShell modules via the Microsoft Web Platform installer
Step 1: Connecting to the Azure Subscription
In the Azure PowerShell console enter the following command:
Add-AzureAccountIn the popup window, enter the email address and password associated with the Azure subscription
NOTE: At this point Azure authenticates then saves the credential information for future use
Step 2: Using Azure PowerShell cmdlets
In the Azure PowerShell console, name choose a unique web app name and type the following command:
New-AzureWebsite CANITPRO
NOTE: Substitute CANITPRO with your chosen web app name. The app starts as soon as it is created.To receive further information about the newly created web app, type the following command:
Get-AzureWebsite -Name CANITPRO
NOTE: Substitute CANITPRO with your chosen web app nameTo stop the newly created web app, type the following command:
Stop-AzureWebsite -Name CANITPRONOTE: Substitute CANITPRO with your chosen web app name
Run the following command to verify that the site's state is stopped:
Get-AzureWebsite
To delete the web app, type the following command:
Remove-AzureWebsite -Name CANITPRO NOTE: Substitute CANITPRO with your chosen web app name
Type the following to confirm that the web app is deleted:
Get-AzureWebsite -Name mySite NOTE: Substitute CANITPRO with your chosen web app name
Further examples of Azure PowerShell cmdlets utilization will be highlighted in future posts.
Comments
- Anonymous
November 30, 2016
Add to the list of ways to get those Cmdlets! In PowerShell 5 you can install them Directly from the PowerShell Gallery usingInstall-Module Azure (for the legacy Cmdlets)Install Module AzureRM (for the modern Cmdlets)Sean