@世霖 趙 , From your webapp URL
https://practice-linebot-2024.azurewebsites.net/ , I see that it's displaying default app (screenshot below).
The default app appears because you either haven't deployed your app code to App Service, or App Service failed to find your app code and ran the default app instead.
If the App Service doesn't find a custom command, ( your Flask app), then it runs a default read-only app, located in the opt/defaultsite folder
Typically, the error message you received indicates that the LINE platform is not able to communicate with your Flask web app running on Azure. The 405 Method Not Allowed error suggests that the LINE platform is sending an HTTP request to your web app using an HTTP method that is not supported by your app.
To isolate, you can first check the functionality of your webapp locally if it works fine as expected.
To isolate the issue with default app being displayed, kindly try the following steps:
- Use SSH to connect directly to the App Service container and verify that your files exist under site/wwwroot. If your files don't exist, use the following steps:
- Create an app setting named
SCM_DO_BUILD_DURING_DEPLOYMENT
with the value of 1, redeploy your code, wait a few minutes, then try to access the app again. For more information on creating app settings, see Configure an App Service app in the Azure portal. - Review your deployment process, check the deployment logs, correct any errors, and redeploy the app.
- Create an app setting named
- If your files exist, then App Service wasn't able to identify your specific startup file. Check that your app is structured as App Service expects for Flask, or use a custom startup command.
- Check that your Flask app is configured to listen on the correct port. You can check the port number by looking at the
PORT
environment variable in your Azure app settings.
Checkout this doc for more info: Configure a Linux Python app for Azure App Service