Azure Functions GitHub deployment missing subfolders

Jan 20 Reputation points
2024-11-16T17:28:18.75+00:00

Hello, I hope someone can help me as I am trying for hours and dont get it running

I want to auto-deploy my FastAPI backend from GitHub with Actions (https://github.com/FrameworkV/FoodFusionAI)

and selected src/backend as root. I followed the instructions from the official Microsoft website and finally I can see the files on Azure under "Functions/App files", but only those in the root (src/backend) are there and the others are not. What am I doing wrong?

Thanks a lot

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,908 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shireesha Eeraboina 3,435 Reputation points Microsoft External Staff Moderator
    2024-11-18T17:27:34.05+00:00

    Hi @Jan,

    Welcome to the Microsoft Q&A Platform! Thank you for posting your question here.

    To resolve your issue, follow these steps:

    Ensure All Files Are Committed to GitHub:

    Make sure all subfolders and files in the src/backend directory are committed to GitHub.

    If any folder is empty, add a placeholder file like .gitkeep to ensure Git tracks it.

    Update Your GitHub Actions Workflow:

    Modify your GitHub Actions workflow to correctly package and deploy your app.

    Follow this typical workflow:

    Checkout the code.

    Set up Python.

    Install dependencies by running:

    pip install -r src/backend/requirements.txt

    Deploy the src/backend folder using the Azure/functions-action@v1 action.

    Configure Azure for Correct Deployment:

    In the Azure portal, go to Configuration > Application Settings and add the following setting:

    SCM_DO_BUILD_DURING_DEPLOYMENT=true

    This ensures that your app is built correctly during deployment.

    Check Deployment Logs:

    Review the deployment logs in Azure’s Deployment Center to identify any skipped files or errors during the deployment process.

    Use the Kudu Console (https://<your-app-name>.scm.azurewebsites.net/) to verify what was actually deployed.

    Use ZIP Deployment (if necessary):

    If the issue persists, use ZIP deployment as a fallback:

    Zip the entire src/backend folder.

    Deploy the zip file using the Azure CLI with the following command:

    az functionapp deployment source config-zip --src <path-to-zip-file> --name <your-app-name> --resource-group <your-resource-group>

    This ensures that all subfolders and files are deployed correctly.

    I hope this step-by-step guide helps address your issue and resolve the problem.

    Thank you!


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.