The following code snippets are on creating a connection to Azure Blob Storage using Python with account access key.
For more details on Azure Blob Storage and generating the access key, visit :
https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-python
# Import the required modules
from azure.storage.blob import BlockBlobService
# Create the BlockBlobService object, which points to the Blob service in your storage account
block_blob_service = BlockBlobService(account_name = 'Storage-Account-Name',
account_key = 'Storage-Account-Key')
'''
Please visit here to check the list of operations can be performed on the blob service object :
(https://azure-storage.readthedocs.io/)
'''
The following code snippets are on creating a connection to Azure Data Lake Storage Gen1 using Python with Service-to-Service authentication with client secret and client id.
Follow the link, for more details on different ways to connect to Azure Data Lake Storage Gen1.
# Import the required modules
from azure.datalake.store import core, lib
# Define the parameters needed to authenticate using client secret
token = lib.auth(tenant_id = 'TENANT',
client_secret = 'SECRET',
client_id = 'ID')
# Create a filesystem client object for the Azure Data Lake Store name (ADLS)
adl = core.AzureDLFileSystem(token, store_name='ADLS Account Name')
'''
Please visit here to check the list of operations ADLS filesystem client can perform -
(https://azure-datalake-store.readthedocs.io/en/latest/api.html#azure.datalake.store.core.AzureDLFileSystem)
'''