Azure Functions: V2 Python Programming Model is Generally Available
The Azure Functions team is thrilled to share that the v2 programming model for Python is now Generally Available!
The v2 programming model enables customers to easily create Functions applications – leaning towards fewer Functions concepts and instead emphasizing Python principles. Key improvements include triggers and bindings declared as decorators, a simplified folder structure, and easy to reference documentation.
Note that leveraging the v2 model will alter how you create functions, but the underlying experience regarding monitoring, debugging, and deployment will remain the same.
We are so grateful for the community support of the new model and the feedback we have gotten since we brought the experience to Preview last fall. We've iterated on usability and increased out-of-the-box support for numerous triggers and bindings. Furthermore, running existing Flask and Fast API apps on Azure Functions, and leveraging generic triggers and bindings are now easier than ever, enabling customers to integrate with first and third-party extensions seamlessly.
Comparing v1 & v2
Following is an example of a Function Application with an HTTP trigger using both the v1 and the v2 programming models:
| File Name | v1 | v2 |
| init.py | ||
| function.json | ||
| function_app.py |
Note that using the v1 programming model, there would be an 'init.py' and 'function.json' file for each function within the function application. When using the v2 programming model, all functions can be defined within the 'function_app.py' file. This significantly decreases the number of files and simplifies the folder structure, making it easier to manage applications. Additionally, the v2 programming model includes support for blueprints, such that multiple Python files can contain functions.
Supported Triggers and Bindings
Following are the triggers and bindings supported with decorators today:
| Type | Trigger | Input Binding | Output Binding |
| HTTP | x | ||
| Timer | x | ||
| Azure Queue Storage | x | x | |
| Azure Service Bus topic | x | x | |
| Azure Service Bus queue | x | x | |
| Azure Cosmos DB | x | x | x |
| Azure Blob Storage | x | x | x |
| Azure Hub | x | x |
If you want to use an extension for which there isn't a decorator available, you can use the generic triggers and bindings. For example, you can use generic decorators for the new Azure Data Explorer extension!
Integrating Web Applications that use ASGI & WSGI Frameworks
Have an existing web application using Flask or Fast API? Running it on Functions is easier than ever - check out the following examples!
ASGI
WSGI
Finally, modify the host.json file to include the code:
As you can see, just by adding a few lines of code, you can get your existing web applications running on Functions. Learn more here and try it out today!
Troubleshooting & What's Next
We are continuing to iterate and improve the v2 programming model experience for our customers. At the time of release, there are still deployments in progress until all features are available. Learn about current caveats and upcoming features here.
Thank you to our community for the support and feedback on this programming model. Please continue to let us know what you think, and report any issues you face. Happy coding!
Published on:
Learn moreRelated posts
From Real-Time Analytics to AI: Your Azure Cosmos DB & DocumentDB Agenda for Microsoft Ignite 2025
Microsoft Ignite 2025 is your opportunity to explore how Azure Cosmos DB, Cosmos DB in Microsoft Fabric, and DocumentDB power the next generat...
Episode 414 – When the Cloud Falls: Understanding the AWS and Azure Outages of October 2025
Welcome to Episode 414 of the Microsoft Cloud IT Pro Podcast.This episode covers the major cloud service disruptions that impacted both AWS an...
Now Available: Sort Geospatial Query Results by ST_Distance in Azure Cosmos DB
Azure Cosmos DB’s geospatial capabilities just got even better! We’re excited to announce that you can now sort query results by distanc...
Query Advisor for Azure Cosmos DB: Actionable insights to improve performance and cost
Azure Cosmos DB for NoSQL now features Query Advisor, designed to help you write faster and more efficient queries. Whether you’re optimizing ...
Azure Developer CLI: Azure Container Apps Dev-to-Prod Deployment with Layered Infrastructure
This post walks through how to implement “build once, deploy everywhere” patterns using Azure Container Apps with the new azd publ...
Accelerate Your Growth: Azure Cosmos DB Partner Acceleration Program
Accelerate Your Growth: Azure Cosmos DB Partner Acceleration Program Unlock 360° Success with the Cosmos DB Engineering Team Are you ready to ...
Transforming Field Operations with AI, Azure Maps & Dynamics 365
Efficient field operations are the backbone of successful, data-driven organizations. Yet, many businesses continue to struggle with scattered...