Microsoft Azure Batch AI Management Client Library

7.0.0 · deprecated · verified Thu Apr 09

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.

Warnings

Install

Imports

Quickstart

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.

import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.batchai import BatchAIManagementClient

# WARNING: The Azure Batch AI service has been retired as of March 31, 2019.
# This SDK package is deprecated and is no longer maintained for new features.
# New subscriptions cannot create Batch AI resources. This code is for illustration only.
# Users should migrate to Azure Machine Learning service (azureml-core).

subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "") # Your Azure Subscription ID
if not subscription_id:
    raise ValueError("AZURE_SUBSCRIPTION_ID environment variable not set.")

# Authenticate with Azure (using recommended DefaultAzureCredential)
credential = DefaultAzureCredential()

# Create a Batch AI Management client
client = BatchAIManagementClient(credential, subscription_id)

print("Azure Batch AI Management Client instantiated.")
print("Note: The Azure Batch AI service has been retired and this SDK is deprecated.")
print("Attempting operations will likely result in service-level errors.")
print("Consider migrating to the Azure Machine Learning service.")

view raw JSON →