Python CosmosDB trigger failing to show up in Azure Functions GUI

AdamHumiecki-2359 20 Reputation points
2025-02-06T02:26:43.9933333+00:00

Hello,

We are currently working on trying to deploy a python cosmosDB-triggered function to an azure function app (v2), and while we have had successful deployments of the relevant files to the resource, it simply does not appear in the GUI (the files are present on the host however)

Generally this means there is an issue with modules/package dependencies, but I have verified in our appInsight traces/logs that there are no 'moduleNotFound' errors, and have verified that the proper dependencies are present in site/wwwroot/.python_packages/lib/site_packages directory. We are using an azure devops pipeline for the initial build (essentially pip install -r requirements.txt), which wraps up the relevant packages and function .py files into a zip archive, which is deployed onto the host using zipDeploy

Traces after deployment give no errors, simply info logs that state 0 functions found 0 functions loaded
At this point I am not sure what is wrong. I have: verified the environment settings on the azure function app resource mirror local.settings.json values (and our developers are able to run this function locally), and I believe our function_app.py has a properly formatted trigger:

@app.cosmos_db_trigger(
    arg_name="azcosmosdb",
    container_name="staging",
    database_name="Product_Catalog",
    connection="COSMOSDB_CONNSTRING",
    create_lease_container_if_not_exists=True,
    lease_container_name="leases",
    start_from_beginning=True,
)
@app.function_name(name="CosmosToCtFn")

Does the community have any suggestions on what I can try next? We have:

  • Tried remote deployment using azure core functions with no success
  • Destroyed and rebuilt the azure function resources
  • Extracted the zip package and ensured it can run locally (although a developer needed to reinstall packages to do so, but used the same pip install -r requirements.txt --upgrade --target=.python_packages/lib/site-packages/ command as featured in our pipeline)
  • verified that the build agent that runs the install command and the azure function app are on the same version of python (3.9)

Azure functions does not seem to give any clear logs or information on why exactly it wouldnt recognize the function, and we are confused on how it works locally but not on the function resource when the dependencies are present - are there any suggestions on what might be missing?

Thank you!

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,398 questions
Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,753 questions
{count} votes

Accepted answer
  1. Shireesha Eeraboina 1,635 Reputation points Microsoft Vendor
    2025-02-10T04:49:19.0466667+00:00

    Hi @AdamHumiecki-2359,

    Thank you for your patience and for sharing your feedback on the Q&A community platform. I’m glad to hear that you were able to resolve your issue, and I appreciate you sharing your solution! Your contribution is valuable and can help others in the community facing similar challenges.

    As per the Microsoft Q&A community policy, "The question author cannot accept their own answer. They can only accept answers by others"

    I’m reposting your solution here so you can mark it as accepted if it resolves your query:

    "The solution involved using the Diagnose and Solve Problems tool in Azure to identify that the missing ODBC18 drivers were causing the issue. They resolved this by containerizing the function, which facilitated easier dependency management. Without this approach, they would have considered using an alternative Python library for SQL connections."

    If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue. 

    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.