{"id":1377,"library":"azure-mgmt-rdbms","title":"Azure RDBMS Management","description":"The `azure-mgmt-rdbms` library provides Python client APIs for managing Azure Relational Database services (PostgreSQL, MySQL, MariaDB). It allows for programmatic creation, configuration, and deletion of database servers, databases, and related resources. The current version is `10.1.1` and it follows the Azure SDK release cadence, with frequent updates to align with new Azure API features and bug fixes.","status":"active","version":"10.1.1","language":"en","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/rdbms/azure-mgmt-rdbms","tags":["azure","cloud","database","rdbms","management","postgresql","mysql","mariadb"],"install":[{"cmd":"pip install azure-mgmt-rdbms azure-identity","lang":"bash","label":"Install core and identity"}],"dependencies":[{"reason":"Required for authentication with Azure services. It provides `DefaultAzureCredential` to handle various authentication flows.","package":"azure-identity","optional":false}],"imports":[{"note":"The specific RDBMS clients (PostgreSQL, MySQL, MariaDB) reside in their respective sub-packages, not directly under `azure.mgmt.rdbms`.","wrong":"from azure.mgmt.rdbms import PostgreSQLManagementClient","symbol":"PostgreSQLManagementClient","correct":"from azure.mgmt.rdbms.postgresql import PostgreSQLManagementClient"},{"symbol":"MySQLManagementClient","correct":"from azure.mgmt.rdbms.mysql import MySQLManagementClient"},{"symbol":"MariaDBManagementClient","correct":"from azure.mgmt.rdbms.mariadb import MariaDBManagementClient"},{"symbol":"DefaultAzureCredential","correct":"from azure.identity import DefaultAzureCredential"}],"quickstart":{"code":"import os\nfrom azure.identity import DefaultAzureCredential\nfrom azure.mgmt.rdbms.postgresql import PostgreSQLManagementClient\n\n# Set your Azure Subscription ID and Resource Group name as environment variables\n# or replace with actual values. Ensure AZURE_TENANT_ID, AZURE_CLIENT_ID,\n# AZURE_CLIENT_SECRET are also set for service principal authentication,\n# or be logged in via 'az login' for user authentication.\nSUBSCRIPTION_ID = os.environ.get('AZURE_SUBSCRIPTION_ID', 'YOUR_SUBSCRIPTION_ID')\n\nif SUBSCRIPTION_ID == 'YOUR_SUBSCRIPTION_ID':\n    print(\"Warning: Please set the AZURE_SUBSCRIPTION_ID environment variable or replace 'YOUR_SUBSCRIPTION_ID'.\")\n    exit()\n\ndef list_postgresql_servers():\n    try:\n        # Authenticate with Azure\n        credential = DefaultAzureCredential()\n        \n        # Create a PostgreSQL management client\n        pg_client = PostgreSQLManagementClient(credential, SUBSCRIPTION_ID)\n        \n        print(f\"Listing PostgreSQL servers in subscription {SUBSCRIPTION_ID}:\")\n        for server in pg_client.servers.list():\n            print(f\"  - Name: {server.name}, Resource Group: {server.id.split('/resourceGroups/')[1].split('/')[0]}, Location: {server.location}, State: {server.user_visible_state}\")\n            \n    except Exception as e:\n        print(f\"An error occurred: {e}\")\n\nif __name__ == \"__main__\":\n    list_postgresql_servers()\n","lang":"python","description":"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."},"warnings":[{"fix":"Always import clients from their specific sub-packages: `from azure.mgmt.rdbms.<rdbms_type> import <RdbmsType>ManagementClient`.","message":"The `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`).","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consult the official Azure SDK for Python documentation and GitHub release notes for migration guidance before upgrading. Test your application thoroughly after an upgrade.","message":"Major 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.","severity":"breaking","affected_versions":"Major version changes (e.g., 9.x to 10.x)"},{"fix":"Ensure `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.","message":"Authentication 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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}