1

I'm trying to get started with Sidekick for Dapr, and am having trouble telling Sidekick where the dapr components are.

By default it's going to %USERPROFILE%.dapr\components, but I'd rather it go to a folder local to the solution.

Looking at the code it appears that adding the following to the appsettings.json should work, but it isn't picked up.

 "DaprSidekick": {
    "RuntimeDirectory": "dapr",
    "ComponentsDirectory": "C:\\Dev\\DaprPOC\\components",
  }

However the components folder invariably becomes %USERPROFILE%\.dapr\components

Any help on how I specify the component locations with Sidekick?

Binary Worrier
  • 50,774
  • 20
  • 136
  • 184

2 Answers2

0

When you set "RuntimeDirectory": "dapr" Sidekick will automatically look for component files in the dapr/components subdirectory in your solution. Try removing the ComponentsDirectory entry so it returns to defaults, and try a directory structure like this:

|-- MyProject
|   |-- MyProject.csproj
|   |-- dapr
|   |   |-- config.yaml
|   |   |-- components
|   |   |   |-- my_component.yaml

The Dapr Sidecar should then load my_component.yaml.

0

You can also manually add the components directory in the dependency injection:

   services.AddDaprSidekick(configuration, p => p.Sidecar = 
        new DaprSidecarOptions() { AppId = "daprservice", ComponentsDirectory = "C:\\Dev\\DaprPOC\\components" });
Kudos
  • 74
  • 5