Manage Learn to apply best practices and optimize your operations.

Conveniently manage resources with Azure PowerShell version 1.0

Microsoft Azure PowerShell version 1.0 provides users with greater flexibility and reduces code complexity through the use of over 1000 PowerShell cmdlets.

There are several ways to interact with resources deployed in an Azure Public Cloud. You can use the Azure Preview...

Portal, Azure PowerShell, Chef for Microsoft Azure, Azure Command-Line-Interface, visual studio and third-party tools. However, Azure administrators typically find PowerShell to be the most convenient way to manage Azure resources.

Initially, Microsoft released Azure PowerShell version 0.8.3. There were approximately 400 PowerShell cmdlets that you could use to manage and automate repeated tasks, such as provisioning VMs, configuring Azure virtual networks, backing up and restoring VMs and managing Azure storage. Microsoft further invested in Azure PowerShell and introduced a new version called Azure PowerShell Version 1.0. Many Azure admins are either unaware of it or do not realize that the Azure PowerShell Version 1.0 offers more than 1000 PowerShell cmdlets to manage almost every aspect of an Azure subscription. Azure PowerShell Version 1.0 not only offers approximately more cmdlets, but also offers greater flexibility.

Another one of the major benefits of using Azure PowerShell version 1.0 is that it can reduce complexity in the PowerShell code. For example, in the earlier version of Azure PowerShell, you had to specify Azure storage account keys in order to work with Azure storage accounts, which, in turn, increased the risk of human errors if script was used to access multiple Azure storage accounts. In Azure PowerShell Version 1.0, there is no need to remember or specify Azure storage account keys. All you need to do is run cmdlets that can interact with the Azure storage accounts to get the required information. For example, to get the total gigabytes (GB) used by the storage accounts in a particular Azure resource group, you can execute the simple Azure commands shown below:

There are several ways to interact with resources deployed in an Azure Public Cloud. You can use the Azure Preview Portal, Azure PowerShell, Chef for Microsoft Azure, Azure Command-Line-Interface, visual studio and third-party tools. However, Azure administrators typically find PowerShell to be the most convenient way to manage Azure resources.

Initially, Microsoft released Azure PowerShell version 0.8.3. There were approximately 400 PowerShell cmdlets that you could use to manage and automate repeated tasks, such as provisioning VMs, configuring Azure virtual networks, backing up and restoring VMs and managing Azure storage. Microsoft further invested in Azure PowerShell and introduced a new version called Azure PowerShell Version 1.0. Many Azure admins are either unaware of it or do not realize that the Azure PowerShell Version 1.0 offers more than 1000 PowerShell cmdlets to manage almost every aspect of an Azure subscription. Azure PowerShell Version 1.0 not only offers approximately more cmdlets, but also offers greater flexibility.

Another one of the major benefits of using Azure PowerShell version 1.0 is that it can reduce complexity in the PowerShell code. For example, in the earlier version of Azure PowerShell, you had to specify Azure storage account keys in order to work with Azure storage accounts, which, in turn, increased the risk of human errors if script was used to access multiple Azure storage accounts. In Azure PowerShell Version 1.0, there is no need to remember or specify Azure storage account keys. All you need to do is run cmdlets that can interact with the Azure storage accounts to get the required information. For example, to get the total gigabytes (GB) used by the storage accounts in a particular Azure resource group, you can execute the simple Azure commands shown below:

$CompGBNow=Get-AzureRmStorageAccount -ResourceGroupName “ResGroup1” -Name “StorageAccount1” | Get-AzureStorageContainer | Get-AzureStorageBlob | Measure-Object Length -Sum | select-object sum

$CompGBNow.Sum/1024/1024/1024

The first command collects all the blobs in the storage account named "StorageAccount1" in the resource group called "ResGroup1." The second command returns the total GB used by the storage account.

Other Azure PowerShell cmdlets that you may find useful are Get-AzureRMResource, which you can use to retrieve a list of resources deployed in all resource groups or in a particular resource group. The Get-AzureRMADGroup command assembles a list of groups created in Azure Active Directory (AD), while Get-AzureRMADGroupMember lists members of all or a particular Azure AD group. The PowerShell command shown below retrieves all resources deployed in an Azure subscription with their resource group name and output is stored in a comma-separated values file.

Get-AzureRMResource | Export-CSV C:\Temp\AllRMResources.CSV

Next Steps

Manage your Azure resources affectively with these tools

Azure lures enterprises to the public cloud

Rackspace strikes a deal with Microsoft for Azure support

Top tips for Azure resource management in 2016

This was last published in October 2016

Dig Deeper on Virtual machine provisioning and configuration

PRO+

Content

Find more PRO+ content and other member only offers, here.

Join the conversation

1 comment

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

Which Azure PowerShell cmdlet do you find most useful?
Cancel

-ADS BY GOOGLE

SearchVMware

SearchWindowsServer

SearchCloudComputing

SearchVirtualDesktop

SearchDataCenter

Close