Not able to run Python Code on Azure WebApp

ashxos
Dear Team,

Im deploying following simple code on Azure Linux WebApp.
The deployment happens successfully.
Once the webApp starts it gives enum32 Conflict error.
from flask import Flask
from kiteconnect import KiteConnect


app = Flask(__name__)
Zerodha_Access_Token= "XXXXXXXXXXXXXXXXXXXX"
Zerodha_API_KEY = "XXXXXXXXXXXXXXXXXXXXXXXXX"
kite = KiteConnect(api_key=Zerodha_API_KEY)
kite.set_access_token(Zerodha_Access_Token)

@app.route('/')
def index():
return "Welcome to the World"
Error :
2021-07-30T16:56:42.234523345Z Writing output script to '/opt/startup/startup.sh'
2021-07-30T16:56:42.933685964Z Using packages from virtual environment antenv located at /tmp/8d9495a3f25b603/antenv.
2021-07-30T16:56:42.934917894Z Updated PYTHONPATH to ':/tmp/8d9495a3f25b603/antenv/lib/python3.9/site-packages'
2021-07-30T16:56:43.041073524Z Traceback (most recent call last):
2021-07-30T16:56:43.041921445Z File "/opt/python/3.9.0/bin/gunicorn", line 3, in
2021-07-30T16:56:43.043043372Z import re
2021-07-30T16:56:43.048376305Z File "/opt/python/3.9.0/lib/python3.9/re.py", line 145, in
2021-07-30T16:56:43.049214825Z class RegexFlag(enum.IntFlag):
2021-07-30T16:56:43.050017345Z AttributeError: module 'enum' has no attribute 'IntFlag'
/home/LogFiles/2021_07_30_RD00155D63E5EE_docker.log (https://rocketzerodha.scm.azurewebsites.net/api/vfs/LogFiles/2021_07_30_RD00155D63E5EE_docker.log)
2021-07-30T16:56:34.135Z INFO - Digest: sha256:b6abc8b5355ff2fdd12826af94fc992b105f099ac09cc75b0fee73f2eab800be
2021-07-30T16:56:34.136Z INFO - Status: Image is up to date for 10.0.3.208:13209/appsvc/python:3.9_20210421.4
2021-07-30T16:56:34.140Z INFO - Pull Image successful, Time taken: 0 Minutes and 0 Seconds
2021-07-30T16:56:34.181Z INFO - Starting container for site
2021-07-30T16:56:34.182Z INFO - docker run -d -p 5165:8000 --name rocketzerodha_0_a01dd13f -e WEBSITE_SITE_NAME=RocketZerodha -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=rocketzerodha.azurewebsites.net -e WEBSITE_INSTANCE_ID=f8efa2d44f4f61144c8c03d4c5b5a5e933cd99e4fb3c36abf43f050b1eae54d5 -e HTTP_LOGGING_ENABLED=1 appsvc/python:3.9_20210421.4
2021-07-30T16:56:36.581Z INFO - Initiating warmup request to container rocketzerodha_0_a01dd13f for site rocketzerodha
2021-07-30T16:56:52.078Z ERROR - Container rocketzerodha_0_a01dd13f for site rocketzerodha has exited, failing site start
2021-07-30T16:56:52.093Z ERROR - Container rocketzerodha_0_a01dd13f didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging.
2021-07-30T16:56:52.103Z INFO - Stopping site rocketzerodha because it failed during startup.
/home/LogFiles/webssh/pm2.log (https://rocketzerodha.scm.azurewebsites.net/api/vfs/LogFiles/webssh/pm2.log)
Ending Log Tail of existing logs ---
Starting Live Log Stream ---
Sign In or Register to comment.