azure-blob-storage

How to add a CSV file to a Blob service using Durable Functions

How to add a CSV file to a Blob service using Durable Functions Question: In Azure Durable Functions, I would like to write additionally to the CSV in the Blob service. What I would like to do Select a CSV file to be written by the Blob service. Create a data frame Add a data …

Total answers: 1

How to rename an already existing blob in azure storage explorer using python

How to rename an already existing blob in azure storage explorer using python Question: I want to rename a blob file in Azure storage explorer. It’s in a folder of a specific blob container.I’m using python. I used this code. sourceFileName = abc.xlsx destinationFileName = xyz.xlsx sourcePath = ‘cloudops-resources/outputs/’ destinationPath = ‘cloudops-resources/outputs/’ blob_url = blob_service.make_blob_url(sourcePath,sourceFileName) …

Total answers: 1

ConditionNotMet error while trying to download azure blob using python

ConditionNotMet error while trying to download azure blob using python Question: I was trying to download azure blob from python using the azure.storage.blob BlobServiceClient. There are various blobs inside the containers which are big in size, the error happens when the code is trying to download files around 100mb or higher. The code works fine …

Total answers: 1

Save API JSON Response directly to Azure Blob Storage json file

Save API JSON Response directly to Azure Blob Storage json file Question: I am calling to a 3rd party API directly in an Azure HTTP Function. I would like to save the json response to a file inside Azure Blob Storage container. The below code I built (based on microsoft documentation) hangs when I try …

Total answers: 1

Python dataframe filter on a specific column

Python dataframe filter on a specific column Question: I am reading 3 blobs from Azure storage , loading them into a dataframe and later filtering the dataframe. Below is the code. blob_service_client = BlobServiceClient.from_connection_string(connect_str) container_name = "" path = "/" dt = ” pth = os.path.join(path, dt) container_client = blob_service_client.get_container_client(container_name) blob_list = container_client.list_blobs(name_starts_with=pth) for blob …

Total answers: 1

Write zip to Blob storage Azure

Write zip to Blob storage Azure Question: I’m trying to zip files present in container ‘input’ and move them to container ‘output’. I’m using python SDK # connection to blob storage via Azure Python SDK connection_string = "myConnectionString" blob_service_client = BlobServiceClient.from_connection_string(connection_string) # get container client input_container = blob_service_client.get_container_client(container="input") # filename filename = "document_to_zip.pdf" # init …

Total answers: 2

Include only blob 'name' property in list_blobs() response? – Azure Python SDK

Include only blob 'name' property in list_blobs() response? – Azure Python SDK Question: Currently, I am using the list_blobs() function in the Azure Python SDK to list all of the blobs within a container. However, in terms of the metadata/info of the blobs, I only require the names of the blobs. In my container, there …

Total answers: 2

Deleting files from blob – TypeError: quote_from_bytes() expected bytes

Deleting files from blob – TypeError: quote_from_bytes() expected bytes Question: I have some files inside a container named data: folder1/somepath/folder2/output/folder3/my_file1.csv folder1/somepath/folder2/output/folder3/my_file4.csv folder1/somepath/folder2/output/folder3/my_file23.csv I have the following code: file_names_prefix = os.path.join(‘folder1/somepath/’,’folder2′,’output’,’folder3′,’my_file’) client = BlobServiceClient(‘https://mystoragename.blob.core.windows.net’,credential=ManagedIdentityCredential()).get_container_client(‘data’) blob_list = client.list_blobs(name_starts_with=file_names_prefix) file_list = [blob.name for blob in blob_list] The code above produces the following output: [‘folder1/somepath/folder2/output/folder3/my_file1.csv’, ‘folder1/somepath/folder2/output/folder3/my_file4.csv’, ‘folder1/somepath/folder2/output/folder3/my_file23.csv’] but when …

Total answers: 3

Avoid base64 encoding on my data sent to Event Hub via Python SDK

Avoid base64 encoding on my data sent to Event Hub via Python SDK Question: I am sending a json object(in python) to Azure Event Hub which is routed to Blob Storage via Event Capture feature of Event Hub. This file gets stored in Apache AVRO. When I upload the file on online AVRO reader I …

Total answers: 1

save excel file stream to azure blob storage

save excel file stream to azure blob storage Question: I programmed a few lines of code in Python which opens an Excel file from a Azure Blob Storage with the openpyxl-library. The code is running in Azure Functions. After a few modifications on the content, I will create a second workbook and copy the content …

Total answers: 2