Comments (13)
@Hazhzeng Does this mean that we no longer need to base the image from mcr.microsoft.com/azure-functions/python:3.0.13901-python3.7
?
from azure-functions-python-library.
Hi @cecilphillip,
-
The azure functions core tools does not have the latest version of azure-functions library yet. If you want to test out this feature, please remove the azure folder in your core tools
(rm -rf azure-functions-core-tools\bin\workers\python\3.8\OSX\X64\azure)
and installazure-functions~=1.2.0
in your Python virtual environment. -
In your code,
return WsgiMiddleware(web_application).main(req, context)
should bereturn WsgiMiddleware(web_application).handle(req, context)
as mentioned here -
Another nit is in your third line,
HttpRequest
should beHttpResponse
.
Thanks for reporting this issue.
from azure-functions-python-library.
@Hazhzeng Thanks! I just assumed that it would use the version of the package that's specified in the requirements.txt
file.
So does the core tools just ignore that package and install other dependencies? I'm just trying to understand how that works.
from azure-functions-python-library.
Yes, so far we ignore the azure-functions library in requirements.txt in local dev and host runtime, and we bound a specific version of azure-functions library in every host release.
from azure-functions-python-library.
@Hazhzeng So how do devs consuming the library know what version of the they can depend on?
from azure-functions-python-library.
@cecilphillip we have a schedule for rolling out new library every 2 weeks.
We have a discussion with Maheer (who was the former developer on Python worker), if we bind the library version with customer's code, the customer needs to redeploy their function app when we release a new version of azure-functions library. These releases are backward compatible and include bug fixes on python worker and azure-functions library.
We made a decision to roll-out these libraries with the host so the customer's app can be run on the latest version automatically without manual intervention. If you have any doubts, feel free to let me know and suggestions are welcomed.
cc: @anirudhgarg
Thanks,
from azure-functions-python-library.
I think most devs would have the expectation that whatever package versions they install should be the versions that ends up in their deployment, but I also understand your reasoning. I have 2 suggestions
- We should document that behavior around
azure-functions
in the official docs. Maybe somewhere in this article - When the function runtime loads up locally, would it be possible to output the version of
azure-functions
that's getting loaded, or maybe have a static list somewhere that shows the mappings between theazure-functions
versions and host runtime versions?
from azure-functions-python-library.
@Hazhzeng is 1.2.0 rolled out to functions-core-tools yet?
from azure-functions-python-library.
@Hazhzeng would you mind re-opening the issue as I cannot see a way it's resolved: for a local installation I can obviously remove the azure folder in the core tools directory. But how would I do that when my function is deployed to Azure?
Exception while executing function: Functions.impl Result: Failure
Exception: AttributeError: module 'azure.functions' has no attribute 'WsgiMiddleware'
Stack: File "/azure-functions-host/workers/python/3.7/LINUX/X64/azure_functions_worker/dispatcher.py", line 242, in _handle__function_load_request
func_request.metadata.entry_point)
File "/azure-functions-host/workers/python/3.7/LINUX/X64/azure_functions_worker/loader.py", line 66, in load_function
mod = importlib.import_module(fullmodname)
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/site/wwwroot/impl/main.py", line 124, in <module>
main = func.WsgiMiddleware(my_skill).main
from azure-functions-python-library.
Oh sorry, I think the merge of the PR automatically closed this issue, I will reopen it again.
from azure-functions-python-library.
I ran into this issue today. Any update on this?
@tvadim did you find any workaround?
I looked into the Dockerfile that was provided for Azure function. It has 1.0.8
installed. I opened an issue about it over there. Azure/azure-functions-docker#281
My current workaround is created a custom Dockerfile that manually remove it and then install the latest one with pip
from azure-functions-python-library.
This one is already deployed on production. Closing the thread.
from azure-functions-python-library.
Yes now this is included in the Consumption plan and in the images we use in the Dedicated/Premium plan and in CoreTools.
from azure-functions-python-library.
Related Issues (20)
- [BUG] Service Bus Session ID is not available to Function code HOT 2
- Python - azure.functions.WsgiMiddleware does not support multiple Set-Cookie response headers HOT 10
- BUG: Cosmos DB Document should not be filtering _ts
- This repo is missing important files
- Inconsistent naming get_json() in EventGridEvent and EventGridOutputEvent
- Support HTTPStatus IntEnum for status code return values. HOT 3
- [BUG] AsgiMiddleware starts an event loop which is never closed HOT 2
- [FeatureRequest] Add timer trigger for Python Programming Model V2
- [FeatureRequest] add to_dict to func.Document for CosmosDB HOT 1
- The load execution start time and program start gap is large - Azure Function APP HOT 1
- UploadFile not working with FastAPI Integration HOT 1
- Can't change default function name while using FastAPI HOT 4
- [FeatureRequest] Add EventGrid source option for blob_trigger HOT 3
- Retry policy removed from version 1.17.0
- Unable to run an Azure Python function in VSCode HOT 1
- WsgiFunctionApp with DispatcherMiddleware and registering new HTTP triggers blueprints HOT 1
- How to receive CloudEvent triggers?
- WsgiMiddleware does not handle Flask Response status code and headers properly HOT 1
- HTTP Request/Response headers should be multidict HOT 2
- Implement read1 method for InputStream
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-functions-python-library.