Please check the below setting as mention in below
Check Deployment Scripts: Ensure that your deployment process includes the .streamlit/secrets.toml
file. Sometimes, files starting with a dot (like .gitignore
, .env
) can be ignored by deployment scripts or version control systems. Verify that your deployment scripts or the Azure DevOps pipeline settings include this file.
Verify File Path: Ensure that the secrets.toml
file is located in the correct directory within your repository. It should be in a .streamlit
directory at the root of your repository.
Include File in Repository: If you're using Git, ensure that the .streamlit/secrets.toml
file is tracked by Git. You can check this by running git ls-files
to see if the file is included in the list of tracked files.
Check .gitignore: Make sure that the .streamlit/secrets.toml
file is not listed in your .gitignore
file. If it is, it won't be pushed to your repository and therefore won't be deployed to Azure.
Manual Upload: As a workaround, you can manually upload the secrets.toml
file to the correct path in your Azure App Service using FTP or through the Azure portal. While this is not ideal for automated deployments, it can be a temporary solution.
Environment Variables: If the secrets.toml
file contains sensitive information, consider using environment variables for deployment in Azure. You can set these variables in the Azure App Service configuration.
- Logging and Debugging: Add logging to your application to confirm the file paths it's trying to access. This can help you understand where your application is expecting the
secrets.toml
file to be.