{"id":6535,"library":"azure-mgmt-managedservices","title":"Azure Managed Services Management Client Library","description":"The `azure-mgmt-managedservices` library is the Microsoft Azure Managed Services Client Library for Python, part of the Azure Resource Manager (ARM) generation of management APIs. It allows developers to programmatically interact with Azure Managed Services, such as managing registration definitions and assignments. The current stable version is 6.0.0, released in April 2021. Azure SDKs typically follow a consistent release cadence with updates across various services.","status":"active","version":"6.0.0","language":"en","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python","tags":["azure","cloud","managed services","management","sdk","arm"],"install":[{"cmd":"pip install azure-mgmt-managedservices azure-identity","lang":"bash","label":"Install with identity"}],"dependencies":[{"reason":"Required for authenticating with Azure services.","package":"azure-identity","optional":false}],"imports":[{"symbol":"ManagedServicesClient","correct":"from azure.mgmt.managedservices import ManagedServicesClient"},{"note":"The credential system was revamped in v6.0.0; use azure-identity classes like DefaultAzureCredential instead of older credential types.","wrong":"from azure.common.credentials import ServicePrincipalCredentials","symbol":"DefaultAzureCredential","correct":"from azure.identity import DefaultAzureCredential"}],"quickstart":{"code":"import os\nfrom azure.identity import DefaultAzureCredential\nfrom azure.mgmt.managedservices import ManagedServicesClient\n\n# Set your Azure Subscription ID as an environment variable\n# AZURE_SUBSCRIPTION_ID = \"YOUR_SUBSCRIPTION_ID\"\nsubscription_id = os.environ.get(\"AZURE_SUBSCRIPTION_ID\", \"\")\n\nif not subscription_id:\n    raise ValueError(\"AZURE_SUBSCRIPTION_ID environment variable not set.\")\n\n# Authenticate using DefaultAzureCredential. This will try various methods:\n# AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_TENANT_ID environment variables, \n# Managed Identity, Azure CLI, Visual Studio Code, etc.\ncredential = DefaultAzureCredential()\n\n# Create a ManagedServicesClient\nclient = ManagedServicesClient(credential, subscription_id)\n\n# List registration definitions (example operation)\nprint(\"Listing registration definitions:\")\nfor rd in client.registration_definitions.list():\n    print(f\"  - {rd.id}: {rd.name}\")","lang":"python","description":"This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential` and then list all registration definitions within your subscription using the `ManagedServicesClient`."},"warnings":[{"fix":"Migrate your authentication code to use `azure-identity`. The `credentials` parameter on the client constructor was also renamed to `credential`. For example: `ManagedServicesClient(credential=DefaultAzureCredential(), ...)`","message":"The credential system underwent a complete revamp in version 6.0.0 (and its beta predecessors). Classes like `azure.common.credentials` or `msrestazure.azure_active_directory` are no longer supported. You *must* use classes from the `azure-identity` package, such as `DefaultAzureCredential`.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Instead of `client.config.enable_logging = True`, pass `enable_logging=True` directly to the client constructor: `ManagedServicesClient(credential, subscription_id, enable_logging=True)`.","message":"The `config` attribute is no longer directly available on client objects. Configuration options should be passed as keyword arguments during client initialization.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Update any code that expects specific types or methods from `msrest.polling.LROPoller` to use the new `azure.core.polling.LROPoller` interface.","message":"Operations that previously returned `msrest.polling.LROPoller` for long-running operations now return `azure.core.polling.LROPoller`.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Ensure your project runs on Python 3.8 or newer to receive continued support and updates.","message":"Support for Python 2.7 has officially ended for Azure SDK Python packages as of January 1, 2022. While version 6.0.0 might have been tested with older Python 3 versions at release, current active support targets Python 3.8+.","severity":"deprecated","affected_versions":"All versions, regarding Python runtime"},{"fix":"Always call `.result()` on the returned poller object for LROs to ensure the operation finishes and to retrieve the final resource or status.","message":"For long-running operations (LROs), the client will return a poller object. You must call `.result()` on the poller to wait for the operation to complete and get its final result. For asynchronous clients (found in the `aio` namespace), you'll use `await poller.result()`.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[{"fix":"Install the package using pip: `pip install azure-mgmt-managedservices`","cause":"The `azure-mgmt-managedservices` package is not installed in the Python environment.","error":"ModuleNotFoundError: No module named 'azure.mgmt.managedservices'"},{"fix":"Update authentication to use classes from `azure-identity`, such as `DefaultAzureCredential` or `ClientSecretCredential`. Example: `from azure.identity import DefaultAzureCredential; credential = DefaultAzureCredential()`","cause":"The `azure-mgmt-managedservices` library (version 6.0.0 and above) requires credentials from `azure-identity`, but an older `azure.common.credentials.ServicePrincipalCredentials` object was provided.","error":"AttributeError: 'ServicePrincipalCredentials' object has no attribute 'get_token'"},{"fix":"Pass configuration settings as keyword arguments directly to the `ManagedServicesClient` constructor (e.g., `client = ManagedServicesClient(credential, subscription_id, enable_logging=True)`).","cause":"In `azure-mgmt-managedservices` version 6.0.0 and above, the `config` attribute was removed from the client object; configuration parameters should be passed as keyword arguments during client initialization.","error":"AttributeError: 'ManagedServicesClient' object has no attribute 'config'"},{"fix":"Ensure the Managed Identity is enabled on your Azure resource. If using a User-Assigned Managed Identity, explicitly specify its `client_id` when creating `DefaultAzureCredential`. For local development, consider using `AzureCliCredential` or setting service principal environment variables.","cause":"The application is attempting to use a Managed Identity for authentication, but it is either not enabled on the Azure resource, incorrectly configured, or the environment variables required for Managed Identity (`IDENTITY_ENDPOINT`, `IDENTITY_HEADER`) are not set in the execution environment.","error":"ManagedIdentityCredential authentication failed"}]}