{"id":1356,"library":"azure-mgmt-batchai","title":"Microsoft Azure Batch AI Management Client Library","description":"The `azure-mgmt-batchai` Python client library provides functionality to manage Azure Batch AI resources. However, the Azure Batch AI service itself was retired on March 31, 2019. The `azure-mgmt-batchai` package is deprecated and received only security fixes until October 31, 2024. Users are strongly advised to migrate to the Azure Machine Learning service and its corresponding SDK, `azureml-core`, for at-scale training and machine learning capabilities. This library is not actively maintained for new features or non-security bug fixes.","status":"deprecated","version":"7.0.0","language":"en","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python","tags":["azure","batch-ai","management","deprecated","retirement","machine-learning","cloud"],"install":[{"cmd":"pip install azure-mgmt-batchai","lang":"bash","label":"Install `azure-mgmt-batchai`"},{"cmd":"pip install azure-identity","lang":"bash","label":"Install `azure-identity` (for authentication)"}],"dependencies":[{"reason":"Required for modern Azure SDK authentication, replacing older credential methods in version 7.x.","package":"azure-identity","optional":false},{"reason":"Core utilities for Azure SDK clients, implicitly used by management clients.","package":"azure-core","optional":false}],"imports":[{"symbol":"BatchAIManagementClient","correct":"from azure.mgmt.batchai import BatchAIManagementClient"},{"note":"Old credential systems (e.g., `azure.common.credentials`, `msrestazure.azure_active_directory`) are no longer supported in `azure-mgmt-batchai` version 7.x. Use `azure-identity` for unified authentication.","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.batchai import BatchAIManagementClient\n\n# WARNING: The Azure Batch AI service has been retired as of March 31, 2019.\n# This SDK package is deprecated and is no longer maintained for new features.\n# New subscriptions cannot create Batch AI resources. This code is for illustration only.\n# Users should migrate to Azure Machine Learning service (azureml-core).\n\nsubscription_id = os.environ.get(\"AZURE_SUBSCRIPTION_ID\", \"\") # Your Azure Subscription ID\nif not subscription_id:\n    raise ValueError(\"AZURE_SUBSCRIPTION_ID environment variable not set.\")\n\n# Authenticate with Azure (using recommended DefaultAzureCredential)\ncredential = DefaultAzureCredential()\n\n# Create a Batch AI Management client\nclient = BatchAIManagementClient(credential, subscription_id)\n\nprint(\"Azure Batch AI Management Client instantiated.\")\nprint(\"Note: The Azure Batch AI service has been retired and this SDK is deprecated.\")\nprint(\"Attempting operations will likely result in service-level errors.\")\nprint(\"Consider migrating to the Azure Machine Learning service.\")","lang":"python","description":"This quickstart demonstrates how to instantiate the `BatchAIManagementClient`. Due to the service's retirement and the SDK's deprecation, actual resource management operations will fail. It uses `DefaultAzureCredential` for authentication, which attempts to authenticate through various methods (environment variables, managed identity, etc.). Set the `AZURE_SUBSCRIPTION_ID` environment variable before running."},"warnings":[{"fix":"Migrate your workloads to the Azure Machine Learning service (using the `azureml-core` SDK) or other appropriate Azure compute services.","message":"The underlying Azure Batch AI service has been retired as of March 31, 2019. New subscriptions cannot register for or create Batch AI resources. Existing deployments were subject to a grace period, but the service is no longer supported.","severity":"breaking","affected_versions":"All versions"},{"fix":"Avoid using this package for new development. Migrate existing applications to `azureml-core` for machine learning workloads.","message":"The `azure-mgmt-batchai` package is deprecated and will no longer be maintained for new features or non-security bug fixes after October 31, 2024. Only security fixes were provided until that date.","severity":"deprecated","affected_versions":"7.0.0 and earlier"},{"fix":"Use classes from the `azure-identity` package, such as `DefaultAzureCredential`, for authentication. The `credentials` parameter was also renamed to `credential`.","message":"Version 7.x introduced a complete revamp of the credential system. Old authentication methods (e.g., `azure.common.credentials`, `msrestazure.azure_active_directory`) are no longer supported.","severity":"breaking","affected_versions":"7.0.0 and later (from 7.0.0b1 onwards)"},{"fix":"Refer to the specific version's changelog and documentation for the updated resource hierarchy and method signatures. However, given the service retirement, migration to Azure Machine Learning is the primary recommendation.","message":"Significant API specification changes in versions 2.0.0 and 7.x. For example, `Clusters` and `FileServers` must be created under a `Workspace`, `Jobs` under an `Experiment`. Resources no longer accept `location` or `tags` during creation. Method names like `BatchAIManagementClient.usage` were renamed to `BatchAIManagementClient.usages`.","severity":"breaking","affected_versions":"2.0.0 and later, 7.0.0 and later"},{"fix":"Update calls to LRO methods to use the `begin_` prefix and handle the `azure.core.polling.LROPoller` object.","message":"Long-Running Operations (LROs) in version 7.x now return `azure.core.polling.LROPoller` and are typically prefixed with `begin_` (e.g., `begin_create`). This replaces `msrest.polling.LROPoller` from earlier versions.","severity":"gotcha","affected_versions":"7.0.0 and later (from 7.0.0b1 onwards)"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}