To get your app to run __main__()
, you can set the startup parameter to the python module containing the function. For example, if your main sub is in main.py, then you will set gunicorn -bind=0.0.0.0 main:app
as the startup parameter for your app service.
You can read more about configuring the startup for your Python application on https://learn.microsoft.com/en-us/azure/app-service/configure-language-python#container-startup-process