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
Azure function python v2 with external packages HTTP Trigger not visible in Azure Portal after deployment #1262
Comments
Did this problem start recently? I had a v2 programming function app deployed that was working fine, however last night i made some changes and I can no longer see the functions. I've tried everything and attempting to revert to the old code but I can't seem to see what is different. Maybe Azure have made some changes that have impacted us? |
@VirajVaitha123 thanks for informing and can you share the function name,region,invocationid etc. |
I'm the author of the SO question and wanted to add that I found this issue only applies when deploying to a consumption plan. When I deploy to a dedicated app service plan, the functions load. |
Sure function name : scryptifyf1 |
@VirajVaitha123 Thanks for input I will update once check |
Thanks for looking into this. Do we know if this problem is one multiple people are facing, and there is nothing we can do to deploy with Python v2 programming model? |
@VirajVaitha123 pls share the start time and end time |
I have been experiencing the exact same issue for over a week - I have tried the different deployment methods, as well as deleting and recreating the Function App and App Service Plan. |
Only workaround I know is to switch to the V1 programming model. |
@gavin-aguiar pls comment |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
I'm experiencing a similar issue but with two differences:
One additional thing I've noticed when I've probed around in my portal is that Genie is reporting the following error:
That is followed by this error:
The key thing that strikes me as odd here is that it's failing to import the package from /home/site/wwwroot/.python_pacakages/... Looking in my storage account, the reason it's failing is obvious - there's no .python_packages file in wwwroot. After liaising with the OP of this github issue on my own SO post, we're using identical Azure Pipeline YAML definitions. The key thing is we're both running from zip packages, rather than deploying the code directly so I wouldn't expect there to be anything in wwwroot. Since my function_app.py file imports a load of custom packages (which in turn import PIL), and does so before declaring the function, my thinking is that the imports are erroring about because Python should be looking for them in the package but is actually looking for them in the site root (working directory). Since they aren't there, it errors out so never makes it as far as far as the function app declaration. Just a guess but given the errors it would make sense. What to do about that, however, I don't know! For now it looks like the two workarounds are:
I followed the first of these options and this resolved my issue. |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
I'm facing the same challenge over here using python. The Function HTTP triggers are not visible in Functions section of Function tab but files are visible in App files. |
@bhagyshricompany Can you take a look at this issue? I see multiple customers facing this issue? |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
This is still an issue, I am seeing it happen on occasion. As of yet cannot figure out a pattern for why it happens or how to fix it. |
@bhagyshricompany Can you check this issue? Looks like its a bug, Multiple customers are reporting it? |
I'm not sure if MS is looking at this issue, which is kind of sad. |
All I have in my requirements.txt is azure-functions, and still getting it. |
@charlesjankowski - Can you share your app name for us to investigate? |
@vrdmr I just added you to a repo showing the use case, let me know what else you'd need, thanks! |
Still having similar issue, the deployment works fine from vscode but when I use Github Actions to deploy The functions disappear from azure portal even though the deployment doesn't through any error |
please follow this issue here, #1338 |
I ran into a similar issue today. I added a new http-triggered function to my azure function app and named the argument |
I have the same problem, locally the HTTP trigger appears, but after deploying it, it does not generate any error, it simply says 'No HTTP triggers found'. My doubt is whether the problem is in part of the libraries I'm using, which is langchain and huggingface for embedding, since I've already tried using the sentence transformer. I've already tried almost all the possible solutions on stack and other pages here |
Same problem here. Linux, python, consumption plan using the v2 function model, zip deployment. I cannot find any code errors. Functions found 1, loaded: 0. It started happening out of nowhere after a small code change, but a quick reversion and re-deploy did not fix this. Based on a couple days of investigation it appears that the dependencies are failing to build silently during the deployment process. I haven't caught this because I'm on the Linux consumption plan and I don't have much of a window into what goes on during zip deployment. I've found that building the dependencies locally in a Docker container during pre-deployment will circumvent the issue.
I've tested this by confirming that the functions do not trigger when running the same command with Due to the fact that this is only one of several errors that could cause Azure Functions to not register upon a successful deployment (see @JarroVGIT's demonstration above), this is a failure of the Linux webapp consumption plan by not giving us much of a window into the zip deployment process for the purpose of debugging. The SCM site is nearly useless. EDIT: In my specific case, updating
|
I was able to solve this by including all dependencies my app used in my I then saw that my To update your project dependencies, make sure to update your requirements.txt file by running:
I'm using the v2 model, Python (v3.10) func app. |
Thanks, @Soggywaters, this is what worked for me. Since that's two people in this thread where this worked as a solution, I'm guessing this is a more common reason people are unable to deploy their functions. |
Plus one. It is very frustrating to debug issues that occur outside of the function definition. For example, import errors, missing dependencies, or issues with the binding and trigger definitions. We are essentially flying blind when trying to debug these problems. Azure Functions should provide more access to logging that can lend a light to these issues. |
I can confirm people's observations that this is a dependency issue. My code has a dependency on another package I published privately where I forgot to list I also verified that jsonschema was not being built on the remote build. After adding jsonschema to my current project's requirements.txt file it worked, and of course, I also expect it to work when I fix the This explains why
|
Why is this issue closed? Can it please be re-opened, this is still a pending issue which apparently lot of people are facing. |
Agree. Can we get a section on troubleshooting python function startup issues in the dev guide: |
for me switching to python 3.10 solved everything. |
I am facing it as well. The function is loaded successfully locally, but fails remotely |
I was running consumption plan on Linux using Python 3.10. Had to switch to P1 plan to get a proper SSH console to be able to find the logs under in /var/log. No traces or exceptions in Azure monitor and function was in running state. Expectation was that python functions v2 dispatcher Exceptions would be lifted to Azure monitor. |
Switched to Python V1 and it fixed my issues. Unfortunate that we're running into issues like this with V2. |
This is high priority for us in the Functions team and we will have more information and a troubleshooting guide in the coming days - thank you all for your patience and feedback! |
Same issue. I have been going mad trying to figure this out. I tested this as follows:
@shreyabatra4 I understand your team is working on this, but this is catastrophic because it means functions that depend on third-party packages cannot be deployed or updated, at all. |
This is my last message in this thread and then I am going to unsubscribe. A ton of people just post 'me too' or seem to not have read anything in this long thread, especially where I think I have done a pretty decent job in describing why you see this behavior here #1262 (comment) . In your case, you take a extremely non-straightforward python dependency ( I wish you the best of luck, I just don't want these kinds of posts in my inbox anymore. |
AZ Functions will not show the HTTP triggers if something goes wrong. For this specific issue of not being able to use an external package, I had the following workaround: A simple and dirty fix is copying all installed packages to the root dir of your application, in other words, in your - name: Install dependencies
run: pip install -r requirements.txt
- name: Copy all package files from the virtual environment to the root directory
run: cp -r $(python -c 'import site; print(site.getsitepackages()[0])')/* .
- name: Zip artifact for deployment
run: zip release.zip ./* -r The command Just, please, bear in mind this is not optimal (neither pretty) and if you can have issues if one of the files in your pip env has the same name as one (or more) files in your root. Good luck! :) |
|
Perhaps this only applies when you run locally, but I got this error after running
I simply followed the steps as learn.microsoft.com and did some minor edits to the function (and added some packages) before attempting to run. The fix for me was to change the auth_level enum from
I'm rather new to Python, so this may or may not be related to this issue, but I thought I'd post it in case it would help someone. |
I am facing this issue Its been observed that teh webapp is not working because the pythoin modules are not being loaded in azure webapp post deployment. |
Refer this SO Thread and my answer - https://stackoverflow.com/questions/76458717/why-is-the-functions-runtime-not-finding-my-functions-when-i-import-certain-pack/76463210?noredirect=1#> The Azure python Function with V2 programming model including external packages and imports in function_app.py works locally, But when I deploy it in Azure the Function Trigger is not visible. If I deploy default HTTP Trigger with python v2 programming model, The trigger is visible after deployment. But not when i add custom imports in the function_app.py and requirements.txt. Refer this image - https://i.imgur.com/CjCnsY8.png but the function files are visible in app files like here- https://i.imgur.com/R3SZWcW.png . I tried the deployment with App service plan and consumption plan both, Still no luck. I also added AzureWebJobsFeatureFlags:EnableWorkerIndexing settings, I also tried to deploy this function as zip using azure cli zip command with required settings to deploy function as zip, I also tried to deploy it with function core tools func azure functionapp publish command and also via VS code still no luck.
Investigative information
Please provide the following:
Repro steps
Provide the steps required to reproduce the problem:
Refer this SO thread and my answer- https://stackoverflow.com/questions/76458717/why-is-the-functions-runtime-not-finding-my-functions-when-i-import-certain-pack/76463210?noredirect=1#comment134830419_76463210
Expected behavior
Provide a description of the expected behavior.
after deployment HTTP trigger should be visible in Azure portal
Actual behavior
Provide a description of the actual behavior observed.
Function trigger is not visible in Functions section of Function tab but files are visible in app files
Known workarounds
Provide a description of any known workarounds.
Contents of the requirements.txt file:
Provide the requirements.txt file to help us find out module related issues.
numpy
pandas
opencv-python-headless
librosa
torch
torchaudio
torch-audiomentations
torchvision
azure-functions
Related information
Provide any related information
https://stackoverflow.com/questions/76458717/why-is-the-functions-runtime-not-finding-my-functions-when-i-import-certain-pack/76463210?noredirect=1#comment134830419_76463210
The text was updated successfully, but these errors were encountered: