Example project for reading/creating configuration data which will be automatically reloaded on change.
Using Tye to run services and manage their service discovery, using Microsoft.Tye.Extensions.Configuration
.
dotnet tool install -g Microsoft.Tye --version "0.11.0-alpha.22111.1"
- Start the file watching build service.
tye run --watch
- Navigate to http://localhost:8000.
- Open the http backend and navigate to its Swagger UI.
- Run the following.
docker-compose up -d
- Access the API via http://localhost:5000/swagger
- Option 1: Navigate to the Swagger UI and
POST
aDefaultConfiguration
value to the Vault through theDefaultConfiguration
endpoint. - Option 2: Create a configuration value at
"secret/backend/DefaultConfiguration/SecretValue": "42069"
using the Vault CLI or the Vault UI (with token password:root
). GET
and/orPOST
data using the endpoints in theDefaultConfigurationController
orConfigurationController
. Also, watch thebackend
log theDefaultConfiguration
value using theOptionsMonitorLogger
with itsIOptionsMonitor
.