Azure Data Lake Analytics Management Client Library for Python
This is the Microsoft Azure Data Lake Analytics Management Client Library for Python, version 0.6.0. It provides programmatic access to manage Azure Data Lake Analytics accounts, jobs, policies, and catalogs through Azure Resource Manager (ARM). The 0.6.0 version was released in 2018 and was tested with Python 2.7, 3.4, 3.5, and 3.6. While a beta version 1.0.0b2 was released in late 2022, the 0.6.0 stable version represents an older generation of Azure SDKs, likely in maintenance mode, with a less frequent release cadence compared to newer 'Track 2' SDKs.
Warnings
- deprecated The `azure-mgmt-datalake-analytics` library, particularly version 0.6.0, is an older 'Track 1' Azure SDK. While Azure Data Lake Analytics is still a service, newer Python SDKs for Azure services typically follow 'Track 2' guidelines (e.g., `azure-storage-file-datalake` for ADLS Gen2). For new development or managing Data Lake Storage, consider modern alternatives.
- breaking Versions 0.5.0 and 0.6.0 introduced significant breaking changes, primarily due to a 'next-generation code generator'. This affected model signatures, which now primarily use keyword-argument syntax, and Long Running Operation (LRO) return types.
- gotcha Older Azure Python SDKs (prior to 1.0) and some samples used `msrestazure.azure_active_directory.AADTokenCredentials` or `adal` for authentication. The recommended and more robust approach for modern Azure SDKs is `azure.identity.DefaultAzureCredential`.
- gotcha The 0.6.0 version officially supports Python 2.7, 3.4, 3.5, and 3.6. Using it with newer Python versions (e.g., Python 3.7+) may lead to unexpected behavior or compatibility issues, although a beta 1.0.0b2 exists for Python 3.7+.
Install
-
pip install azure-mgmt-datalake-analytics -
pip install azure-mgmt-datalake-analytics==1.0.0b2
Imports
- DataLakeAnalyticsAccountManagementClient
from azure.mgmt.datalake.analytics import DataLakeAnalyticsAccountManagementClient
- DefaultAzureCredential
from azure.identity import DefaultAzureCredential
Quickstart
import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.datalake.analytics.account import DataLakeAnalyticsAccountManagementClient
# Set environment variables for authentication (e.g., AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_SUBSCRIPTION_ID)
# For a quick start, ensure these are set or use Managed Identity in Azure environments.
# Example: export AZURE_TENANT_ID="<your-tenant-id>"
# export AZURE_CLIENT_ID="<your-client-id>"
# export AZURE_CLIENT_SECRET="<your-client-secret>"
# export AZURE_SUBSCRIPTION_ID="<your-subscription-id>"
subscription_id = os.environ.get('AZURE_SUBSCRIPTION_ID', 'YOUR_SUBSCRIPTION_ID')
# Authenticate using DefaultAzureCredential (recommended for modern Azure SDK usage)
# This credential chain tries various methods including environment variables, managed identity, etc.
credential = DefaultAzureCredential()
# Create the Data Lake Analytics Management Client
client = DataLakeAnalyticsAccountManagementClient(credential, subscription_id)
# Example: List Data Lake Analytics accounts in a subscription
print("Listing Data Lake Analytics accounts:")
for account in client.account.list():
print(f" - {account.name} (Location: {account.location})")
print("Quickstart finished successfully (if no errors occurred and accounts were listed).")