🚀 DevOps & SRE Certification Program 📅 Starting: 1st of Every Month 🤝 +91 8409492687 🔍 Contact@DevOpsSchool.com

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Hashicorp Vault: Windows – Lab Manual – 1


# First we will install the Vault binary using Chocolatey.
# You'll need to run this from an elevated PowerShell prompt
# Download URL - https://developer.hashicorp.com/vault/downloads
choco install vault -y
# Now let's verify it installed successfully and is in the PATH
# environment variable
vault version
# Let's try out the Vault help command
vault -help
vault server -help
# Now we are going to start Vault in development mode
vault server -dev
# You will see Vault server launch and wait log actions to
# the current console window. Scroll up to find the unseal
# key and the root token. You're going to need the token
# Open a second console and save the token in a variable
# DO NOT USE VAULT_TOKEN for the variable name
# powershell
$root_token="ROOT_TOKEN_VALUE"
$root_token="hvs.6FYfExYuSSuESQYk6ku8uZLQ"
# command line
set root_token="ROOT_TOKEN_VALUE"
set root_token="hvs.6FYfExYuSSuESQYk6ku8uZLQ"
# Let's log into the Vault server using our root token
# and the Vault server address. The default launch
# of the development server is listening on the loopback
# address and port 8200
# commnad promt
vault login -address="http://127.0.0.1:8200" %root_token%
# powershell
vault login -address="http://127.0.0.1:8200" $root_token
# Adding the `--address` flag everytime is a drag. Let's
# use environment variable so the vault CLI knows where
# to contact the Vault server.
$env:VAULT_ADDR="http://127.0.0.1:8200"
# Cool, now let's run a command without the Vault server
# `--address` flag
vault status
# Let's start by opening the Vault UI and checking things out
# Grab that root token, b/c you'll need it
$root_token
# Now open a browser on http://127.0.0.1:8200/ui
# Fun! Now let's use Invoke-WebRequest to interact with the API using
# the root token.
$headers = @{
"X-Vault-Token" = $root_token
}
$resp = Invoke-WebRequest -Uri "$env:VAULT_ADDR/v1/sys/host-info" -UseBasicParsing -Headers $headers
echo "resp: " . $resp
Subscribe
Notify of
guest


0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.

0
Would love your thoughts, please comment.x
()
x