Azure Data Lake Store Management
This library provides management capabilities for Azure Data Lake Store Gen1 accounts. It is an older 'Track 1' SDK. The latest version is 0.5.0, released in 2017, and the library is no longer actively maintained. The underlying Azure Data Lake Store Gen1 service was retired on February 29, 2024.
Warnings
- breaking The Azure Data Lake Store Gen1 service, which this library manages, was officially retired on February 29, 2024. Operations against the service will fail. This is the most critical issue.
- deprecated This Python library is an older 'Track 1' SDK for Azure and is no longer actively maintained. Its last release was in 2017. It is superseded by newer, modular 'Track 2' Azure SDKs.
- gotcha Due to its age, this library might have compatibility issues with very recent Python versions or depend on older versions of common Azure dependencies. While `DefaultAzureCredential` from `azure.identity` can often work, it's a modern (Track 2) credential type used with an old (Track 1) client, which can sometimes lead to unexpected behavior.
Install
-
pip install azure-mgmt-datalake-store
Imports
- DataLakeStoreAccountManagementClient
from azure.mgmt.datalake.store import DataLakeStoreAccountManagementClient
Quickstart
import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.datalake.store import DataLakeStoreAccountManagementClient
# NOTE: Azure Data Lake Store Gen1 service was retired on February 29, 2024.
# This code will likely fail unless you are interacting with a pre-existing,
# legacy resource which might still be minimally accessible.
# For new development, consider Azure Data Lake Storage Gen2 with azure-mgmt-storage or azure-storage-blob.
# Your Azure subscription ID
subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "YOUR_SUBSCRIPTION_ID")
if not subscription_id or subscription_id == "YOUR_SUBSCRIPTION_ID":
raise ValueError("Please set the AZURE_SUBSCRIPTION_ID environment variable.")
# Authenticate with Azure. DefaultAzureCredential attempts various methods (e.g., Azure CLI, environment variables).
# While DefaultAzureCredential is a modern 'Track 2' credential, it can often work with 'Track 1' management clients.
credential = DefaultAzureCredential()
# Create the Data Lake Store management client
client = DataLakeStoreAccountManagementClient(credential, subscription_id)
print("Attempting to list Data Lake Store accounts (Note: Service retired 2024-02-29):")
try:
# List Data Lake Store accounts in the subscription
accounts = client.account.list()
found_accounts = False
for account in accounts:
print(f" Account Name: {account.name}, Location: {account.location}, Provisioning State: {account.provisioning_state}")
found_accounts = True
if not found_accounts:
print(" No Data Lake Store accounts found in this subscription.")
except Exception as e:
print(f"An error occurred while listing accounts: {e}")
print("This is expected behavior as the Azure Data Lake Store Gen1 service is retired.")
print("You may receive errors such as 'ResourceNotFound' or 'BadRequest'.")
print("\nRecommendation: Migrate to Azure Data Lake Storage Gen2 using the azure-mgmt-storage or azure-storage-blob libraries.")