Hi,
I have successfully executed the Python app using Visual Studio Code on my laptop.
I am importing following in Python App.
from types import CodeType
from flask import Flask, request
from fyers_api import accessToken
from fyers_api import fyersModel
from azure.data.tables import TableServiceClient
from azure.data.tables import TableClient
import requests
Code Repository is on Azure DevOps and I have built the Pipeline to push the Build on Linux App Service Web Application.
It gives following Error :
:( Application Error
If you are the application administrator, you can access the diagnostic resources.
I got following log in the App Service Log. I need help to fix this.
/home/LogFiles/2021_04_01_lw0sdlwk000005_default_docker.log (https://rockettokensaverapp.scm.azurewebsites.net/api/vfs/LogFiles/2021_04_01_lw0sdlwk000005_default_docker.log)
2021-04-01T15:18:48.321394582Z Error: While importing "app", an ImportError was raised:
2021-04-01T15:18:48.321410882Z
2021-04-01T15:18:48.321415782Z Traceback (most recent call last):
2021-04-01T15:18:48.321433682Z File "/opt/python/3.8.6/lib/python3.8/site-packages/flask/cli.py", line 240, in locate_app
2021-04-01T15:18:48.321489182Z import(module_name)
2021-04-01T15:18:48.321495482Z File "/home/site/wwwroot/app.py", line 4, in <module>
2021-04-01T15:18:48.321499682Z from fyers_api import accessToken
2021-04-01T15:18:48.321503282Z ModuleNotFoundError: No module named 'fyers_api'
2021-04-01T15:18:48.321506982Z
/home/LogFiles/2021_04_01_lw0sdlwk000005_docker.log (https://rockettokensaverapp.scm.azurewebsites.net/api/vfs/LogFiles/2021_04_01_lw0sdlwk000005_docker.log)
2021-04-01T15:18:36.243Z INFO - Starting container for site
2021-04-01T15:18:36.243Z INFO - docker run -d -p 9262:8000 --name rockettokensaverapp_0_1e510670 -e WEBSITE_SITE_NAME=RocketTokenSaverApp -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=rockettokensaverapp.azurewebsites.net -e WEBSITE_INSTANCE_ID=a49e0f8ab240b39b4907e637cfb2809cc16b82d0b7fafe7739b53cea268e3195 appsvc/python:3.8_20201229.1
2021-04-01T15:18:36.243Z INFO - Logging is not enabled for this container.
Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here.
2021-04-01T15:18:39.289Z INFO - Initiating warmup request to container rockettokensaverapp_0_1e510670 for site rockettokensaverapp
2021-04-01T15:18:49.520Z ERROR - Container rockettokensaverapp_0_1e510670 for site rockettokensaverapp has exited, failing site start
2021-04-01T15:18:49.526Z ERROR - Container rockettokensaverapp_0_1e510670 didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging.
2021-04-01T15:18:49.653Z INFO - Stopping site rockettokensaverapp because it failed during startup.
/home/LogFiles/webssh/pm2.log (https://rockettokensaverapp.scm.azurewebsites.net/api/vfs/LogFiles/webssh/pm2.log)
Ending Log Tail of existing logs ---