In my shiny application, in global.R
I have defined an odbc
connection as follow :
con <- dbConnect(odbc(),
DSN = 'abc',
Database = 'xxx',
UID = rstudioapi::askForPassword("username"),
PWD = rstudioapi::askForPassword("password")
)
The app is working when I try it from RStudio IDE, but it is not when I deploy the app to the shiny server. The error is :
Error: RStudio not running
Execution halted
But if I change the odbc
connection to :
con <- dbConnect(odbc(),
DSN = 'abc',
Database = 'xxx',
UID = "myuser",
PWD ="mypass"
)
The app will work properly both in IDE and on shiny server. Any Idea how that could fix to avoid using the username / pass in the code ?