Skip to content

Instantly share code, notes, and snippets.

Microsoft.Hosting.Lifetime: Information: Now listening on: http://127.0.0.1:5300
info: Microsoft.Hosting.Lifetime[0]
Now listening on: http://127.0.0.1:5300
Microsoft.Hosting.Lifetime: Information: Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Development
Microsoft.Hosting.Lifetime: Information: Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
[HttpPost]
[Route("/saveWeatherState")]
public async Task<IActionResult> Post([FromBody] WeatherChange weatherChange)
{
try
{
await _daprClient.SaveStateAsync("mongo", "admin", weatherChange);
}
catch (Exception e)
public async Task<IActionResult> Post([FromBody] WeatherChange weatherChange)
{
try
{
await _daprClient.SaveStateAsync("mongostatestore", "weather", weatherChange);
}
catch (Exception e)
{
return BadRequest();
public async Task<IActionResult> Post([FromBody] WeatherChange weatherChange)
{
try
{
await _daprClient.SaveStateAsync("mongostatestore", "weather", weatherChange);
}
catch (Exception e)
{
return BadRequest();
DEBU[0000] found component. name: mongo, type: state.mongodb/v1 app_id=savestate-service instance=Kshitijs-MacBook-Pro.local scope=dapr.runtime type=log ver=1.2.2
DEBU[0000] loading component. name: envvar-secret-store, type: secretstores.local.env/v1 app_id=savestate-service instance=Kshitijs-MacBook-Pro.local scope=dapr.runtime type=log ver=1.2.2
INFO[0000] component loaded. name: envvar-secret-store, type: secretstores.local.env/v1 app_id=savestate-service instance=Kshitijs-MacBook-Pro.local scope=dapr.runtime type=log ver=1.2.2
DEBU[0000] loading component. name: mongo, type: state.mongodb/v1 app_id=savestate-service instance=Kshitijs-MacBook-Pro.local scope=dapr.runtime type=log ver=1.2.2
INFO[0000] waiting for all outstanding components to be processed app_id=savestate-service instance=Kshitijs-MacBook-Pro.local scope=dapr.runtime type=log ver=1.2.2
INFO[0000] component loaded. name: mongo, type: state.mongodb/v1 app_id=savestate-service instance=Kshitijs-MacBook-Pro.local scope=dapr.runtime type=
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: mongo
spec:
type: state.mongodb
version: v1
metadata:
- name: host
secretKeyRef:
ℹ️ Starting Dapr with id savestate-service. HTTP Port: 5480. gRPC Port: 5401
INFO[0000] starting Dapr Runtime -- version 1.2.2 -- commit 8aabc2c app_id=savestate-service instance=Kshitijs-MacBook-Pro.local scope=dapr.runtime type=log ver=1.2.2
INFO[0000] log level set to: debug app_id=savestate-service instance=Kshitijs-MacBook-Pro.local scope=dapr.runtime type=log ver=1.2.2
INFO[0000] metrics server started on :54815/ app_id=savestate-service instance=Kshitijs-MacBook-Pro.local scope=dapr.metrics type=log ver=1.2.2
INFO[0000] standalone mode configured app_id=savestate-service instance=Kshitijs-MacBook-Pro.local scope=dapr.runtime type=log ver=1.2.2
INFO[0000] app id: savestate-service app_id=savestate-service instance=Kshitijs-MacBook-Pro.local scope=dapr.runtime type=log ver=1.2.2
INFO[0000] mTLS is disabled. Skipping certificate request and tls validation app_id=savestate-service instance=Kshitijs-MacBook-Pro.local scope=dapr.runt
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: envvar-secret-store
namespace: default
spec:
type: secretstores.local.env
version: v1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: mongo
spec:
type: state.mongodb
version: v1
metadata:
- name: host
secretKeyRef:
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: mongo
spec:
type: state.mongodb
version: v1
metadata:
- name: host
secretKeyRef: