Setting environment variable GOOGLE_APPLICATION_CREDENTIALS

How can I set GOOGLE_APPLICATION_CREDENTIALS env variable in my deployment. I have already stored it in secrets toml but this needs to be constantly up in env variable

Assuming I understand correctly, you already have the file /.streamlit/secrets.toml in your project (secrets.toml file in .streamlit folder)

If so, to access your env var, you just need to do this in your code:

st.secrets["GOOGLE_APPLICATION_CREDENTIALS"]

For example, if you wanted to set another variable to the secret, you can do:

new_var = st.secrets["GOOGLE_APPLICATION_CREDENTIALS"]