Az / List Network Resources By Subscription Quota
List Network Resources By Subscription Quota
List network resource usage within a subscription, indicating quotas.
az network list-usages az network list-usages #!/bin/bash
# List Network Resources By Subscription Quota
az network list-usages import subprocess
# List Network Resources By Subscription Quota
# Make sure to replace <placeholders> with actual values
def run_command():
cmd = [
"az",
"network",
"list-usages"
]
try:
print(f"Executing: {' '.join(cmd)}")
subprocess.run(cmd, check=True)
except subprocess.CalledProcessError as e:
print(f"Error: {e}")
except FileNotFoundError:
print("Error: az not found. Please install it first.")
if __name__ == "__main__":
run_command() When To Use
During quota monitoring for network resource planning.
Pro Tip
Combine with --output table for a cleaner view of data. Check for deprecated resource types that may affect quotas.
Terminal Output
Expected runtime feedback
| Resource Type | Current Value | Limit | Name |
|-------------------------|---------------|-------|------------|
| Virtual Network | 10 | 20 | MyVnet |
| Public IP | 5 | 10 | MyPublicIP |
| Load Balancer | 1 | 5 | MyLoadBal |
| Network Security Group | 15 | 20 | MyNSG | Anatomy of Output
Understanding the result
"Name": "Standard Tier","Limit": 5,"Current Value": 3 Resource Quota Shows the quota name, total limit, and current usage.
"Name": "Total Network Interfaces","Limit": 20,"Current Value": 18 Network Interface Quota Total count of network interfaces allocated against the quota.
"Name": "Public IP Address","Limit": 10,"Current Value": 5 Public IP Quota Indicates the limit and current count of allocated public IP addresses.
Power User Variants
Optimized versions
az network list-usages --location eastus List network resources by location specific to East US.
az network list-usages --query "[?limit > `0`]" Filter usage output for only those with a positive limit.
Troubleshooting
Common pitfalls
AuthorizationFailed: The user does not have permission to perform action 'Microsoft.Network/locations/usages/read'
Solution: Ensure the user has 'Reader' role assignment in the subscription.
QuotaExceeded: Your subscription has exceeded the limit for the number of network interfaces.
Solution: Request a quota increase via Azure support.
RequestFailed: Operation failed with status: 'NotFound'
Solution: Verify the subscription ID or resource group exists.
Command Breakdown
What each part is doing
-
az - Base Command
- The executable that performs this operation. Here it runs Az before the shell applies any redirect operators.
How To Run
Execution path
- Step 1
Run the command: `az network list-usages`
- Step 2
Verify the output for quotas and limits of network resources.
Alternative Approaches
Comparable commands in other tools
Alternative networking tools for the same job.