Learn to manage key/value pairs in HashiCorp Consul’s K/V store using the web UI, CLI, and HTTP API with practical examples.
In this hands-on tutorial, you’ll learn how to manage key/value pairs in HashiCorp Consul’s K/V store using three methods: the web UI, the CLI, and the HTTP API. We’ll cover adding, querying, and deleting entries, plus best practices for decoding API responses.
Use the consul kv put command to insert entries under the apps/eCommerce prefix.
Copy
Ask AI
# 1. Add the database hostconsul kv put apps/eCommerce/database_host customer_db# 2. Add the database nameconsul kv put apps/eCommerce/database billing# 3. Add the connection stringconsul kv put apps/eCommerce/connection_string 'Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;'
Each command will return a confirmation similar to:
Copy
Ask AI
Success! Data written to: apps/eCommerce/database_host