#Dapr with dotnet locally

1 messages · Page 1 of 1 (latest)

frigid tundra
#

Hi,
I'm facing a problem when I start my dotnet application with a secret store component thanks to the ressources-path argument. Locally, this secrets store is a simple json file with only one key for the moment.
Randomly, my application cannot connect to this secret store component at Startup. It's like if dapr component and dotnet application were launched in parallel and everything is working ONLY if dapr starts faster. Is there a way to make dotnet wait for dapr components to be fully loaded before starting ?

The command I run is as simple as :

dapr run --app-id my-app --resource-path ./Dapr -- dotnet run

Thanks in advance !

still ridge
#

Yes, an application cannot make use of components (such as a secret store) until the Dapr sidecar is healthy. The .NET SDK has a method, DaprClient.WaitForSidecarAsync() for that purposes. Note that there is also an extension that integrates Dapr secret stores with the ASP.NET IConfiguration component to make pulling secrets needed for application startup more seamless (which does this wait implicitly).