Skip to content

Main Flask file name #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
filiptrivan opened this issue Mar 22, 2025 · 3 comments
Open

Main Flask file name #70

filiptrivan opened this issue Mar 22, 2025 · 3 comments

Comments

@filiptrivan
Copy link

The documentation should mention that main file used to initialize a Flask application must be named app.py for proper automatic detection by Azure.

@pamelafox
Copy link
Contributor

It's not quite that strict, but it's true that it iterates through a list of likely names to look for a Flask app, as described here:
https://github.com/microsoft/Oryx/blob/ed3ab2e6e195485002c01923e19f136e90d714bf/doc/runtimes/python.md#run

Here's the actual Go code in the Oryx build system, if you're curious:
https://github.com/microsoft/Oryx/blob/ed3ab2e6e195485002c01923e19f136e90d714bf/src/startupscriptgenerator/src/python/frameworks.go#L102

I agree that it's useful to document the Oryx flask detection somewhere. FYI @bobtabor-msft who works on some of the relevant documentation.

@pamelafox
Copy link
Contributor

Actually, it is mentioned here:
https://learn.microsoft.com/en-us/azure/app-service/quickstart-python?tabs=flask%2Cwindows%2Cazure-cli%2Cazure-cli-deploy%2Cdeploy-instructions-azportal%2Cterminal-bash%2Cdeploy-instructions-zip-azcli#configure-startup-script

with a link to the article that goes into even more details:
https://learn.microsoft.com/en-us/azure/app-service/configure-language-python#flask-app

Is there a way the docs can be improved @filiptrivan ?

@filiptrivan
Copy link
Author

filiptrivan commented Mar 27, 2025

Thanks for asking my opinion.

I deployed app through VS Code, so maybe some of my opinions are irrelevant.

I would like to have everything in one place, not to go on other link and scroll through whole page to find what I need (didn't even know what I need when I deployed for the first time).

When I realized something is wrong, I entered the sample repository and compared the differences, I assumed that the name was important, and it turned out that it was.

I don't even like that part at all with assuming how the end user named the file, I think you should only stick to manual script, but that's another subject (I made a pull request to add the main.py name to assumed names).

Suggestions:

  1. I would put note before deploying the app with VS code, maybe something like this, short and clear:
    Image

  2. I would focus the entire documentation more on users who already have their application and want to deploy it. It seems to me that there are many more such users than those who, out of curiosity, clone your sample repository and try it out.

  3. Also I noted one more possible improvement in other issue: Getting a 404 for GET /robots933456.txt #71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants