azure-storage

How to copy entire structure between storage accounts in python

How to copy entire structure between storage accounts in python Question: my case is the following: Two Azure Storage Accounts (Source/Destination) Source Account may contain multiple containers, folders, blobs, etc. All of the above needs to be copied exactly in the same structure to the DESTINATION account. If any elements already exist in the Destination …

Total answers: 1

How to lock storage accounts in Azure using Python SDK

How to lock storage accounts in Azure using Python SDK Question: I am using python SDK to lock a particular azure resource. Although I found documentation, I am getting exceptions as a resource not found while I am trying to lock the storage account. As I am trying to store accounts in a Resource Grp, …

Total answers: 2

How to download entire directory from azure file share

How to download entire directory from azure file share Question: Not able to download entire directory from azure file share in python I have used all basic stuffs available in google share = ShareClient.from_connection_string(connection_string, "filshare") my_file = share.get_file_client("dir1/sub_idr1") # print(dir(my_file)) stream_1 = my_file.download_file() Asked By: Shreedhar Hegde || Source Answers: I tried in my environment …

Total answers: 1

Error while trying to write in Azure Tables ('' is not a valid value for a partition key or row key)

Error while trying to write in Azure Tables ('' is not a valid value for a partition key or row key) Question: I am a beginner in Azure. I’m trying to add a row in Azure Tables storage using Python. I followed the simple example of Microsoft documentation : https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-table-output?tabs=in-process%2Cstorage-extension&pivots=programming-language-python#example However, I get this error …

Total answers: 1

Load file from Azure Files to Azure Databricks

Load file from Azure Files to Azure Databricks Question: Looking for a way using Azure files SDK to upload files to my azure databricks blob storage I tried many things using function from this page But nothing worked. I don’t understand why example: file_service = FileService(account_name=’MYSECRETNAME’, account_key=’mySECRETkey’) generator = file_service.list_directories_and_files(‘MYSECRETNAME/test’) #listing file in folder /test, …

Total answers: 2

AzureBlob Upload ERROR:The specified blob already exists

AzureBlob Upload ERROR:The specified blob already exists Question: I am trying to upload file to Azure container daily. I got an Error:”The specified blob already exists” when uploading file with same file( I want to overwrite the file) from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient conn_str = yml[‘AZURE_BLOB’][‘CONN_STR’] container_name = yml[‘AZURE_BLOB’][‘CONTAINER_NAME’] # Create the BlobServiceClient that …

Total answers: 2

How to list all blobs inside of a specific subdirectory in Azure Cloud Storage using Python?

How to list all blobs inside of a specific subdirectory in Azure Cloud Storage using Python? Question: I worked through the example code from the Azure docs https://learn.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-python from azure.storage.blob import BlockBlobService account_name = “x” account_key = “x” top_level_container_name = “top_container” blob_service = BlockBlobService(account_name, account_key) print(“nList blobs in the container”) generator = blob_service.list_blobs(top_level_container_name) for blob …

Total answers: 5

Write Python DataFrame as CSV into Azure Blob

Write Python DataFrame as CSV into Azure Blob Question: I have got two questions on reading and writing Python objects from/to Azure blob storage. Can someone tell me how to write Python dataframe as csv file directly into Azure Blob without storing it locally? I tried using the functions create_blob_from_text and create_blob_from_stream but none of …

Total answers: 4