Using Robocorp Vault in local development run

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

  1. enter command rcc task shell to open shell into environment
  2. enter command use-robocorp-vault set and follow instructions
  3. include devdata/env.json in a command rcc run -e devdata/env.json

Using script from Robocorp Lab terminal

  1. from Lab menus File->New->Terminal
  2. enter command use-robocorp-vault set and follow instructions
  3. Lab uses devdata/env.json automatically if it exists

Using script from VSCode terminal

  1. from VSCode menus View->Terminal
  2. enter command use-robocorp-vault set and follow instructions
  3. 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.

10 Likes

Great Work !! :handshake:
It works fine…

Thanks @mika

1 Like