Hi @Nagesh Machara,
It seems like you’re running into an Application Error after deploying your Streamlit-based Python app on Azure Web App Service. Since it works fine locally, the issue likely lies with the deployment configuration.
- As Streamlit apps are normally run by a certain command, ensure your startup command within your Azure Web App settings resembles the following:
Swap out your_script.py with your actual Python script that runs your Streamlit application from the below command. The --server.port 8000 and --server.address 0.0.0.0 are necessary because Azure Web Apps listen on port 8000 by default and need the application to listen on all IP addresses.
streamlit run your_script.py --server.port 8000 --server.address 0.0.0.0
- Go to your Web App-Configuration-General Settings-Startup Command, paste the above command and save.
- As you mentioned you've already done Always On is Enabled, but double-check just in case: In the Azure Portal, navigate to your Web App-Configuration-General Settings-Always On-Set to On.
- Ensure your .zip deployment contains all necessary files in the right structure, sometimes the app fails if it can’t find the main Python file, so confirm the file paths are correct:
/app
|-- your_script.py
|-- requirements.txt
|-- any_other_files.sh
- Check that your requirements.txt has been processed properly. In the Kudu Console (Advanced Tools) of the Azure Web App, you can run this command manually to install:
pip install -r requirements.txt
- If that does not work, the verbose logs usually provide more information: In Azure Portal, navigate to your Web App-Log Stream. Also look at Kudu Console under Advanced Tools-Debug Console-CMD, access the logs directory and view the recent error messages.
- Sometimes, Streamlit will use port 8501 by default. Azure Web Apps require your app to be listening on port 8000, so ensure that your --server.port parameter is specified in the startup command (as indicated above).
Refer to the below documents:
Deploy a Python app to Azure App Service
Configure Python apps on Azure App Service
Kudu Console for Azure App Service
If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.