RStudio Connect deployment with environment variables

Hi there,

This is more a feature request than a question, because I am quite sure there is no workaround.

Whenever I try to deploy a Rmarkdown document with source that has environment variables as dependencies (say, an API key that I don't want exposed in the code), I have to first publish it without the lines referring/using the variable in question, so the deployment won't fail, and then republish/rerun after I added the particular variable in the content (using the page).

I wonder if there be a way to set the environment variables when one deploys the content. Note that the same situation happens regardless how one deploys: via the button in RStudio, via "deploy from git" or through the API. It is a bit annoying to be forced to deploy/rerun twice because of that.

In addition, I could use the same logic to the other content parameters, such as the "Run As" user or the content permissions. I am not sure that one can change on deployment (?), but that would be a fantastic addition to this very useful service.


Hi @joseluizferreira,

Thanks for your feedback! This is a known limitation in the product, and I will be happy to record your feedback on this topic.

One thing that could make your life slightly easier -- I usually just deploy with the Environment Vars in the code and allow it to fail. Then all I have to do to fix it is add the Environment Vars for it to work, rather than both add the vars and re-deploy the code.

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