Add secrets to your Streamlit apps

I am looking for a way to set secrets in an app I deploy to an Azure server, i.e. the secrets should be accessible for both local development and the production server. I use the Azure Key Vault. Is there a way to set the Streamlit secrets without creating a file in the process (which would decrease security)? So far I have found this:

from streamlit.runtime.secrets import secrets_singleton
secrets_singleton._maybe_set_environment_variable("name", "value")

Not sure if this is the intended use, since you access protected attributes.