Install & Compatibility
Where this runs
tested against v10.1.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.95 runs
installs and imports cleanly · install 0.0s · import 0.604s · 53.4MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 4.5s · import 0.548s · 54MB
53MB installed
● package 53MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
PostgreSQLManagementClient
✓ from azure.mgmt.rdbms.postgresql import PostgreSQLManagementClient
✗ from azure.mgmt.rdbms import PostgreSQLManagementClient
The specific RDBMS clients (PostgreSQL, MySQL, MariaDB) reside in their respective sub-packages, not directly under `azure.mgmt.rdbms`.
MySQLManagementClient
✓ from azure.mgmt.rdbms.mysql import MySQLManagementClient
MariaDBManagementClient
✓ from azure.mgmt.rdbms.mariadb import MariaDBManagementClient
DefaultAzureCredential
✓ from azure.identity import DefaultAzureCredential
This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential` and then list all Azure PostgreSQL servers within a specified subscription. It requires `AZURE_SUBSCRIPTION_ID` to be set as an environment variable or replaced in the code, and appropriate Azure credentials (e.g., via `az login` or service principal environment variables) for authentication.
import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.rdbms.postgresql import PostgreSQLManagementClient
# Set your Azure Subscription ID and Resource Group name as environment variables
# or replace with actual values. Ensure AZURE_TENANT_ID, AZURE_CLIENT_ID,
# AZURE_CLIENT_SECRET are also set for service principal authentication,
# or be logged in via 'az login' for user authentication.
SUBSCRIPTION_ID = os.environ.get('AZURE_SUBSCRIPTION_ID', 'YOUR_SUBSCRIPTION_ID')
if SUBSCRIPTION_ID == 'YOUR_SUBSCRIPTION_ID':
print("Warning: Please set the AZURE_SUBSCRIPTION_ID environment variable or replace 'YOUR_SUBSCRIPTION_ID'.")
exit()
def list_postgresql_servers():
try:
# Authenticate with Azure
credential = DefaultAzureCredential()
# Create a PostgreSQL management client
pg_client = PostgreSQLManagementClient(credential, SUBSCRIPTION_ID)
print(f"Listing PostgreSQL servers in subscription {SUBSCRIPTION_ID}:")
for server in pg_client.servers.list():
print(f" - Name: {server.name}, Resource Group: {server.id.split('/resourceGroups/')[1].split('/')[0]}, Location: {server.location}, State: {server.user_visible_state}")
except Exception as e:
print(f"An error occurred: {e}")
if __name__ == "__main__":
list_postgresql_servers()
Debug
Known issues
gotchaThe `azure-mgmt-rdbms` package acts as a meta-package. You cannot instantiate a generic `RdbmsManagementClient` directly from `azure.mgmt.rdbms`. Instead, you must import and use specific clients for each RDBMS type (e.g., `PostgreSQLManagementClient`, `MySQLManagementClient`, `MariaDBManagementClient`) from their respective sub-packages (e.g., `azure.mgmt.rdbms.postgresql`).fixAlways import clients from their specific sub-packages: `from azure.mgmt.rdbms.<rdbms_type> import <RdbmsType>ManagementClient`.
affects: All versions
breakingMajor version updates of `azure-mgmt-rdbms` (e.g., from 9.x to 10.x) typically align with updates to the underlying Azure REST API versions. These updates can introduce breaking changes in client constructors, method signatures, parameter names, or resource model schemas. Always review the official migration guides or changelogs when upgrading to a new major version.fixConsult the official Azure SDK for Python documentation and GitHub release notes for migration guidance before upgrading. Test your application thoroughly after an upgrade.
affects: Major version changes (e.g., 9.x to 10.x)
gotchaAuthentication issues are common. `DefaultAzureCredential` relies on a cascade of authentication methods (environment variables, managed identity, Azure CLI, etc.). If not configured correctly, you'll encounter `ClientAuthenticationError` or similar credential errors.fixEnsure `AZURE_TENANT_ID`, `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET` (for service principal) are correctly set, or that you are logged in via `az login` for developer authentication. Verify your service principal/user has the necessary RBAC permissions on the target Azure resources.
affects: All versions
gotchaOperations with Azure management clients require a subscription ID. If the `AZURE_SUBSCRIPTION_ID` environment variable is not set, or the subscription ID is not explicitly passed during client instantiation (e.g., `RdbmsManagementClient(credential, subscription_id)`), you will encounter errors indicating a missing subscription ID when performing resource management operations.fixEnsure the `AZURE_SUBSCRIPTION_ID` environment variable is correctly set, or explicitly pass the subscription ID to the client constructor or relevant method calls.
affects: All versions
gotchaMany Azure SDK for Python management clients require the Azure subscription ID to be provided, either through an environment variable (AZURE_SUBSCRIPTION_ID) or as a parameter to the client constructor or method calls. Failure to provide it will result in warnings or errors indicating a missing subscription ID.fixEnsure the AZURE_SUBSCRIPTION_ID environment variable is set or pass the subscription ID directly when instantiating clients or making resource management calls.
affects: All versions
Upgrade
Version history
10.1.1latest on PyPI · released Nov 25, 2025
Audit
Dependencies
azure-identityrequiredRequired for authentication with Azure services. It provides `DefaultAzureCredential` to handle various authentication flows.