Checking Azure Resource Quota Limits with PowerShell

The Cloud has Limits?!?!

When migrating workloads into Azure one of the first things that people run into is the limit on the number of resources they can initially consume. We are all told that “the cloud” is limitless, but in reality, cloud providers place all sorts of resource consumption limitations on us.

Many of these limitations are adjustable, but only once a customer asks. So the first step is to know what your limits are and how close you are to hitting them.

Checking your Quota Limits

There are several ways to check the limits of Azure, but the one I prefer is a Powershell Script. It’s easy to use and quick to set up. The script is originally from http://4sysops.com, specifically here: https://4sysops.com/archives/report-azure-resource-usage-with-powershell/

If you do not already have AzureRM PowerShell module installed run this command to install it (from an Elevated PowerShell session)

[bash]Install-Module AzureRM[/bash]

Here is my modified version:

[bash]Import-Module AzureRM
Login-AzureRMAccount
$location="eastus"
$vms=Get-AzureRmVMUsage -Location $location | select @{label="Name";expression={$_.name.LocalizedValue}},currentvalue,limit
$storages=Get-AzureRmStorageUsage | select name,currentvalue,limit
$networks=Get-AzureRmNetworkUsage -Location $location | select @{label="Name";expression={$_.resourcetype}},currentvalue,limit
$result=$vms+$storages+$networks
$result | Export-CSV C:\temp\Resource.csv[/bash]

Also here is a txt file version, remember to switch the extension to ps1 if you want to execute it.

I just added a line to trigger the AzureRM module import, Azure Login, and finally, export to CSV format.

Here is a video of the script in use.

Requesting a Quota Increase

If you do find that you will need to exceed the quota limits in place then you will want to open a support request from the Azure portal to get the limits increased.

Here is the Azure Support article explaining how to request increases.

https://docs.microsoft.com/en-us/azure/azure-supportability/resource-manager-core-quotas-request

Loading

Share This Post

2 Responses to "Checking Azure Resource Quota Limits with PowerShell"

Post Comment