Azure PowerShell – Overview

On Windows Server 2008, Microsoft introduces us back to the world of the command line with PowerShell. At the beginning, I must admit, at that time I was a bit reluctant to this command line tool, because I’m a GUI guy! But with time and all my peers tell me the benefits, I slowly start to play with and see the benefits! Now I can’t leave without it!

So, what is Azure PowerShell? Azure PowerShell is a module of the Windows PowerShell that every Windows OS (either client or server) have by default installed and now becomes part of the OS. In this case is to manage Azure!

To manage Azure resources by using Windows PowerShell, you first need to install the Azure PowerShell modules that provide this functionality. The Azure PowerShell modules belong to the following three categories:

  • Azure Resource Manager. A collection of Azure Resource Manager component modules, consisting of cmdlets that implement features of individual Azure Resource Manager resource providers. For example, cmdlets of the Compute provider (which facilitates the deployment of Azure Virtual Machines) reside in the Compute module.
  • Azure Service Management. A collection of cmdlets that implement features of the Service Management model, which is also known as the classic deployment model.
  • Azure Storage. A collection of cmdlets that facilitate the management of Azure Storage.

The two primary methods of installing the latest versions of the Azure PowerShell modules are:

  • The Web Platform Installer (Web PI). This installation method is available directly from the Azure Downloads page. It simplifies the setup process by relying on Web PI capabilities, which include obtaining the most recent version of the installation files and automatically deploying and configuring any prerequisites.
  • The PowerShell Gallery. This installation method relies on the capabilities built in to the PowerShell Gallery, which constitutes the central repository for Windows PowerShell content. It requires either Windows Management Framework 5.0 with Windows PowerShell 5.0 or the Package Management component on systems running Windows PowerShell version 3 and Windows PowerShell version 4. Windows Management Framework 5.0 is included by default in Windows 10, and for earlier versions of the Windows operating system, it is available for download from the Microsoft Download Center. To perform the installation, run the Install-Module cmdlet from an elevated session within the Windows PowerShell console or from the Windows PowerShell ISE console pane. In particular, to install the Azure PowerShell modules from the PowerShell Gallery, run the following commands at the Windows PowerShell command prompt:

Install-Module AzureRM
Install-Module Azure

Note: Web PI installs Azure PowerShell modules within the %ProgramFiles%\Microsoft SDKs\Azure\PowerShell directory structure. PowerShell Gallery–based installations use the %ProgramFiles%\WindowsPowerShell\Modules directory structure. Both installation methods automatically update the $env:PSModulePath variable. However, you also have the option of explicitly importing the Azure PowerShell modules into your current Windows PowerShell session by running the following commands at the Windows PowerShell command prompt:

Import-Module Azure

It is also possible to import individual component modules. For example, to import only the AzureRM.Compute module, run the following command at the Windows PowerShell command prompt:

Import-Module AzureRM.Compute

You can easily distinguish between Azure Resource Manager and Service Management cmdlets because they use slightly different formats. Both types of cmdlets use the verb-noun syntax, but while the noun portions of Azure Resource Manager cmdlets start with AzureRm, the Service Management cmdlets include only Azure (without the Rm string). For example, to deploy a new Azure virtual machine by using Azure Resource Manager, you run the New-AzureRmVM cmdlet. To accomplish the same task in the classic deployment model, you use the New-AzureVM cmdlet.

Azure AD module for Windows PowerShell

If you plan to manage Azure Active Directory (Azure AD) by using Windows PowerShell, you need a separate module intended specifically for this purpose, because this functionality is not included in the Azure PowerShell modules. You can use the Azure AD module to manage objects, such as users, groups, devices, and applications, and other aspects of your Azure AD tenant.



Marcos Nogueira

With more than 18 years experience in Datacenter Architectures, Marcos Nogueira is currently working as a Principal Cloud Solution Architect. He is an expert in Private and Hybrid Cloud, with a focus on Microsoft Azure, Virtualization and System Center. He has worked in several industries, including Aerospace, Transportation, Energy, Manufacturing, Financial Services, Government, Health Care, Telecoms, IT Services, and Gas & Oil in different countries and continents. Marcos was a Canadian MVP in System Center Cloud & Datacenter Managenment and he has +14 years as Microsoft Certified, with more than 100+ certifications (MCT, MCSE, and MCITP, among others). Marcos is also certified in VMware, CompTIA and ITIL v3. He assisted Microsoft in the development of workshops and special events on Private & Hybrid Cloud, Azure, System Center, Windows Server, Hyper-V and as a speaker at several Microsoft TechEd/Ignite and communities events around the world.

Leave a Reply

Your email address will not be published. Required fields are marked *