Azure Functions Python Sample Codes
Table of Contents
This is a collection of Python function samples on Azure Functions 2.X. For a comprehensive development and debugging experience, use the Azure Functions Core Tools or VS Code extension.
| Sample | Description | Trigger | In Bindings | Out Bindings |
|---|---|---|---|---|
| cosmosdb-trigger-cosmosdb-in-binding | Azure Functions Blob Storage Trigger Python Sample. The function gets image data from Azure Blob Trigger, gets tags for the image with Computer Vision API (Azure Cognitive Services), and store the tags into Azure Cosmos DB by leveraging Cosmos DB output binding | Blob Storage | NONE | CosmosDB |
| cosmos-trigger-cosmodb-output-binding | Azure Functions Cosmos DB Trigger Python Sample. The function gets document data from Azure Cosmos DB Trigger, ROT13 encodes obtained clear text, and store encoded data into Azure Cosmos DB by using Cosmos DB output binding | CosmosDB | NONE | CosmosDB |
| queue-trigger-blob-in-out-binding | Azure Functions Queue Trigger Python Sample. The function gets a file name from queue message, reads a blob file named the file name using Blob Input Binding, then ROT13 encodes the obtained clear text, and finally stores it into Azure Blob Storage using Blob Output Binding | Queue Storage | Blob Storage | Blob Storage |
| timer-trigger-cosmos-output-binding | Azure Functions Timer Trigger Python Sample. The function gets blog RSS feed and store the results into CosmosDB using Cosmos DB output binding | Timer | NONE | CosmosDB |
| http-trigger-blob-sas-token | Azure Function HTTP Trigger Python Sample that returns a SAS token for Azure Storage for the specified container and blob name | HTTP | NONE | HTTP |
| http-trigger-dump-request | Azure Function HTTP Trigger Python Sample that returns request dump info with JSON format | HTTP | NONE | HTTP |
| blob-trigger-watermark-blob-out-binding | Azure Function Python Sample that watermarks an image. This function triggers on an input blob (image) and adds a watermark by calling into the Pillow library. The resulting composite image is then written back to blob storage using a blob output binding. | Blob Storage | Blob Storage | Blob Storage |
| sbqueue-trigger-sbqueue-out-binding | Azure Functions Service Bus Queue Trigger Python Sample. The function demonstrates reading from a Service Bus queue and placing a message into an output Service Bus queue. | Service Bus Queue | None | Service Bus Queue |
- Quickstart V2 Python Functions with Azure Functions Core Tools
- Quickstart Function Samples as a Custom image with Docker
- Azure Functions Python developer guide
- Zip push deployment for Azure Functions
- Work with Azure Functions Proxies
- Create a function triggered by Azure Blob storage
- Create a function triggered by Azure Cosmos DB
IMPORTANT
- By default, function apps created in the Azure portal are set to version 2.x. When possible, you should use this runtime version, where new feature investments are being made. Please see this for more detail on Azure Function runtime versions and supported languages.
- Please consider to use 2.X Python funciton as Python function in Azure function 1.X is experimental and new feature investments won't be added to 1.X Python function.
Bug reports and pull requests are welcome on GitHub at https://github.com/yokawasa/azure-functions-python-samples

