Webapp won't find github-hosted resources

Kevin GUIMARD 65 Reputation points
2025-02-24T18:30:53.5133333+00:00

I created a webapp based on a python project whose code is to be retrieved from an external git provider. This project contains a file named main.py.

Now, if I use "python main.py" as the startup command, I get the following error in the log stream:
python: can't open file 'main.py'

I don't know what happens... Maybe Azure didn't manage to retrieve the files from git? The problem is that I don't see this step in the logs. I tried to use $APP_PATH, but it points to the same directory.azure By the way, I'm wondering why Azure runs a container after trying to execute the command. I would expect the command to be ran within the container. Could someone explain that to me?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,961 questions
{count} votes

Accepted answer
  1. Harshitha Veeramalla 1,306 Reputation points Microsoft External Staff Moderator
    2025-02-25T12:26:31.91+00:00

    Hi @Kevin GUIMARD

    python: can't open file 'main.py'

    By default files/folders will be deployed to site/wwwroot directory.

    python main.py , expects the main.py to be in the site/wwwroot folder.

    Make sure the files are in the application root directory using the new ui - https://AppName.scm.azurewebsites.net/newui/fileManager.

    enter image description here

    You can open the KUDU console using this URL (https://AppName.scm.azurewebsites.net/).

    enter image description here

    I'm wondering why Azure runs a container after trying to execute the command

    Azure App service deployed in Linux by default runs inside the containers. You can check the Log Stream in the KUDU Console.

    Update

    @Kevin GUIMARD I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this!

    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 repost your solution in case you'd like to "Accept " the answer.

    Solution :

    Unchecking "Deployment slot setting" in environment variable solved the issue , allowing Oryx to handle the installation of dependencies automatically.

    User's image


    Please remember to "Accept Answer" if the sol has helped, so that others in the community facing similar issues can easily find the solution.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Kevin GUIMARD 65 Reputation points
    2025-03-03T09:00:38.1033333+00:00

    We found the solution: we had to uncheck "Deployment slot setting" in our environment variable so that Oryx could manage itself the installation of python libraries:
    User's image

    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.