I have an Azure webapp that runs streamlit.
It connects to SQL, does some processing, and generates a ppt deck
with col1:
result = st.button("Generate entire Summary deck")
if result:
t1 = pd.Timestamp.now()
st.write(f'Started at {str(pd.Timestamp.now().time())}')
subprocess.run(["Rscript", "summary_fcn.R", quarter])
prs = summary_fcn.create_summary_ppt(quarter)
# save the output into binary form
binary_summary = BytesIO()
prs.save(binary_summary)
st.write(f'generated in {str(pd.Timestamp.now()-t1)}')
with col2:
st.download_button(label = 'Download Summary',
data = binary_summary.getvalue(),
file_name = 'Summary_'+ quarter + '_' + str(pd.Timestamp.now())[2:-7].replace('-','').replace(' ','_').replace(':','') + '.pptx')
It used to work perfectly, but then as of yesterday, it has consistently failed.
i have been searching to try and find potential causes with no success. Can anyone offer any possible reasons this might happen?
I frequently see
when I try to download.
does the accompanying address have any implication:
62fd0f8221f7c5b0fc01e5f7815afafcf3a0065950bf596d3a8a1451.bin?title=app%20·%20Streamlit
2
Answers
Thanks for the suggestion @siddhesh Desai, but after playing around with the Portal, I found one suggestion from MSFT caused it to break down (putting the app on multiple instances). I removed the multiple instances and it worked ok
MSFT suggested goto 3, I changed it back and it worked
I tried the below code to run the Streamlit app locally and it is running in the browser like below:-
Make sure you add the required modules in your requirements.txt file like below:-
For streamlit to work you need to create your Web app above B1 SKU.
I deployed the above code in Azure Web app like below:-
I tried accessing the Azure web app link after deployment and it gave me an error, I added the below command in my Azure Web app startup command configuration:-
Select Python version 3.10 as a minor version for Streamlit to run. Selected HTTPS Only to Off like below:-
Even when Https is set to off, You can browse your website using HTTPS protocol.
Output:-
In order to resolve the 404 error while downloading the PPT file, Check Diagnose and solve problem tab of your Azure Web app Refer below:-
Check the log stream for the error code and its resolution like below:-
In order to resolve the 404 error while downloading your PPT Deck from Streamlit app in Azure check if:-
You’re using Incomplete or wrong URL: The file’s URL may be problematic. Ensure that the URL contains the complete file path, including any required subdirectories.
If you’re Unable to open file: It’s possible that the file has been moved or deleted, or that the filename is misspelt. Verify that the file is still there in the required location and that its name corresponds to the one on the download button. And the function to call the file is properly coded.
Try downloading the file in another browser InPrivate window. Verify if the URL to access the file is correct. Restart your web app and try the download operation again.