Windows: When asked to set the VAULT_ADDR env var, use set instead of export
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
Fixed by @voutasaurus -- thanks!
This page says the same: https://www.vaultproject.io/intro/getting-started/dev-server.html
Can you check it?
@lacivert That page has example output. The output from a Vault binary run on Windows will be correct.
@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.
When you actually run a dev server on Windows it will show set in the command you can copy and paste.
Consider adding guidance as to how to set this in PowerShell i.e. $env:VAULT_ADDR = "..." as that is the new defacto CLI?
@RAGNOARAKNOS Vault only looks for the underlying OS and not the shell on which it is being run.
@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