I am trying to build a data app using streamlit,azureopenai & Snowflake but keep on getting error "'st.secrets has no key "OPENAI_API_KEY". Did you forget to add it to secrets.toml or the app settings on Streamlit Cloud? More info: https://docs.streamlit

Hi,
I am trying to Build a data app using directions available at the

but has been getting the error . have tried multiple options but no luck yet .
I have hosted the streamlit open source in our AWS premises and trying to connect to Snowflake & Azure OPEN AI . I am able to connect to the Snowflake instance with credentials in the .toml file. but getting error while connecting to the Azure OPEN AI . The shared you tube video is based on the open ai so i am trying to tweak the code base slightly as per azure open ai but have no luck yet .
Error message :
‘st.secrets has no key “OPENAI_API_KEY”. Did you forget to add it to secrets.toml or the app settings on Streamlit Cloud? More info: Secrets management - Streamlit Docs
Can someone guide me through this so that i can follow the shared you tube video and able to create the data apps.

Hi @kishore_sharma,

Thanks for posting!

Can you share how your secrets are structured in the secrets.toml file? Mask your secrets or use dummy placeholders so we can troubleshoot the issue for you.

Thanks for the responses .
we are able to fix it now .
with Azure open AI we had to try some tweaks . finally using the respective value for engine helped .

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.