or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/azure-storage-file-datalake@12.21.x
tile.json

tessl/pypi-azure-storage-file-datalake

tessl install tessl/pypi-azure-storage-file-datalake@12.21.0

Microsoft Azure File DataLake Storage Client Library for Python

Agent Success

Agent success rate when using this tile

92%

Improvement

Agent success rate improvement when using this tile compared to baseline

0.99x

Baseline

Agent success rate without this tile

93%

task.mdevals/scenario-2/

Azure DataLake Storage Authentication Manager

Build a Python module that demonstrates secure authentication to Azure Data Lake Storage Gen2 using multiple authentication methods.

Requirements

Your module should provide functionality to:

  1. Connection String Authentication: Accept a connection string and create a service client
  2. Shared Key Authentication: Accept an account name and account key to create a service client
  3. SAS Token Authentication: Accept account information and a SAS token to create a service client
  4. SAS Token Generation: Generate SAS tokens at both account-level and file system-level with time-bound access and specific permissions

The module should handle authentication configuration and token generation in a straightforward manner.

Implementation Details

Create a file auth_manager.py that exports the following functions:

  • create_client_from_connection_string(connection_string: str) - Returns a service client authenticated with connection string
  • create_client_from_shared_key(account_name: str, account_key: str) - Returns a service client authenticated with account name and key
  • create_client_from_sas(account_url: str, sas_token: str) - Returns a service client authenticated with a SAS token
  • generate_account_sas(account_name: str, account_key: str, expiry_hours: int, permissions: str) - Generates an account-level SAS token string
  • generate_file_system_sas(account_name: str, account_key: str, file_system_name: str, expiry_hours: int, permissions: str) - Generates a file system-level SAS token string

@generates

Test Cases

  • Creating a service client from a connection string returns a valid DataLakeServiceClient instance @test
  • Creating a service client from account name and key returns a valid DataLakeServiceClient instance @test
  • Creating a service client from a SAS token returns a valid DataLakeServiceClient instance @test
  • Generating an account SAS token with read and list permissions produces a valid token string @test
  • Generating a file system SAS token with read and write permissions produces a valid token string @test

Dependencies { .dependencies }

azure-storage-file-datalake { .dependency }

Provides Azure Data Lake Storage Gen2 client library for Python with comprehensive authentication support.

Notes

  • SAS tokens should be generated with appropriate expiry times (use hours from now)
  • Account URL format should be: https://{account_name}.dfs.core.windows.net
  • Handle permissions as strings representing permission sets (e.g., "rl" for read+list, "rw" for read+write)
  • Ensure all authentication methods return properly configured client instances