Azure Data Lake Store Management

0.5.0 · deprecated · verified Thu Apr 09

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

Install

Imports

Quickstart

This quickstart demonstrates how to initialize the `DataLakeStoreAccountManagementClient` and attempt to list Data Lake Store accounts within your Azure subscription. Due to the retirement of the underlying service, this code is primarily for understanding legacy interactions and will likely result in errors.

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.")

view raw JSON →