Registry /
azure / azure-mgmt-datalake-analytics
Install & Compatibility
Where this runs
tested against v1.0.0b2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 1.076s · 47.2MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 3.6s · import 0.974s · 48MB
46MB installed
● package 46MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
DataLakeAnalyticsAccountManagementClient
✓ from azure.mgmt.datalake.analytics import DataLakeAnalyticsAccountManagementClient
DefaultAzureCredential
✓ from azure.identity import DefaultAzureCredential
✗ from msrestazure.azure_active_directory import AADTokenCredentials
DefaultAzureCredential is the recommended modern way for authentication. AADTokenCredentials was used in older SDKs and samples for specific scenarios like device code flow.
This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential` and then list existing Azure Data Lake Analytics accounts. Ensure your Azure credentials (e.g., Tenant ID, Client ID, Client Secret, Subscription ID) are configured as environment variables or other methods supported by `DefaultAzureCredential`.
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).")
Debug
Known issues
deprecatedThe `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.fixEvaluate if Azure Data Lake Analytics is the appropriate service for your needs. For managing Data Lake Storage Gen2, consider `azure-storage-file-datalake` (Track 2 SDK). For general Azure resource management, use the corresponding Track 2 SDKs for other services.
affects: <=0.6.0 (and 1.0.0b2 is beta)
breakingVersions 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.fixReview release notes for 0.5.0 and 0.6.0. Update code to use keyword arguments for model instantiation and client methods. Adjust LRO polling logic if migrating from versions older than 0.5.0.
affects: 0.5.0, 0.6.0
gotchaOlder 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`.fixUse `DefaultAzureCredential` from `azure-identity` for authentication. This simplifies credential management by attempting various authentication flows (environment variables, managed identity, etc.). Ensure `azure-identity` is installed: `pip install azure-identity`.
affects: <=0.6.0
gotchaThe 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+.fixFor Python 3.7+, consider trying the `1.0.0b2` beta version, or ideally, explore modern Azure SDKs for relevant Data Lake services. If you must use 0.6.0, ensure your environment uses a supported Python version.
affects: 0.6.0
Errors
Common errors & fixes
AttributeError: 'DefaultAzureCredential' object has no attribute 'signed_session'
The `azure-mgmt-datalake-analytics` library (version 0.6.0) is an older Azure SDK 'Track 1' library that is incompatible with the newer 'Track 2' `azure-identity` library's `DefaultAzureCredential` method of authentication, as it expects an older credential object structure.
fixUse an older authentication method compatible with 'Track 1' SDKs, such as `msrestazure.azure_active_directory.AADTokenCredentials` or `msrest.authentication.BasicTokenAuthentication`, or upgrade to a newer version of the Azure Data Lake Analytics management library if available and compatible with `azure-identity` (though a direct 'Track 2' replacement might be `Azure.ResourceManager.DataLakeAnalytics`).
CloudError: Azure Error: InvalidArgument Message: Job type 'USql' is not supported by api-version 'YYYY-MM-DD-preview'
The API version being used by the `azure-mgmt-datalake-analytics` SDK (often implicitly tied to the SDK version) does not support the specified job type (e.g., 'USql') or an older API version is being called for a feature that requires a newer one.
fixEnsure that the `azure-mgmt-datalake-analytics` package is updated to the latest compatible version or explicitly specify an API version that supports the 'USql' job type when creating the job. Check the Azure Data Lake Analytics documentation for supported API versions and job types.
The credentials provided cannot be used for the DataLake source.
This error indicates a problem with the authentication credentials used to access the Azure Data Lake Store. It can be due to incorrect or expired tokens, insufficient permissions for the service principal or managed identity, or resource providers not being registered.
fixVerify that the service principal or managed identity has the necessary permissions (e.g., Contributor, Data Lake Storage Contributor roles) on the Data Lake Analytics account and the associated Data Lake Store. Ensure that the required resource providers (`Microsoft.DataLakeStore`, `Microsoft.DataLakeAnalytics`) are registered in your Azure Active Directory tenant. Refresh or re-obtain authentication tokens if they might be expired or invalid.
The provided location is not available for resource type 'Microsoft.DataLakeStore/accounts'. Please try on other locations.
Azure Data Lake Storage Gen1 accounts (which `azure-mgmt-datalake-analytics` integrates with) have limitations on where they can be created, and account creation for new customers was blocked in certain regions after July 5, 2021.
fixIf creating a new Data Lake Store Gen1 account, try a different Azure region. For new deployments, it is highly recommended to migrate to Azure Data Lake Storage Gen2 and use newer SDKs that support it, as Gen1 is in maintenance mode and creation for new customers is restricted.
ResourceNotFound
The specified Azure Data Lake Analytics resource (e.g., account, job, catalog item) could not be found, likely due to a typo in the resource name, an incorrect resource group or subscription context, or the resource having been deleted.
fixDouble-check the resource name, resource group name, and subscription ID for any typos. Ensure the resource actually exists in the specified location and that the authenticated principal has permissions to view it. Use `az account show` and `az resource list` (Azure CLI) or similar SDK calls to verify the context and resource existence.
Upgrade
Version history
0.6.0latest on PyPI · released Jun 26, 2018
Audit
Dependencies
azure-commonrequiredCommon Azure SDK dependency.
msrestrequiredCore REST client library for Azure SDKs.
msrestazurerequiredAzure-specific extensions for msrest, including authentication helpers.
azure-identityrequiredRecommended modern authentication library for Azure SDKs (for use with DefaultAzureCredential).