{"id":1925,"library":"azure-graphrbac","title":"Microsoft Azure Graph RBAC Client Library for Python","description":"The `azure-graphrbac` client library for Python provided an interface to manage Azure Active Directory (Azure AD) resources, such as users, groups, and service principals, through the Azure AD Graph API. This library is effectively abandoned due to the deprecation and upcoming retirement of the underlying Azure AD Graph API, which was superseded by Microsoft Graph. The last release was in August 2020, and it is no longer actively maintained.","status":"abandoned","version":"0.61.2","language":"en","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python","tags":["azure","rbac","aad","graph","deprecated"],"install":[{"cmd":"pip install azure-graphrbac","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Provides Azure Active Directory authentication credentials and Azure-specific exceptions.","package":"msrestazure","optional":false},{"reason":"Shared components for Azure SDKs.","package":"azure-common","optional":false}],"imports":[{"note":"The client is in the top-level `azure.graphrbac` namespace, not `azure.mgmt.graphrbac`.","wrong":"from azure.mgmt.graphrbac import GraphRbacManagementClient","symbol":"GraphRbacManagementClient","correct":"from azure.graphrbac import GraphRbacManagementClient"},{"note":"This is the typical credential type used with older Azure SDKs like `azure-graphrbac`.","symbol":"ServicePrincipalCredentials","correct":"from msrestazure.azure_active_directory import ServicePrincipalCredentials"}],"quickstart":{"code":"import os\nfrom msrestazure.azure_active_directory import ServicePrincipalCredentials\nfrom azure.graphrbac import GraphRbacManagementClient\n\ntenant_id = os.environ.get('AZURE_TENANT_ID', '')\nclient_id = os.environ.get('AZURE_CLIENT_ID', '')\nclient_secret = os.environ.get('AZURE_CLIENT_SECRET', '')\n\nif not all([tenant_id, client_id, client_secret]):\n    print(\"Please set AZURE_TENANT_ID, AZURE_CLIENT_ID, and AZURE_CLIENT_SECRET environment variables.\")\nelse:\n    try:\n        # Authenticate using Service Principal Credentials\n        credentials = ServicePrincipalCredentials(\n            client_id=client_id,\n            secret=client_secret,\n            tenant=tenant_id\n        )\n\n        # Create the Graph RBAC client\n        graph_client = GraphRbacManagementClient(credentials, tenant_id)\n\n        # Example: List users (will only work if service principal has sufficient permissions)\n        print(\"Listing first 5 users...\")\n        users = list(graph_client.users.list())[:5]\n        if users:\n            for user in users:\n                print(f\"  User ID: {user.object_id}, Display Name: {user.display_name}\")\n        else:\n            print(\"No users found or insufficient permissions.\")\n\n    except Exception as e:\n        print(f\"An error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to instantiate `GraphRbacManagementClient` using a service principal and list users. Ensure your service principal has appropriate permissions (e.g., 'User.Read.All') in Azure AD. This library relies on the now-deprecated Azure AD Graph API."},"warnings":[{"fix":"Migrate all functionality to use the Microsoft Graph API. The recommended Python SDK for Microsoft Graph is `microsoft-graph-sdk` or using `requests` with `azure-identity` to call the Microsoft Graph REST API directly.","message":"The underlying Azure AD Graph API is officially deprecated and will be retired. Applications using `azure-graphrbac` will eventually cease to function as the API endpoints are removed. Microsoft has ceased investment in Azure AD Graph as of June 30, 2022.","severity":"breaking","affected_versions":"All versions"},{"fix":"Use the Microsoft Graph API for all new development concerning Azure Active Directory resources. Consider `azure-identity` for authentication and `microsoft-graph-sdk` or direct REST API calls for resource management.","message":"`azure-graphrbac` itself is deprecated and no longer receives updates or bug fixes, as its last release was in August 2020. Using this library for new development is strongly discouraged.","severity":"deprecated","affected_versions":"All versions"},{"fix":"If you must use `azure-graphrbac` for legacy reasons, continue to use `msrestazure.azure_active_directory.ServicePrincipalCredentials` for authentication. For modern applications, migrate to Microsoft Graph and its compatible authentication methods.","message":"Modern Azure SDK authentication methods (e.g., `DefaultAzureCredential` from `azure-identity`) are generally not directly compatible with the older `azure-graphrbac` client library without additional integration layers. It typically expects `ServicePrincipalCredentials` or `ApplicationTokenCredentials`.","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"}