Registry / azure / azure-mgmt-quota

azure-mgmt-quota

JSON →
library3.0.1pypypiunverified

The `azure-mgmt-quota` library is the Microsoft Azure Quota Management Client Library for Python. It provides programmatic access to manage Azure resource quotas, including retrieving current limits, checking usage, and requesting quota increases. The current version is 3.0.1, and it follows the Azure SDK release cadence, with frequent updates to align with Azure service changes.

pip install azure-mgmt-quota azure-identity
INSTALL
IMPORT
SIG · AZURE-MGMT-QUOTA
A
azure-mgmt-quota
azurepythonv3.0.1
Install
3.7s avg
Import
566ms
Disk
43MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.598s · 43.8MB
glibc
py 3.103.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}")
Debug
Known issues
breakingVersion 3.0.0 introduced significant changes, including new parameters for `QuotaMgmtClient.__init__` (e.g., `cloud_setting`) and the addition of new operation groups like `group_quota_usages` and `group_quota_location_settings`. Code directly interacting with client initialization parameters or previously flat methods might break.
fix
Review the official SDK documentation and samples for version 3.x. Adjust client instantiation and method calls to use the new operation groups and parameters as required.
affects: >=3.0.0
deprecatedSupport for Python 2.7 has officially ended for Azure SDK Python packages. Attempts to use `azure-mgmt-quota` with Python 2.7 will likely result in compatibility issues or failures.
fix
Upgrade your Python environment to 3.9 or higher.
affects: <=2.x
gotchaAuthenticating Azure management SDKs now primarily uses `azure-identity` credentials (e.g., `DefaultAzureCredential`). Older patterns involving `msrestazure` credentials are deprecated and may not work correctly or be as secure.
fix
Migrate your authentication code to use `azure-identity`. Ensure `azure-identity` is installed and configure environment variables (AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET, AZURE_SUBSCRIPTION_ID) or other credential types.
affects: <3.0.0
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.
Agent activity
24 hits · last 30 days
node
20
OpenAI (training)
1
Resources
azure-mgmt-quota — pip install azure-mgmt-quota · libregistry