yokawasa / azure-functions-python-samples

Azure Functions Python Sample Codes. NOTE: The project, hosted in a repository, is no longer actively maintained by its creators or contributors. There won't be any further updates, bug fixes, or support from the original developers in the project.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extract a compressed file within azure blob

suntracks opened this issue · comments

Would be great if there is a function to extract compressed files within azure blob.
Could not find any ready or work around solution to do this.

What is the best way it can acheived as of today.

@suntracks
I've added a sample BlobTrigger function which does:

  • Open Zipped file (that has ".zip" extension)
  • Read files packed in the zipped file
  • Print the clear text in the files packed in Zipped file

https://github.com/yokawasa/azure-functions-python-samples/tree/master/blob-trigger-blob-in-out-bindings/function_zip

Hope it would help

@suntracks Can you explain a bit more about your scenario?

When it comes to blob file path or blob file name, in python code, you can NOT get the blob name in the Blob Trigger function. Instead, you need to use another mechanism to trigger the blob processing, such as a queue message that contains the blob name.

Updated:
Here is a sample where you can get the blob file name using queue trigger -
queue-trigger-blob-in-bindings

@suntracks
I'm closing the issue. Please reopen if you have further question.

Hi Yokawasa, thank you for sharing this code. I'm curious, do you need have another blob trigger function (probably not written in Python) which inserts a message into the queue which then your python trigger can consume and obtain the blob file name from the queue?