rstudio / rsconnect

Publish Shiny Applications, RMarkdown Documents, Jupyter Notebooks, Plumber APIs, and more
http://rstudio.github.io/rsconnect/
134 stars 82 forks source link

Setting environment variable does not work #1084

Closed mochenyang closed 5 months ago

mochenyang commented 5 months ago

I'm trying to deploy a shiny app to Shinyapps.io using rsconnect-python and the following command:

rsconnect deploy shiny path/to/my/app --name my-acount-name --title my-app-name --environment OPENAI_API_KEY='my key'

Here, path/to/my/app is the directory that contains (1) an app.py script that makes use of OPENAI_API_KEY to call GPT models and (2) a requirements.txt file containing the dependency. Locally, everything runs correctly. But when I push to Shinyapps.io, the app does not work with error message telling me that the OpenAI api key has not been set.

Any advice would be much appreciated!

aronatkins commented 5 months ago

This repository is tracking the rsconnect R package. The rsconnect-python Python package is in the https://github.com/posit-dev/rsconnect-python repository.

That said, shinyapps.io does not support environment variables.

Related issues: