Error deploying echo-bot.py on Azure. didn’t respond to HTTP pings on port: 8000

I did all the suggested steps by this topic: Post Link, but didn’t work, I have ERROR – Container thoth-bot-v3_0_d27a0fdd didn’t respond to HTTP pings on port: 8000, failing site start.

when I deploy my bot to Azure:

2024-06-06T19:34:39.735441830Z    _____
2024-06-06T19:34:39.735465131Z   /  _   __________ _________   ____
2024-06-06T19:34:39.735468331Z  /  /_  \___   /  |  _  __ _/ __ 
2024-06-06T19:34:39.735470731Z /    |    /    /|  |  /|  | /  ___/
2024-06-06T19:34:39.735473131Z ____|__  /_____ ____/ |__|    ___  >
2024-06-06T19:34:39.735475731Z         /      /                  /
2024-06-06T19:34:39.735478331Z A P P   S E R V I C E   O N   L I N U X
2024-06-06T19:34:39.735480531Z
2024-06-06T19:34:39.735482531Z Documentation: http://aka.ms/webapp-linux
2024-06-06T19:34:39.735484731Z Python 3.11.8
2024-06-06T19:34:39.735486831Z Note: Any data outside '/home' is not persisted
2024-06-06T19:34:40.034292578Z Starting OpenBSD Secure Shell server: sshd.
2024-06-06T19:34:40.075455722Z Site's appCommandLine: python3 -m aiohttp.web -H 0.0.0.0 -P 8000 app:init_func
2024-06-06T19:34:40.076557937Z Launching oryx with: create-script -appPath /home/site/wwwroot -output /opt/startup/startup.sh -virtualEnvName antenv -defaultApp /opt/defaultsite -userStartupCommand 'python3 -m aiohttp.web -H 0.0.0.0 -P 8000 app:init_func'
2024-06-06T19:34:40.082944321Z Found build manifest file at '/home/site/wwwroot/oryx-manifest.toml'. Deserializing it...
2024-06-06T19:34:40.084363840Z Build Operation ID: 6d9eb3c9088eebeb
2024-06-06T19:34:40.085311153Z Oryx Version: 0.2.20240501.1, Commit: f83f88d3cfb8bb6d3e2765e1dcd218eb0814a095, ReleaseTagName: 20240501.1
2024-06-06T19:34:40.085931361Z Output is compressed. Extracting it...
2024-06-06T19:34:40.086769272Z Extracting '/home/site/wwwroot/output.tar.gz' to directory '/tmp/8dc865e6c80b48f'...
2024-06-06T19:34:41.722549884Z App path is set to '/tmp/8dc865e6c80b48f'
2024-06-06T19:34:42.653981392Z Writing output script to '/opt/startup/startup.sh'
2024-06-06T19:34:42.815919632Z Using packages from virtual environment antenv located at /tmp/8dc865e6c80b48f/antenv.
2024-06-06T19:34:42.815980333Z Updated PYTHONPATH to '/opt/startup/app_logs:/tmp/8dc865e6c80b48f/antenv/lib/python3.11/site-packages'
2024-06-06T19:34:42.974795731Z Traceback (most recent call last):
2024-06-06T19:34:42.974978333Z   File "<frozen runpy>", line 189, in _run_module_as_main
2024-06-06T19:34:42.975017634Z   File "<frozen runpy>", line 112, in _get_module_details
2024-06-06T19:34:42.975061935Z   File "/tmp/8dc865e6c80b48f/antenv/lib/python3.11/site-packages/aiohttp/__init__.py", line 6, in <module>
2024-06-06T19:34:42.975070735Z     from .client import (
2024-06-06T19:34:42.975075035Z   File "/tmp/8dc865e6c80b48f/antenv/lib/python3.11/site-packages/aiohttp/client.py", line 3, in <module>
2024-06-06T19:34:42.975329038Z     import asyncio
2024-06-06T19:34:42.975348038Z   File "/tmp/8dc865e6c80b48f/antenv/lib/python3.11/site-packages/asyncio/__init__.py", line 21, in <module>
2024-06-06T19:34:42.975374539Z     from .base_events import *
2024-06-06T19:34:42.975379039Z   File "/tmp/8dc865e6c80b48f/antenv/lib/python3.11/site-packages/asyncio/base_events.py", line 296
2024-06-06T19:34:42.975383439Z     future = tasks.async(future, loop=self)
2024-06-06T19:34:42.975387139Z                    ^^^^^
2024-06-06T19:34:42.975390639Z SyntaxError: invalid syntax
2024-06-06T19:34:38.754Z INFO  - 3.11_20240502.3.tuxprod Pulling from appsvc/python
2024-06-06T19:34:38.755Z INFO  -  Digest: sha256:e341fc301fd21d8148b043c59d05e94762f3f2a0f15ac5caafa1a2b96a622539
2024-06-06T19:34:38.755Z INFO  -  Status: Image is up to date for 10.1.0.6:13209/appsvc/python:3.11_20240502.3.tuxprod
2024-06-06T19:34:38.776Z INFO  - Pull Image successful, Time taken: 0 Seconds
2024-06-06T19:34:39.502Z INFO  - Starting container for site
2024-06-06T19:34:39.503Z INFO  - docker run -d --expose=8000 --name thoth-bot-v3_0_d27a0fdd -e WEBSITE_USE_DIAGNOSTIC_SERVER=false -e WEBSITE_SITE_NAME=thoth-bot-v3 -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=thoth-bot-v3.azurewebsites.net -e WEBSITE_INSTANCE_ID=5b782a15c8309d0e167d686cc302af1e9e12aa2731e32332f4e94060c07214ca appsvc/python:3.11_20240502.3.tuxprod python3 -m aiohttp.web -H 0.0.0.0 -P 8000 app:init_func
2024-06-06T19:34:39.504Z INFO  - Logging is not enabled for this container.Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here.
2024-06-06T19:34:39.989Z INFO  - Initiating warmup request to container thoth-bot-v3_0_d27a0fdd for site thoth-bot-v3
2024-06-06T19:34:43.228Z **ERROR - Container thoth-bot-v3_0_d27a0fdd for site thoth-bot-v3 has exited, failing site start
2024-06-06T19:34:43.231Z ERROR - Container thoth-bot-v3_0_d27a0fdd didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging.

This is the content of my requirements.txt:

aiohttp==3.9.3
aiosignal==1.3.1
asyncio==3.4.3
attrs==23.2.0
azure-core==1.30.1
botbuilder-core==4.15.0
botbuilder-integration-aiohttp==4.15.0
botbuilder-schema==4.15.0
botframework-connector==4.15.0
botframework-streaming==4.15.0
certifi==2024.6.2
cffi==1.16.0
charset-normalizer==3.3.2
cryptography==42.0.8
frozenlist==1.4.1
idna==3.7
isodate==0.6.1
jsonpickle==1.4.2
msal==1.28.0
msrest==0.7.1
multidict==6.0.5
oauthlib==3.2.2
pycparser==2.22
PyJWT==2.8.0
requests==2.32.3
requests-oauthlib==2.0.0
six==1.16.0
typing_extensions==4.12.1
urllib3==1.26.18
yarl==1.9.4
gunicorn==20.1.0

I added this code in my app.py file:

def init_func(argv):
    APP = web.Application(middlewares=[aiohttp_error_middleware])
    APP.router.add_post("/api/messages", messages)
    return APP

if __name__ == "__main__":
    APP = init_func(None)

try:
    web.run_app(APP, host="0.0.0.0", port=CONFIG.PORT)
except Exception as error:
    raise error

I ran this command in the VSCODE terminal to deploy to Azure:
az webapp deployment source config-zip --resource-group "resource-thoth-bot" --name "thoth-bot-v3" --src "app.zip"
I added this command to the Startup Command of the Azure application:
python3 -m aiohttp.web -H 0.0.0.0 -P 8000 app:init_func.

Can anyone help me resolve this problem? Did I forget some configuration?

Azure Config
Folder structure

New contributor

Wagner Barbosa Do Nascimento is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật