-
Couldn't load subscription status.
- Fork 107
Supporting PyStein programming model in the Worker #965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@gavin-aguiar i see merge conflict, lint check failed |
d1f4a7a to
7712112
Compare
7908b08 to
aafd082
Compare
5dc2fe4 to
bca60c9
Compare
bb4964b to
1563d7e
Compare
azure_functions_worker/dispatcher.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The entire function is in a try catch in the caller function. All errors will be logged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Getting Started
Currently, the Python programming model is in the alpha release.
To try out the new programming model, download PyStein Custom Core Tools. Note that downloading the file will not overwrite the existing core tools in your device.
Installation & Setup
local.settings.json, the flag forAzureWebJobsFeatureFlagsis set toEnableWorkerIndexing.funcfrom the unzipped path directly<path_to_core_tools>/func host startlocal.settings.json.E.g. For Windows:
func host start.C:\Users\test_user\Downloads\CoreTools-PyStein-win\CoreTools-New-Prg-Model\funcSet-Aliasin Powershell) the func to this folder. Note that this will impact your existing core tools if you don't reset it when you are done testing.Set-Alias -Name func -Value C:\Users\test_user\Downloads\CoreTools-PyStein-win\CoreTools-New-Prg-Model\funcNotes & Limitations
View http-only-example, examples-non-http for the new programming model.
Specification
Reference specification of the decorator is available at ProgModelSpec.pyi at Azure library repo.
Our Goals
The current Python programming model in Azure Functions has limitations that sometimes prevents a customer from having a smooth onboarding experience. This includes the facts that there are too many files present, that the Function App structure can be confusing, and that file configuration follows Azure specific concepts rather than what Python frameworks.
To overcome these challenges, the Azure Functions Python team ideated a new programming model which eases the learning experience for new and existing customers. Specifically, the new programming model involves a single .py file (
function_app.py) and will no longer require thefunction.jsonfile. Furthermore, the triggers and bindings usage will be decorators, simulating an experience similar to Flask.Triggers & Bindings
At this time, the new Programming model supports HTTP, Timer, Event Hub, Queue, Service Bus, and Cosmos DB. The following are examples of the implementation with the new programming model.
HTTP
Event Hub
Queue
Service Bus
Cosmos DB
Storage Blobs
What's Next
View http-only-example, examples-non-http for the new programming model.
Let us know your feedback in the GitHub discussion.
Upcoming Features
Fixes #
PR information
Quality of Code and Contribution Guidelines