quickstarts/configuration/csharp/http
Phil Ngan 741a8f7ad9 Converted all projects to net8.0
Exception is batch because Swashbuckle does not support net8

Signed-off-by: Phil Ngan <phillip.ngan@gmail.com>
2024-02-18 16:12:57 +13:00
..
order-processor Converted all projects to net8.0 2024-02-18 16:12:57 +13:00
README.md Testing for orderid2 and subscriptionid, but not unsubscripe or terminate. sleep now can be 15. 2023-06-02 00:32:19 -07:00
makefile add csharp example 2022-11-10 00:49:21 +05:30

README.md

Dapr Configuration API

In this quickstart, you'll create a microservice which makes use of Dapr's Configuration API. Configuration items are key/value pairs containing configuration data such as app ids, partition keys, database names etc. The service gets configuration items from the configuration store and subscribes for configuration updates.

Visit this link for more information about Dapr and Configuration API.

Note: This example leverages HTTP requests only. If you are looking for the example using the Dapr Client SDK (recommended) click here.

This quickstart includes one service:

  • Dotnet service order-processor

Add configuration items to the config store

Prerequisite

  • Locally running redis container - a redis container named dapr_redis is automatically created when you run dapr init
  • Open a new terminal and set values for config items orderId1 and orderId2 by using the command below
docker exec dapr_redis redis-cli MSET orderId1 "101" orderId2 "102"

Run order-processor

  1. Open a new terminal and navigate to order-processor directory.
  2. Run the service app with Dapr.
cd ./order-processor
dapr run --app-id order-processor-http --resources-path ../../../components/ --app-port 7008 -- dotnet run --project .

(Optional) Update value of config items

  1. Keep the order-processor app running and open a separate terminal
  2. Change the values of orderId1 and orderId2 using the command below
  3. order-processor app gets the updated values of config items
docker exec dapr_redis redis-cli MSET orderId1 "103" orderId2 "104"