Sample Python Function that reads a message from an Azure Storage Queue and receives a Blob (JPEG) from Azure Blob Storage using an Azure Function Input Binding which is then thumbnailed using Pillow before the thumbnail image is uploaded back to Blob Storage using an Azure Function Output Binding.
If you're new to Azure Functions and want to understand how you can use Python with them, you should check out the official guide on Azure Functions for Python developers.
This repository is using a GitHub Action to bundle the Azure Function into a Docker Container so it can be run on Kubernetes with KEDA, but if you'd like to just bundle a Function and deploy to Azure without using a Container then you can follow the published guide on Microsoft Docs.
If you'd like to try this out you will need:
- An Azure Subscription (you can get a free trial at https://azure.com/free)
- An Azure Storage Account that has:
- Two Storage Containers
- One Storage Queue
- An Azure Function App (Service Plan or Consumption is fine).
- Make sure to include configuration settings value for the 'customserverless01_STORAGE' connection string.
There is an associated post that has some background on this Function sample that you can find on my blog.