Closed saikumaru closed 6 months ago
If your function is working locally - and deploys successfully but no files or functions are visible after deployment - this is potentially the issue: https://github.com/Azure/azure-functions-python-worker/issues/1262#issuecomment-1784778748
Thank you @jsm-NK for your reply.
Thank you @jsm-NK for your reply.
- Unfortunately we dont have a way to find out which library is causing that issue, if at all, in our case.
- If we provide a version number in requirements.txt, it is not supposed to download an "unexpected version from PyPI".
- The libraries in my requirements file dont seem to be part of a python base installation.
Quick follow up - After deploying, do you see any files if you go on "app files" instead of going to overview/code/test ?
Have you configured all your application/configuration settings in azure?
Thanks for reporting will check and update.
Adding a comment to this ticket as well since this one is open. (https://github.com/Azure/azure-functions-python-worker/issues/1262 is closed)
All I had in my requirements.txt file was azure-functions and I still saw this.
Adding a comment to this ticket as well since this one is open. (#1262 is closed)
All I had in my requirements.txt file was azure-functions and I still saw this.
Saw what, exactly? The issue in #1262 can have many causes. Do you built locally and do a ZIP deployment? Do you perform a remote build? I have a special repo with reproducible steps for the issue of 'Functions not showing in Azure Portal', and they all have the same issue: there is an unhandled exception raised in the root of your script or imports. The reason may vary:
pip install
step on a Windows machine, while deploying to a Linux machine and one of your dependencies was specifically downloaded for Windows;.py
file with my_var = os.environ('MYVAR')
(this will raise a KeyError
if MYVAR
doesn't exists);Etc. There are countless ways to induce this behavior and the only thing Microsoft has to do is to propagate the exception raised to Application Insight so we can actually see what is wrong.
If you have no idea what is wrong: pull everything in the scope of your function method. So, rather than doing this:
import azure.functions as func
import my_package
import os
myvar = os.environ("MYVAR")
app = func.FunctionApp()
@app.function_name(name="HttpExample")
@app.route(route="hello")
def test_function(req: func.HttpRequest) -> func.HttpResponse:
return func.HttpResponse("HttpExample function processed a request!")
Try this:
import azure.functions as func
app = func.FunctionApp()
@app.function_name(name="HttpExample")
@app.route(route="hello")
def test_function(req: func.HttpRequest) -> func.HttpResponse:
import my_package
import os
myvar = os.environ("MYVAR")
return func.HttpResponse("HttpExample function processed a request!")
Now call your function and see what exception you get. If you don't get an exception, then at least you can move back the lines of code one by one to pinpoint which one is causing issues.
Thanks for you great feedback and insights on this problem!
My use case is pretty simple; I create an HttpTrigger, then I create another one in a new blueprint file, and do the import and register_functions in function_app.py. As such:
Right now, I'm thinking the only way out is to back off to V1, which seems to work fine.
Yes, I look forward to some logging that will pinpoint the source of the problem.
Thanks again!
- The only relative import I have is importing the blueprint so I can register it. When I comment out the register_app but not the import, it works fine, i.e., I see the function on the portal. So presumably the import is fine.
@charlesjankowski you say register_app
but did you mean register_functions
? If so, please try register_blueprint
on the imported blueprint. Otherwise, without code example, it's hard to point to a problem to be honest. Good luck!
@charlesjankowski: Could you please share the code and steps for replication, if available? Additionally, I'd like to know if you intend to deploy it to a Consumption or an EP app. Thanks
@saikumaru :- I'd like to know if you intend to deploy it to a Consumption or an EP app. Thanks
@JarroVGIT thanks for correcting my error, yes I meant register_functions() (since that's what was in the instructions in the newly created blueprint file). I replaced with register_blueprint() and get the same.
Here's my code https://github.com/Grapevine-Health/cj20231029a
Right now it's Consumption, which was the only one available for Python 3.10 US-East (unless I'm wrong on that).
@charlesjankowski I see what's potentially happening in your case. The issue arises because you have a variable named blueprint
and a function with the same name in your blueprint.py
. When you import blueprint
using from blueprint import blueprint
in your function_app.py
file, Python gets confused because it tries to import both the variable and the function with the same name, leading to a naming conflict. To resolve this issue, you should consider renaming either the variable or the function to avoid the naming conflict.
In addition to, All available SKUs support both Python 3.10 and Python 3.11. Thanks
@pdthummar Thank you, that seems to work now!
I used the VSCode-created blueprint.py unmodified; perhaps it would be good for the auto-generated example to not cause such errors. It did ask for both the blueprint filename and the new function name, so that's arguably on me, but perhaps the sample could call the azure.functions.Blueprint object (and the decorator) FILE_bp or something like that just to minimize the chance of conflict.
In any case, indicating some kind of error during the deployment process would be great.
Also, both app.register_functions() and app.register_blueprint() seem to work; is there a different/preference?
Thanks again!
@charlesjankowski: Could you please share the code and steps for replication, if available? Additionally, I'd like to know if you intend to deploy it to a Consumption or an EP app. Thanks
@saikumaru :- I'd like to know if you intend to deploy it to a Consumption or an EP app. Thanks
Thank you for your reply. We need to deploy it to a Linux consumption plan. Rest of the steps followed to deploy it are as per the MS document quoted.
Thank you @jsm-NK for your reply.
- Unfortunately we dont have a way to find out which library is causing that issue, if at all, in our case.
- If we provide a version number in requirements.txt, it is not supposed to download an "unexpected version from PyPI".
- The libraries in my requirements file dont seem to be part of a python base installation.
Quick follow up - After deploying, do you see any files if you go on "app files" instead of going to overview/code/test ?
Have you configured all your application/configuration settings in azure?
Yes, I can see the latest files under "app files"
The settings have been updated as per the documentation of MS, so yes they are all configured correctly.
@saikumaru I successfully deployed the function to the Azure Functions Consumption Plan using the provided source code. I used the following command to publish it: func azure functionapp publish
Thank you! I will try that. But does the function show up on the portal though please?
I had successful deploys earlier too, but they didn't show up on portal.
@saikumaru Yes, Function is showing up in portal and works as expected.
@pdthummar no luck, sorry. Can you please retry deploying, with a few edits to the debug messages, just to be sure.
More importantly, is there a way for us to see what is going wrong once this is deployed please? Perhaps some app logs etc.
I'm experiencing exact same problem as @saikumaru. I'm deploying a durable function with a time trigger. Deployment finished successfully but functions cannot be listed at the end. They are also not visible in the portal. Starting to think it was not a good idea to jump on Programming Model V2!
func azure functionapp publish ehs-ds-huddlekpiupdater-dev-func
Getting site publishing info...
[2023-11-02T22:00:35.321Z] Starting the function app deployment...
Creating archive for current directory...
Performing remote build for functions project.
Deleting the old .python_packages directory
Uploading 20.68 KB [##############################################################################]
Remote build in progress, please wait...
Updating submodules.
Preparing deployment for commit id '454373a6-4'.
PreDeployment: context.CleanOutputPath False
PreDeployment: context.OutputPath /home/site/wwwroot
Repository path is /tmp/zipdeploy/extracted
Running oryx build...
Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.10.4 -p packagedir=.python_packages/lib/site-packages
Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues
Oryx Version: 0.2.20230210.1, Commit: a49c8f6b8abbe95b4356552c4c884dea7fd0d86e, ReleaseTagName: 20230210.1
Build Operation ID: 30daf5800188b699
Repository Commit : 454373a6-4601-45bc-b0df-e4ab98f24793
OS Type : bullseye
Image Type : githubactions
Detecting platforms...
Detected following platforms:
python: 3.10.4
Version '3.10.4' of platform 'python' is not installed. Generating script to install it...
Source directory : /tmp/zipdeploy/extracted
Destination directory: /home/site/wwwroot
Downloading and extracting 'python' version '3.10.4' to '/tmp/oryx/platforms/python/3.10.4'...
Detected image debian flavor: bullseye.
Downloaded in 1 sec(s).
Verifying checksum...
Extracting contents...
performing sha512 checksum for: python...
Done in 6 sec(s).
image detector file exists, platform is python..
OS detector file exists, OS is bullseye..
Python Version: /tmp/oryx/platforms/python/3.10.4/bin/python3.10
Creating directory for command manifest file if it does not exist
Removing existing manifest file
Running pip install...
Done in 40 sec(s).
[22:00:55+0000] Collecting python-dateutil
[22:00:55+0000] Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
[22:00:55+0000] Collecting azure-functions
[22:00:55+0000] Downloading azure_functions-1.17.0-py3-none-any.whl (165 kB)
[22:00:55+0000] Collecting azure-functions-durable
[22:00:55+0000] Downloading azure_functions_durable-1.2.6-py3-none-any.whl (241 kB)
[22:00:56+0000] Collecting azure-devops
[22:00:56+0000] Downloading azure_devops-7.1.0b3-py3-none-any.whl (1.6 MB)
[22:00:56+0000] Collecting gspread
[22:00:56+0000] Downloading gspread-5.12.0-py3-none-any.whl (48 kB)
[22:00:56+0000] Collecting oauth2client
[22:00:56+0000] Downloading oauth2client-4.1.3-py2.py3-none-any.whl (98 kB)
[22:00:56+0000] Collecting PyOpenSSL
[22:00:56+0000] Downloading pyOpenSSL-23.3.0-py3-none-any.whl (58 kB)
[22:00:57+0000] Collecting pandas
[22:00:57+0000] Downloading pandas-2.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.3 MB)
[22:00:58+0000] Collecting six>=1.5
[22:00:58+0000] Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
[22:01:00+0000] Collecting aiohttp>=3.6.2
[22:01:00+0000] Downloading aiohttp-3.8.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB)
[22:01:00+0000] Collecting furl>=2.1.0
[22:01:00+0000] Downloading furl-2.1.3-py2.py3-none-any.whl (20 kB)
[22:01:01+0000] Collecting requests==2.*
[22:01:01+0000] Downloading requests-2.31.0-py3-none-any.whl (62 kB)
[22:01:01+0000] Collecting certifi>=2017.4.17
[22:01:01+0000] Downloading certifi-2023.7.22-py3-none-any.whl (158 kB)
[22:01:01+0000] Collecting idna<4,>=2.5
[22:01:01+0000] Downloading idna-3.4-py3-none-any.whl (61 kB)
[22:01:02+0000] Collecting charset-normalizer<4,>=2
[22:01:02+0000] Downloading charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (142 kB)
[22:01:02+0000] Collecting urllib3<3,>=1.21.1
[22:01:02+0000] Downloading urllib3-2.0.7-py3-none-any.whl (124 kB)
[22:01:02+0000] Collecting msrest<0.8.0,>=0.7.1
[22:01:02+0000] Downloading msrest-0.7.1-py3-none-any.whl (85 kB)
[22:01:02+0000] Collecting google-auth-oauthlib>=0.4.1
[22:01:02+0000] Downloading google_auth_oauthlib-1.1.0-py2.py3-none-any.whl (19 kB)
[22:01:03+0000] Collecting google-auth>=1.12.0
[22:01:03+0000] Downloading google_auth-2.23.4-py2.py3-none-any.whl (183 kB)
[22:01:03+0000] Collecting rsa>=3.1.4
[22:01:03+0000] Downloading rsa-4.9-py3-none-any.whl (34 kB)
[22:01:04+0000] Collecting pyasn1-modules>=0.0.5
[22:01:04+0000] Downloading pyasn1_modules-0.3.0-py2.py3-none-any.whl (181 kB)
[22:01:04+0000] Collecting httplib2>=0.9.1
[22:01:04+0000] Downloading httplib2-0.22.0-py3-none-any.whl (96 kB)
[22:01:04+0000] Collecting pyasn1>=0.1.7
[22:01:04+0000] Downloading pyasn1-0.5.0-py2.py3-none-any.whl (83 kB)
[22:01:05+0000] Collecting cryptography<42,>=41.0.5
[22:01:05+0000] Downloading cryptography-41.0.5-cp37-abi3-manylinux_2_28_x86_64.whl (4.4 MB)
[22:01:06+0000] Collecting tzdata>=2022.1
[22:01:06+0000] Downloading tzdata-2023.3-py2.py3-none-any.whl (341 kB)
[22:01:06+0000] Collecting pytz>=2020.1
[22:01:06+0000] Downloading pytz-2023.3.post1-py2.py3-none-any.whl (502 kB)
[22:01:07+0000] Collecting numpy<2,>=1.22.4
[22:01:07+0000] Downloading numpy-1.26.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB)
[22:01:08+0000] Collecting attrs>=17.3.0
[22:01:08+0000] Downloading attrs-23.1.0-py3-none-any.whl (61 kB)
[22:01:08+0000] Collecting frozenlist>=1.1.1
[22:01:08+0000] Downloading frozenlist-1.4.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (225 kB)
[22:01:10+0000] Collecting multidict<7.0,>=4.5
[22:01:10+0000] Downloading multidict-6.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (114 kB)
[22:01:10+0000] Collecting yarl<2.0,>=1.0
[22:01:10+0000] Downloading yarl-1.9.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (268 kB)
[22:01:11+0000] Collecting async-timeout<5.0,>=4.0.0a3
[22:01:11+0000] Downloading async_timeout-4.0.3-py3-none-any.whl (5.7 kB)
[22:01:11+0000] Collecting aiosignal>=1.1.2
[22:01:11+0000] Downloading aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
[22:01:11+0000] Collecting cffi>=1.12
[22:01:11+0000] Downloading cffi-1.16.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (443 kB)
[22:01:12+0000] Collecting pycparser
[22:01:12+0000] Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
[22:01:12+0000] Collecting orderedmultidict>=1.0.1
[22:01:12+0000] Downloading orderedmultidict-1.0.1-py2.py3-none-any.whl (11 kB)
[22:01:12+0000] Collecting cachetools<6.0,>=2.0.0
[22:01:12+0000] Downloading cachetools-5.3.2-py3-none-any.whl (9.3 kB)
[22:01:12+0000] Collecting requests-oauthlib>=0.7.0
[22:01:12+0000] Downloading requests_oauthlib-1.3.1-py2.py3-none-any.whl (23 kB)
[22:01:12+0000] Collecting pyparsing!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3,<4,>=2.4.2
[22:01:12+0000] Downloading pyparsing-3.1.1-py3-none-any.whl (103 kB)
[22:01:13+0000] Collecting azure-core>=1.24.0
[22:01:13+0000] Downloading azure_core-1.29.5-py3-none-any.whl (192 kB)
[22:01:13+0000] Collecting isodate>=0.6.0
[22:01:13+0000] Downloading isodate-0.6.1-py2.py3-none-any.whl (41 kB)
[22:01:13+0000] Collecting typing-extensions>=4.6.0
[22:01:13+0000] Downloading typing_extensions-4.8.0-py3-none-any.whl (31 kB)
[22:01:13+0000] Collecting oauthlib>=3.0.0
[22:01:13+0000] Downloading oauthlib-3.2.2-py3-none-any.whl (151 kB)
[22:01:14+0000] Installing collected packages: urllib3, pyasn1, idna, charset-normalizer, certifi, typing-extensions, six, rsa, requests, pycparser, pyasn1-modules, oauthlib, multidict, frozenlist, cachetools, yarl, requests-oauthlib, pyparsing, orderedmultidict, isodate, google-auth, cffi, azure-core, attrs, async-timeout, aiosignal, tzdata, pytz, python-dateutil, numpy, msrest, httplib2, google-auth-oauthlib, furl, cryptography, azure-functions, aiohttp, PyOpenSSL, pandas, oauth2client, gspread, azure-functions-durable, azure-devops
[22:01:34+0000] Successfully installed PyOpenSSL-23.3.0 aiohttp-3.8.6 aiosignal-1.3.1 async-timeout-4.0.3 attrs-23.1.0 azure-core-1.29.5 azure-devops-7.1.0b3 azure-functions-1.17.0 azure-functions-durable-1.2.6 cachetools-5.3.2 certifi-2023.7.22 cffi-1.16.0 charset-normalizer-3.3.2 cryptography-41.0.5 frozenlist-1.4.0 furl-2.1.3 google-auth-2.23.4 google-auth-oauthlib-1.1.0 gspread-5.12.0 httplib2-0.22.0 idna-3.4 isodate-0.6.1 msrest-0.7.1 multidict-6.0.4 numpy-1.26.1 oauth2client-4.1.3 oauthlib-3.2.2 orderedmultidict-1.0.1 pandas-2.1.2 pyasn1-0.5.0 pyasn1-modules-0.3.0 pycparser-2.21 pyparsing-3.1.1 python-dateutil-2.8.2 pytz-2023.3.post1 requests-2.31.0 requests-oauthlib-1.3.1 rsa-4.9 six-1.16.0 typing-extensions-4.8.0 tzdata-2023.3 urllib3-2.0.7 yarl-1.9.2
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
WARNING: You are using pip version 21.2.4; however, version 23.3.1 is available.
You should consider upgrading via the '/tmp/oryx/platforms/python/3.10.4/bin/python3.10 -m pip install --upgrade pip' command.
Not a vso image, so not writing build commands
Preparing output...
Copying files to destination directory '/home/site/wwwroot'...
Done in 3 sec(s).
Removing existing manifest file
Creating a manifest file...
Manifest file created.
Copying .ostype to manifest output directory.
Done in 49 sec(s).
Running post deployment command(s)...
Generating summary of Oryx build
Deployment Log file does not exist in /tmp/oryx-build.log
The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build
Triggering recycle (preview mode disabled).
Linux Consumption plan has a 1.5 GB memory limit on a remote build container.
To check our service limit, please visit https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale#service-limits
Writing the artifacts to a squashfs file
Parallel mksquashfs: Using 1 processor
Creating 4.0 filesystem on /home/site/artifacts/functionappartifact.squashfs, block size 131072.
[=================\ ] 2600/9226 28%
[============================================================| ] 9200/9226 99%
[=============================================================|] 9226/9226 100%
Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072
compressed data, compressed metadata, compressed fragments,
compressed xattrs, compressed ids
duplicates are removed
Filesystem size 52180.77 Kbytes (50.96 Mbytes)
28.28% of uncompressed filesystem size (184514.28 Kbytes)
Inode table size 90035 bytes (87.92 Kbytes)
28.56% of uncompressed inode table size (315238 bytes)
Directory table size 90543 bytes (88.42 Kbytes)
34.99% of uncompressed directory table size (258734 bytes)
Number of duplicate files found 804
Number of inodes 9738
Number of files 8634
Number of fragments 721
Number of symbolic links 0
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 1104
Number of ids (unique uids + gids) 1
Number of uids 1
root (0)
Number of gids 1
root (0)
Creating placeholder blob for linux consumption function app...
SCM_RUN_FROM_PACKAGE placeholder blob scm-latest-ehs-ds-huddlekpiupdater-dev-func.zip located
Uploading built content /home/site/artifacts/functionappartifact.squashfs for linux consumption function app...
Resetting all workers for ehs-ds-huddlekpiupdater-dev-func.azurewebsites.net
Deployment successful. deployer = Push-Deployer deploymentPath = Functions App ZipDeploy. Extract zip. Remote build.
Remote build succeeded!
[2023-11-02T22:02:21.797Z] Syncing triggers...
Functions in ehs-ds-huddlekpiupdater-dev-func:
func --version 4.0.5441
@mk7exe - Checking the issue and why was this issue not surfaced. I see the exception in the backend, and it looks like an issue on our end. I'll get that fixed asap and release it in the latest version of the azure-python-functions-durable.
The issue with logs not showing up - I am investigating that on my end and checking how to surface this. Most likely the logs would be on AppInsights and not on the build system.
Thank you @vrdmr ! That would be really helpful to have that logs, please keep us updated. if you have access to look at the backend logs, here is the app
@saikumaru Yes, Function is showing up in portal and works as expected.
@pdthummar Hope you had a chance to check my reply. However Id like to reconfirm if you have used both my files as-is when you tested and deployed it(Py version=3.9.13)?
Thanks @vrdmr. I'm looking forward for your updates
@saikumaru I tested with python3.10 earlier and worked without any issues. but i have tried to test it with python3.9 and experienced same issue.
It appears to be a qdrant-client 1.2.0 conflicting libraries issue. In your remote build log, I've observed a below warning message that is potentially causing the issue.
qdrant-client 1.2.0 requires pydantic<2.0,>=1.8, but you'll have pydantic 2.4.2 which is incompatible. qdrant-client 1.2.0 requires typing-extensions<4.6.0,>=4.0.0, but you'll have typing-extensions 4.8.0 which is incompatible.
As a result of this compatibility issue, the worker is failing to index functions with below error, due to this, functions aren't visible in the portal.
Worker failed to index functions Result: Failure Exception: ImportError: cannot import name 'ENCODERS_BY_TYPE' from 'pydantic.json' (/home/site/wwwroot/.python_packages/lib/site-packages/pydantic/json.py). Troubleshooting Guide: https://aka.ms/functions-modulenotfound Stack: File '/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py', line 345, in _handle__functions_metadata_request fx_metadata_results = self.index_functions(function_path) File '/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py', line 617, in index_functions indexed_functions = loader.index_function_app(function_path) File '/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/utils/wrappers.py', line 48, in call raise extend_exception_message(e, message) File '/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/utils/wrappers.py', line 44, in call return func(*args, **kwargs) File '/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/loader.py', line 214, in index_function_app imported_module = importlib.import_module(module_name) File '/usr/local/lib/python3.9/importlib/init.py', line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File '', line 1030, in _gcd_import File '', line 1007, in _find_and_load File '', line 986, in _find_and_load_unlocked File '', line 680, in _load_unlocked File '', line 850, in exec_module File '', line 228, in _call_with_frames_removed File '/home/site/wwwroot/function_app.py', line 6, in from qdrant_client import QdrantClient File '/home/site/wwwroot/.python_packages/lib/site-packages/qdrant_client/__init__.py', line 1, in from .qdrant_client import QdrantClient as QdrantClient File '/home/site/wwwroot/.python_packages/lib/site-packages/qdrant_client/qdrant_client.py', line 4, in from qdrant_client.client_base import QdrantBase File '/home/site/wwwroot/.python_packages/lib/site-packages/qdrant_client/client_base.py', line 3, in from qdrant_client.conversions import common_types as types File '/home/site/wwwroot/.python_packages/lib/site-packages/qdrant_client/conversions/common_types.py', line 13, in from qdrant_client.http import models as rest File '/home/site/wwwroot/.python_packages/lib/site-packages/qdrant_client/http/__init__.py', line 4, in from qdrant_client.http.api_client import ( # noqa F401 File '/home/site/wwwroot/.python_packages/lib/site-packages/qdrant_client/http/api_client.py', line 7, in from qdrant_client.http.api.cluster_api import AsyncClusterApi, SyncClusterApi File '/home/site/wwwroot/.python_packages/lib/site-packages/qdrant_client/http/api/cluster_api.py', line 7, in from pydantic.json import ENCODERS_BY_TYPE
To address the issue, I attempted to utilize qdrant_client
without specifying a specific version in requirements.txt (i.e., not using qdrant_client==1.2.0
). After redeploying, I observed that the function is now accessible through the portal. (Using Python3.9)
I would suggest retrying deployment with above mitigation. Thanks
@pdthummar thank you very much for persistently looking into this. I will give it a try and hopefully this should be it. Can you confirm if this error was on your local or remote please, and if it's remote where exactly can these be viewed?
But I wish I could have seen these logs on remote as well, or the portal say at least something about why the function dint show up. In v1 we were able to view logs but v2 doesn't show these reasons.
@pdthummar that has worked, thank you!
As a result of this compatibility issue, the worker is failing to index functions with below error, due to this, functions aren't visible in the portal.
Please can you advise how and where we can look up that failures?
The issue with logs not showing up - I am investigating that on my end and checking how to surface this. Most likely the logs would be on AppInsights and not on the build system.
@vrdmr would you have an update on this please, so that we can debug similar errors.
I am having similar issues where ....
Tried all possible plans but none of seams to work. I am currently using Python 3.10 and V2 function. All logs in deployment center doesn't show any error.
My requirement function is : azure-functions
openai[datalib]==0.28
azure-search-documents ==11.4.0b9
azure-storage-blob==12.14.1
cffi
markdown
pymongo
python-jose
six
tiktoken
msal
@saikumaru We are actively addressing this matter to offer users more clarification on such issues. We will provide an update once we make progress on this. I am closing this issue for now. Thanks
@jmandivarapu If you are still facing the issue, please open new issue. Thanks
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.
@saikumaru We are actively addressing this matter to offer users more clarification on such issues. We will provide an update once we make progress on this. I am closing this issue for now. Thanks
@jmandivarapu If you are still facing the issue, please open new issue. Thanks
Why was this issue closed while this clearly is an ongoing issue? Is there an other topic where we can follow the progress on this issue?
In case that it is not visible means that there is either missing an dependency (why pip freeze resolves the issue) or an dependency cannot be installed on the serverless instance. I had an issue with the psycopg2 package.
@BDParwez I’m pretty sure that is not the case. I deployed the same function with the same dependencies in V1 and everything works fine. Same function in V2 has the issue of functions not being visible in the portal and not being callable.
I had the same issue and found the actual error by opening MyAzureFunction/Monitoring/Log Stream/Filesystem Logs
and deploying the function.
I saw an error that imports were broken even though VS code said deployment was "successful" and function did not appear. Fixed this error and now function appears.
Added more code and it no longer shows any other errors in that log stream and function does not appear...
I found the actual actual error by setting up WSL in VS code and running the function there. It immediately threw the error which azure eats up. It was a keras model which works in windows but doesn't work in linux, I just re-saved this model using WSL, tested locally, and now functions appear in Azure.
Azure should just throw these errors instead of silencing them and saying that the deployment is successful...
TLDR: Use WSL to test your function locally
Experiencing a similar issue here too...
The same issue using Python V2. Deploying from vscode worked. Deploying a zip did not work even though the code was visible in Azure Portal. Switching to Python V1 solved the problem.
Microsoft recently updated their documentation, and the solution is to add the following code to the pipeline YAML file:
Here are the Microsoft documentations that describe the error and solution https://learn.microsoft.com/en-us/azure/azure-functions/recover-python-functions?tabs=vscode%2Cbash&pivots=python-mode-decorators#functions-not-found-after-deployment
Hi all,
I was running into the same issues mentioned above. I was using the Deployment Center in the Azure Function App to connect it to my GitHub, and no matter which packages I installed inside my requirements.txt file—even something as common as requests—the function trigger would not show up in the portal when deployed because it couldn't find the packages.
The solution I found was to zip up the library packages during the GitHub build instead of letting Oryx do the remote build. Here are the changes I made to the GitHub workflow file to achieve this:
pip install --target=".python_packages/lib/site-packages" -r requirements.txt
zip release.zip .python_packages ./* -r
scm-do-build-during-deployment: false
enable-oryx-build: false
This way you can still use the V2 programming model and can use Github Actions instead of VSCode to deploy to the Azure Function.
Thanks so much pk556 (and others). I was running into this as well and pulling my hair out. My python func deployed fine when using basic auth/github cicd, but this issue manifested when I tried to instead use User Managed Identity/Federated and sync CICD to github.
The steps pk556 outlined finally and immediately resolved the missing functions issue for me.
Follow the steps mentioned in the document to deploy the function. https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-python?pivots=python-mode-decorators
Investigative information
Please provide the following:
Repro steps
Provide the steps required to reproduce the problem:
-->
Expected behavior
Provide a description of the expected behavior.
Actual behavior
Provide a description of the actual behavior observed.
Known workarounds
Provide a description of any known workarounds.
No workarounds
Contents of the requirements.txt file:
Provide the requirements.txt file to help us find out module related issues.
Files at the end
Related information
Provide any related information
Source
```python import azure.functions as func import logging import os #qdrant from qdrant_client import QdrantClient from qdrant_client.models import Distance, VectorParams,PointStruct #encoder for vecotrizing embeddings from sentence_transformers import SentenceTransformer from langchain.document_loaders import PyPDFLoader from langchain.document_loaders import DirectoryLoader from langchain.text_splitter import RecursiveCharacterTextSplitter #https://stackoverflow.com/questions/75627362/azure-functions-python-error-no-job-functions app = func.FunctionApp() @app.blob_trigger(arg_name="myblob", path="mycontainer", connection="BlobStorageConnectionString") def blob_trigger(myblob: func.InputStream): logging.info(f"Python blob trigger function processed blob" f"Name: {myblob.name}" f"Blob Size: {myblob.length} bytes") ``` ```txt # DO NOT include azure-functions-worker in this file # The Python Worker is managed by Azure Functions platform # Manually managing azure-functions-worker may cause unexpected issues azure-functions -f https://download.pytorch.org/whl/torch_stable.html torch==1.13.1+cpu torchvision==0.14.1+cpu torchaudio==0.13.1 sentence_transformers==2.2.2 langchain==0.0.274 qdrant_client==1.2.0 pypdf==3.9.0 ```Several customers reported this issue here, which was closed with no answer. https://github.com/Azure/azure-functions-python-worker/issues/1262 Please kindly look in and suggest.
Tagging you from the closed issue where the MS team hasn't been responding. @Otimkev @andrewmmm @jsm-NK @aadamsx @JarroVGIT @SiddheshDesai06