Secret for rsconnect setAccountInfo()?

I'm trying to programatically deploy a project in RstudioConnect via rsconnect::deployApp() but it complains that:

Error: You must register an account using setAccountInfo prior to proceeding

Fine, I set up the account:

  name = 'myname',
  token = '',
  secret = ''

But I do not know where to get the secret. For the token, I found out that running rsconnect::accountInfo(name = 'myname') returns a list that includes my token, but have no clue of where can I find the secret string. Any ideas?

When deploying from RStudio with the Publishing button everything's fine.

1 Like

Hello Xavier!

For programmatic deployment using rsconnect it is best to use an API-key and connect using rsconnect::connectApiUser(), c.f. From R - RStudio Connect: User Guide.


Thanks, I successfully registered my api key with rsconnect::connectApiUser():

The account 'myname' is already registered; attempting to reconnect it.
Account registered successfully: myname

But if I try to deploy again with rsconnect::deployApp() it keeps complaining:

Error: You must register an account using setAccountInfo prior to proceeding.

OK, I just found out why. When deploying with rsconnect::deployApp I should not pass the server and account params. Now it works!


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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.