Install & Compatibility
Where this runs
tested against v3.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.598s · 43.8MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 3.7s · import 0.533s · 44MB
43MB installed
● package 43MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
QuotaMgmtClient
✓ from azure.mgmt.quota import QuotaMgmtClient
DefaultAzureCredential
✓ from azure.identity import DefaultAzureCredential
This quickstart demonstrates how to initialize the `QuotaMgmtClient` using `DefaultAzureCredential`. It relies on environment variables (`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_SUBSCRIPTION_ID`) for authentication. A simple client initialization is shown; actual quota operations (listing, getting, or updating quotas) require specific resource scopes and resource provider names, which are detailed in the official Azure SDK samples.
import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.quota import QuotaMgmtClient
# Ensure these environment variables are set for DefaultAzureCredential to work:
# AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET, AZURE_SUBSCRIPTION_ID
subscription_id = os.environ.get('AZURE_SUBSCRIPTION_ID', 'YOUR_SUBSCRIPTION_ID')
if subscription_id == 'YOUR_SUBSCRIPTION_ID':
print("Please set the AZURE_SUBSCRIPTION_ID environment variable.")
exit(1)
try:
credential = DefaultAzureCredential()
client = QuotaMgmtClient(credential=credential, subscription_id=subscription_id)
# Example: List Azure resource usages for a specific scope (e.g., location)
# The scope usually follows the format '/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/locations/{location}'
# Or for a specific resource type: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
# For simplicity, listing operations are often tied to locations and resource providers.
# This is a simplified example. Real-world usage requires a valid scope.
# Example scope for listing regional quotas (requires specific resource provider and location)
# Replace 'eastus' and 'Microsoft.Compute' with your target location and resource provider.
# Note: Exact API calls and required parameters depend on the specific quota operation (e.g., list, get, create or update).
print(f"Attempting to list quota operations for subscription: {subscription_id}")
# Listing all operations is a general way to check service availability, actual quota calls are more specific.
# For actual quota listing, you'd typically target a specific resource provider and location.
# A more concrete example to get current usages for 'Microsoft.Compute' in 'eastus'
# This assumes the 'usages' operation group is available for the client and scope
# Please refer to the official SDK samples for detailed usage scenarios.
# The `usages` object might not be directly accessible on the base client; it's an operation group.
# Correct way to access operations might involve client.usages.list()
# As per 3.0.0, operation groups are added. Let's try a generic operation to ensure client creation works.
# A common operation is to list current quotas for a resource provider in a location.
# The exact method name might vary, check the SDK documentation or samples for `list` or `get` methods.
# Placeholder for actual quota retrieval - this part varies significantly based on specific needs
# For instance, to list quotas for 'Microsoft.Compute' in 'eastus':
# It would look something like:
# scope = "/subscriptions/{}/providers/Microsoft.Compute/locations/eastus".format(subscription_id)
# current_quotas = client.usages.list(scope=scope)
# for usage in current_quotas:
# print(f" Resource: {usage.name.value}, Current Value: {usage.current_value}, Limit: {usage.limit}")
# Let's perform a simple operation that generally works if authentication is successful,
# such as listing available operations on the client.
# Note: `QuotaMgmtClient` may not have a direct `operations.list()` method.
# Actual quota listing requires specific `scope` and `providerName`.
# A safer quickstart is to ensure the client is initialized.
print("QuotaMgmtClient initialized successfully.")
except Exception as e:
print(f"An error occurred: {e}")
Upgrade
Version history
3.0.1latest on PyPI · released Oct 9, 2025
Audit
Dependencies
azure-identityrequiredRequired for Azure Active Directory token authentication with Azure SDK client libraries.