I am trying to connect to BigQuery I have the service account json, but when I copy and past the values in the secret it gave me errors later when I deploy the app, is there a documentation how to do that
I checked in with our team and they know that we are a bit light on examples for this! They are actually making up an app example for just this application of secrets (connecting to BigQuery) and that will be ready soon.
In the root of your Streamlit app, create a file .streamlit/secrets.toml
That would mean that this file with the secrets ends up in the public github repo?
Unless you exclude it in the .gitignore - but then it has no use for streamlit sharing anymore.
I’m confused - or did I miss something?
@Franky1 Oh yes, this step wasn’t very clear! You have to put the secrets.toml file into .gitignore, so it isn’t available on Github. Then you add the same file content to your app secrets on the Streamlit Sharing dashboard. That’s how the deployed app knows the secrets. I just updated the document to make this step a bit more obvious. Let me know if this is better!
However, I am still missing the clear information that the file .streamlit/secrets.toml is needed for the local execution of Streamlit to be read by the function st.secrets and on streamlit sharing this file is replaced by the content entered in the secrets form.
This becomes indirectly clear in the course of the article, but I think the basic principle should be explained right at the beginning.