Azure function not listed in Azure Function app

Abel Quintana Pena 0 Reputation points
2024-07-17T19:01:20.2+00:00

I have an azure function (python) that I was able to successfully deploy (via DevOps), but when I include the following line, it disappears from the list of Azure functions (in my Azure Function app):

from azure.storage.blob import BlobServiceClient

If I remove that line and deploy, I can see the function again. The function works locally with no issues. I have tried all possible solutions (env variables, reinstalling packages, requirements.txt, etc.)

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,830 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,766 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Abel Quintana Pena 0 Reputation points
    2024-07-17T19:30:43.7133333+00:00

    Replacing these commands in my deployment pipeline (DevOps, Install App Dependencies step):

    python3.11 -m venv worker_venv

    source worker_venv/bin/activate

    pip3.11 install setuptools

    pip3.11 install -r requirements.txt

    by this one:

    pip install --target="$(System.DefaultWorkingDirectory)/.python_packages/lib/site-packages" -r requirements.txt

    fixed the issue. I found the solution here:

    https://github.com/Azure/azure-functions-python-worker/issues/477#issuecomment-948290439

    More details here: https://video2.skills-academy.com/en-us/azure/azure-functions/functions-reference-python?tabs=asgi%2Capplication-level&pivots=python-mode-decorators#install-local-packages

    I was in the process of creating a support ticket when I was able to access the app logs. The actual error was the following:

    Error: No module named 'azure.storage', Cannot find module

    0 comments No comments

  2. JananiRamesh-MSFT 25,591 Reputation points
    2024-07-18T09:26:47.6666667+00:00

    @Abel Quintana Pena Glad to see that your issue is resolved and thanks for confirming the solution that worked. Since the Microsoft Q&A community has a policy that the question author cannot accept their own answer. They can only accept answers by others, I'll summarized and posted the solution, request you to Accept the answer, it will benefit the community find the answers quickly.

    Issue: No module named 'azure.storage', Cannot find module

    Solution: Replacing below commands in your deployment pipeline (DevOps, Install App Dependencies step):

    python3.11 -m venv worker_venv

    source worker_venv/bin/activate

    pip3.11 install setuptools

    pip3.11 install -r requirements.txt

    by this one:

    pip install --target="$(System.DefaultWorkingDirectory)/.python_packages/lib/site-packages" -r requirements.txt

    fixed the issue.

    0 comments No comments

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.