microsoft / vscode-dapr

A Visual Studio Code extension for Dapr development
Other
57 stars 18 forks source link

How to register State or Secret Store? #128

Open andreatosato opened 3 years ago

andreatosato commented 3 years ago

I want to debug sample that use this code in controller:

await daprClient.PublishEventAsync("Calculator", "AddOperation", currentOperation);

Error:

Grpc.Core.RpcException: Status(StatusCode="Unknown", Detail="ERR_PUBSUB_NOT_FOUND")

How can I add redis to debug? How can I add secret component?

philliphoff commented 3 years ago

@andreatosato Which version of the Dapr runtime and Dapr extension are you using? Are you able to otherwise use Dapr in conjunction with VS Code? Is there a small repro project you could provide to demonstrate the issue? My first thought would be that it's just a configuration issue (e.g. not having a state store definition in the components directory, or not pointing the Dapr runtime to the right components directory) but I would need more information to know for sure.

andreatosato commented 3 years ago

Hi @philliphoff, This is my sample repo I need to set my store in add folder. Where I can set YAML file? How can VS Code read this? I have not found sample in VS Code extension. Must I set root directory with all YAML components + YAML microservices? VS Code run all automatically? I want to debug on K8S local cluster. Thanks a lot!

andreatosato commented 3 years ago

Hi @philliphoff, I add this files without result.

andreatosato commented 3 years ago

Hi @philliphoff, Do you need more information? Thanks a lot

philliphoff commented 3 years ago

I'm having some difficulty in getting the blazorclient project running in the debugger (independently from Dapr) on my Mac, either trying to use netstandard2.1 or net5.0, so I can't (yet) provide clear guidance to debug in the way you want.

That said, as there are a number of components to this project, to debug with Dapr there are going to be a number of general steps that you need to do:

  1. Create build tasks for each project you wish to debug in VS Code.
  2. Create launch configurations for each project you wish to debug in VS Code, with preLaunchTask properties that correspond to the build tasks created in the earlier step.
  3. Add Dapr support for each launch configuration--the command should prompt for the task to augment, which should then also create the Dapr up/down tasks for each configuration.
  4. Ensure you have a proper components folder for each service, either individual to each service or one single application-wide folder if the application intends to share Dapr components, with properly configured YAML for each component (e.g. the Redis store)--note that Dapr will be running locally so the component may be configured slightly differently than when deployed to k8s.
andreatosato commented 3 years ago

I can host blazor on nginx in container, i think that this approch work. Do you have some repo sample that I can use for guideline? Thanks a lot