EDIT: See Connecting to Control Room vault to learn how to connect your local development environment to Control Room vault.
(this was the way back in the day - see the above note for the new and more convenient way!)
The rpaframework release 9.2.0 contains script use-robocorp-vault, which can be used to set required environment variables to access Robocorp Vault secrets from development run.
IMPORTANT Please take care you don’t accidentally add file devdata/env.json into your Git repository! This script creates access token to the Robocorp Vault which is valid for 24 hours. You need to rerun the script to refresh token for next 24 hours (which is token’s max validity time).
Script has three commands:
- set, the main command which will set access account (with name DEV) which is used to communicate with Robocorp API. User is prompted for details like access credentials and workspace ID to set variables (including API token) into devdata/env.json.
- clear, this will delete access account which was set using command set
- list, this will list available workspace names and IDs if valid access account exists
Using script from command line with rcc
- enter command
rcc task shell
to open shell into environment - enter command
use-robocorp-vault set
and follow instructions - include devdata/env.json in a command
rcc run -e devdata/env.json
Using script from Robocorp Lab terminal
- from Lab menus
File->New->Terminal
- enter command
use-robocorp-vault set
and follow instructions - Lab uses devdata/env.json automatically if it exists
Using script from VSCode terminal
- from VSCode menus
View->Terminal
- enter command
use-robocorp-vault set
and follow instructions - Robocorp Code extension uses devdata/env.json automatically if it exists
Environment variables that need to be set (and are set by this script) when using Robocorp Vault are: RC_API_SECRET_HOST
, RC_API_SECRET_TOKEN
and RC_WORKSPACE_ID
Tip. Access Account
can be deleted with command: use-robocorp-vault clear
. NOTE. This will also delete associated access credential from the Robocorp Cloud.