Azure Functions Python Sample Codes
Table of Contents
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 |
- Quickstart V2 Python Functions
- 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
[NOTE] V1 Functions sample codes are Python2 compatible by default as default Python platform version that Azure Functions support is Python 2.7.X (as of July 1st, 2017). Some of the samples in the project also support Python 3.X. Please see the table below for supporting Python version of each sample.
print ("Python Version = '{0}'".format(platform.python_version()))
# >>>2017-07-01T05:33:36.202 Python Version = '2.7.8'
For those who want to change the Python runtime version to 3.5/3.6, here is a procedure: How to change the Python version being used in a Function App
Sample | Description | Trigger | In Bindings | Out Bindings |
---|---|---|---|---|
cosmosdb-trigger-cosmosdb-in-binding | Azure Functions CosmosDB Trigger Python Sample. The function simply read & dump documets which are added to or changed in Azure Cosmos DB by leveraging CosmosDB input binding | CosmosDB | CosmosDB | NONE |
blob-trigger-blob-in-out-bindings | Azure Functions Blob Trigger Python Sample that simply read file from Azure Blob Storage and write an output file to Azure Blob Storage using Blob Storage input and output bindings respectively | Blob Storage | Blob Storage | Blob Storage |
queue-trigger-blob-in-bindings | Azure Functions Queue Trigger Python Sample that obtain a blog file name from Queue as a queue message and read a file named the blog file name in Azure Blob Storage using Blob Input Binding | Queue Storage | Blob Storage | NONE |
queue-trigger-rssfeed-crawler | Azure Functions Queue Trigger Python Sample that get RSS feed URL from Queue and dump all items that obtained from RSS feed | Queue Storage | NONE | NONE |
queue-trigger-tagging-images | Azure Functions Queue Trigger Python Sample that tags images stored on Azure Blob Storage by using Cognitive Vision API | Queue Storage | NONE | NONE |
queue-trigger-sendgrid | Azure Functions Queue Trigger Python Sample that send email by using SendGrid bindings | Queue Storage | NONE | SendGrid |
queue-trigger-cosmosdb-in-binding | Azure Functions Queue Trigger that obtains a document ID from Queue as a queue message, select a document object from Cosmos DB by using the document ID, and finally dump the object | Queue Storage | CosmosDB | NONE |
http-trigger-dump-request | Azure Functions HTTP Trigger Python Sample that get and dump HTTPS request info that the trigger receives | HTTP | NONE | HTTP |
blob-sas-token-generator | Azure Function HTTP Trigger Python Sample that returns a SAS token for Azure Storage for the specified container and blob name | HTTP | NONE | HTTP |
timer-trigger-azuresearch-index-monitoring | Azure Functions Timer Trigger Python Sample that get Azure Search index statistics via API and store the results into CosmosDB | Timer | NONE | CosmosDB |
eventhub-trigger-table-out-bindings | Azure Functions EventHub Trigger Python Sample that read message (device info) in EventHub that sent from sender and write an output record to Azure Table Storage using Table bindings | EventHub | NONE | Table Storage |
proxies-simple-condition-matches | Azure Functions Python Sample that re-write dynamic and static page url using Azure Functions Proxies | HTTP | NONE | HTTP |
- V1: How to change the Python version being used in a Function App
- V1: How to install the Python modules
- V1: Local Git Deployment to Azure Functions (Japanese only)
Bug reports and pull requests are welcome on GitHub at https://github.com/yokawasa/azure-functions-python-samples