/ PowerShell

How to quickly retrieve your Azure subscription consumptions/limits (extended details) in PowerShell

Everytime that I needed to take a look at where I stand up from the limits of an Azure subscription I do the same thing... Open my web browser, go to the management portal and browse between my storage accounts, cloud services, etc...

Here is a quick way in PowerShell to get that information without leaving your blue and white PowerShell console window. Use the -ExtendedDetails switch when calling the Get-AzureSubscription cmdlet.

To get the details of your current subscription

Get-AzureSubscription -Current -ExtendedDetails

or to get the details for all your subscriptions

Get-AzureSubscription -ExtendedDetails

This will give you this kind of informations

ActiveDirectoryUserId      : someone@server.com
Account                    : Microsoft.Azure.Common.Authentication.Models.AzureAccount
Certificate                :
AccountAdminLiveEmailId    : someone@server.com
CurrentCoreCount           : 2
CurrentHostedServices      : 2
CurrentDnsServers          : 0
CurrentLocalNetworkSites   : 0
CurrentVirtualNetworkSites : 2
CurrentStorageAccounts     : 5
MaxCoreCount               : 20
MaxDnsServers              : 20
MaxHostedServices          : 20
MaxLocalNetworkSites       : 20
MaxVirtualNetworkSites     : 50
MaxStorageAccounts         : 100
ServiceAdminLiveEmailId    : someone@server.com
SubscriptionRealName       : Visual Studio Ultimate with MSDN
SubscriptionStatus         : Active
OperationDescription       :
OperationId                :
OperationStatus            :
ServiceEndpoint            : https://management.core.windows.net/
ResourceManagerEndpoint    : https://management.azure.com/
GalleryEndpoint            :
SubscriptionId             : 00000000-0000-0000-0000-000000000000
SubscriptionName           : Visual Studio Ultimate with MSDN
Environment                :
SupportedModes             : AzureServiceManagement,AzureResourceManager
DefaultAccount             :
Accounts                   : {someone@server.com, someone2@server.com}
IsDefault                  : True
IsCurrent                  : True
CurrentStorageAccountName  : mycurrentstorage
TenantId                   :

Happy automation with Azure and PowerShell!

Stephane Lapointe

Stephane Lapointe

I am the proud father of two little gems. A beer & wine enthusiasm. For everything else, I work and play with Azure at day, and I am an Azure MVP & Advisor at night.

Read More