Share via

Azure Functions Python v2 deployment succeeds but functions don't register

Maya D 0 Reputation points
2025-11-03T20:55:26.56+00:00

Hi

I'm struggling with the following issue:

Python Azure Function deployment completes successfully but no functions appear in portal or function list.

SETUP: - Runtime: Python 3.12 - Plan: Linux Consumption - Programming Model: Python v2 (@app.route decorator)

ERROR LOGS: ModuleNotFoundError: No module named 'docx' Even with SCM_DO_BUILD_DURING_DEPLOYMENT=true,

packages not installing

TRIED: - Fresh function app - Removed pycache folders - Fixed zip structure - Added version numbers to requirements.txt - Enabled worker indexing - Multiple deployments

RESULT: az functionapp function list returns []

How to debug why packages aren't installing during deployment?

thanks

maya

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.


1 answer

Sort by: Most helpful
  1. Dio Xavier 287K Reputation points Volunteer Moderator
    2025-11-03T21:37:55.34+00:00

    Hi Maya,

    Welcome to Microsoft Q&A Azure

    This issue usually happens when Python packages aren’t properly installed during deployment, causing the ModuleNotFoundError: No module named 'docx'. Here’s how to troubleshoot and fix it:

    Check the build process

    1. Review deployment logs:
      Go to
      https://<your-function-name>.scm.azurewebsites.net/api/logs/docker/zipdeploy.build.log
      or Deployment Center -> Logs to confirm if pip install -r requirements.txt failed.

    Confirm app settings:
    In Configuration -> Application settings, make sure:

    SCM_DO_BUILD_DURING_DEPLOYMENT=true
    ENABLE_ORYX_BUILD=true
    

    Validate your requirements.txt:
    Example:

    python-docx==1.1.0
    azure-functions
    

    Avoid relative paths or local dependencies.

    Ensure correct structure:
    The function_app.py (with @app.route) and requirements.txt should be in the project root.


    Deploy manually for detailed logs:

    func azure functionapp publish <APP_NAME> --python
    

    Check installed packages via SSH/Kudu:

    pip list
    cat requirements.txt
    

    Consider using GitHub Actions or Azure Pipelines for clean remote builds.

    References:

    1. Debug Python Azure Functions deployments https://learn.microsoft.com/azure/azure-functions/functions-reference-python
    2. Azure Functions app settings (SCM_DO_BUILD_DURING_DEPLOYMENT e outras variáveis) https://learn.microsoft.com/azure/azure-functions/functions-app-settings#scm_do_build_during_deployment
    3. Best practices for Python Azure Functions development and deployment https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-python?tabs=get-started%2Casgi%2Capplication-level&pivots=python-mode-decorators

    Was this answer helpful?

    0 comments No comments

Your answer

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