vault icon indicating copy to clipboard operation
vault copied to clipboard

Windows: When asked to set the VAULT_ADDR env var, use set instead of export

Open NickMRamirez opened this issue 11 years ago • 8 comments

When firing up Vault for the first time in Dev mode via:

vault server -dev

It instructs me to copy and run the following command:

The only step you need to take is to set the following
environment variables:

export VAULT_ADDR='http://127.0.0.1:8200'

However, the Windows shell command to store an environment variable is set instead of export. Running the suggested export command gives the following error:

'export' is not recognized as an internal or external command,
operable program or batch file.

Could the message say instead the following?

The only step you need to take is to set the following
environment variables:

set VAULT_ADDR=http://127.0.0.1:8200

The single quotes also aren't needed, since if they're included, the vault status command fails with the following error:

Error checking seal status: Get /v1/sys/seal-status: unsupported protocol scheme ""

But, without the single quotes, it works and I get:

Sealed: false
Key Shares: 1
Key Threshold: 1
Unseal Progress: 0

High-Availability Enabled: false

NickMRamirez avatar Oct 16 '15 18:10 NickMRamirez

Fixed by @voutasaurus -- thanks!

jefferai avatar Oct 23 '15 13:10 jefferai

This page says the same: https://www.vaultproject.io/intro/getting-started/dev-server.html

Can you check it?

lacivert avatar Aug 23 '16 13:08 lacivert

@lacivert That page has example output. The output from a Vault binary run on Windows will be correct.

jefferai avatar Aug 23 '16 13:08 jefferai

@jefferai Sorry, I was talking about "export" for Windows. There is no "export" command for Windows, so the page should say set VAULT_ADDR=http://127.0.0.1:8200 for win machines instead of

Copy and run the export VAULT_ADDR ... command from your terminal output. This will configure the Vault client to talk to our dev server.

lacivert avatar Aug 24 '16 08:08 lacivert

When you actually run a dev server on Windows it will show set in the command you can copy and paste.

jefferai avatar Aug 24 '16 11:08 jefferai

Consider adding guidance as to how to set this in PowerShell i.e. $env:VAULT_ADDR = "..." as that is the new defacto CLI?

RAGNOARAKNOS avatar Sep 29 '16 14:09 RAGNOARAKNOS

@RAGNOARAKNOS Vault only looks for the underlying OS and not the shell on which it is being run.

vishalnayak avatar Sep 29 '16 15:09 vishalnayak

@vishalnayak I'm aware of that, it just seems remise for the on screen guidance to suggest something that is increasingly likely not to work. The powershell setting of env vars is more common for the modern windows sysadmin

RAGNOARAKNOS avatar Sep 29 '16 22:09 RAGNOARAKNOS