A Visual Studio Code extension for Dapr development
Перейти к файлу
Phillip Hoff 5b860c3e9c
Resolve component scaffolding and configuration issues (#329)
* Support resourcesPath[s] in dapr task.

Signed-off-by: Phillip Hoff <phillip@orst.edu>

* Remove zipkin component scaffolding.

Signed-off-by: Phillip Hoff <phillip@orst.edu>

* Allow variable substitution in Dapr tasks.

Signed-off-by: Phillip Hoff <phillip@orst.edu>

---------

Signed-off-by: Phillip Hoff <phillip@orst.edu>
2024-05-30 12:47:54 -07:00
.azure-pipelines Remove former pipeline. (#325) 2024-03-27 10:52:36 -07:00
.github/workflows Add GH PR pipeline. (#324) 2024-03-27 10:09:33 -07:00
.vscode Updates to dependencies (#298) 2023-06-12 10:16:27 -07:00
assets Resolve component scaffolding and configuration issues (#329) 2024-05-30 12:47:54 -07:00
i18n/jpn Continuing Dashboard Issue #159 (#190) 2021-08-05 13:33:11 -05:00
src Resolve component scaffolding and configuration issues (#329) 2024-05-30 12:47:54 -07:00
.eslintignore Bundles extension code (#57) 2020-03-06 10:00:20 -08:00
.eslintrc.js Adds ability to browse to Dapr application entrypoint. (#287) 2023-02-16 13:59:45 -08:00
.gitignore Bundles extension code (#57) 2020-03-06 10:00:20 -08:00
.nvmrc Update 1ES pipeline Node.js version (#323) 2024-03-27 09:36:50 -07:00
.vscodeignore Resolve localization issues (#108) 2020-08-27 09:59:35 -07:00
CHANGELOG.md Update problem matcher to accommodate 1.12 changes. (#310) 2023-10-17 08:29:37 -07:00
CONTRIBUTING.md Updates to docs based on corporate governance requirements (#10) 2020-02-07 16:01:55 -08:00
LICENSE.txt Updates to docs based on corporate governance requirements (#10) 2020-02-07 16:01:55 -08:00
NOTICE.html Prep for 0.8.0 release. (#308) 2023-10-03 11:22:47 -07:00
PRIVACY Updates to docs based on corporate governance requirements (#10) 2020-02-07 16:01:55 -08:00
README.md Remove former pipeline. (#325) 2024-03-27 10:52:36 -07:00
SECURITY.md Use latest version of SECURITY.md 2020-04-01 12:05:07 -04:00
main.js Start Dapr dashboard using random port (#278) 2023-02-08 09:58:20 -08:00
package-lock.json Update deps. (#328) 2024-05-24 11:12:58 -07:00
package.json Update deps. (#328) 2024-05-24 11:12:58 -07:00
package.nls.json Support passing environment variables to dapr cli (#327) 2024-04-18 09:34:02 -07:00
tsconfig.json Add support for upcoming Dapr "run file" option (#267) 2023-01-30 13:04:15 -08:00
webpack.config.ts Add support for upcoming Dapr "run file" option (#267) 2023-01-30 13:04:15 -08:00

README.md

Dapr for Visual Studio Code (Preview)

Marketplace Version Marketplace Installs Build Status

The Dapr extension makes it easy to setup debugging of applications within the Dapr environment as well as interact with applications via the Dapr runtime.

Prerequisites

Platforms

Supported platforms:

  • MacOS
  • Linux
  • Windows

Dapr 1.12 or later is required to use Dapr "Run Files" on Windows (outside of WSL).

Docker

Local development with Dapr requires a running instance of Docker; follow the Docker guide to installing Docker Desktop for your platform.

Dapr CLI and Runtime

Follow the Dapr guide to install the Dapr CLI for your platform and initialize the Dapr runtime.

This extension requires:

  • Dapr CLI version 1.10.0 or later
  • Dapr Runtime version 1.10.0 or later

Visual Studio Code

Follow the VS Code guide for installing VS Code for your platform.

This extension requires Visual Studio Code version 1.82.0 or later.

Feature Overview

Dapr Run File Support

Dapr 1.10 enables starting multiple Dapr applications through the use of a "run file", and the Dapr extension allows you to start the "run" directly from the File Explorer.

Start Run From Context Menu

The Dapr extension also allows you to start multiple Dapr applications through a single dapr task by just referencing the run file.

Sample tasks.json:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "dapr",
            "type": "dapr",
            "runFile": "./dapr.yaml"
        }
    ]
}

Run File Editing Assistence

When working with Dapr run files, the extension provides you with basic schema prompts and validation:

Dapr YAML Editing

Dapr Application Debugging

Dapr CLI 1.10 now tracks the application started via dapr run, which enables the Dapr extension to attach the debugger to running instances, whether started inside or outside of VS Code, directly from the Dapr applications view.

The debugger can be attached to individual applications, or to all applications in a run.

Attach to Application

Attach to Run

The Dapr extension also enables "F5" debugging of Dapr applications through a new custom debug launch configuration, which will automatically start and attach to the applications. Individual applications can be included or excluded from the set of applications the debugger attaches to.

Sample launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Dapr",
            "request": "launch",
            "type": "dapr",
            "runFile": "${workspaceFolder}/dapr.yaml",
            "includeApps": ["csharp-subscriber", "node-subscriber"],
            "preLaunchTask": "dapr"
        }
    ]
}

View Dapr Logs

When using Dapr run files, Dapr redirects the application and Dapr sidecar logs to application-specific locations (rather than writing them to the console). The Dapr extension enables you to open these logs directly from the Dapr applications view.

View Logs

Scaffold Dapr task, launch, and component assets

While extensions for Visual Studio Code make it easy to debug applications for a variety of platforms (like .NET Core, Node.js, Python, etc.), coordinating the debugger with the Dapr runtime can be tricky. The Dapr extension helps scaffold VS Code tasks, augments debug launch configurations, and (optionally) generates the Dapr component assets needed to debug your application within the Dapr environment.

Scaffold Dapr Tasks

View running Dapr applications

The Dapr extension adds a new tab which shows locally-running Dapr applications and allows quickly invoking application methods or publishing events.

Dapr Tab

Invoke Dapr application methods

When your application is running, you can quickly invoke its GET/POST methods without using a command line or switching to another HTTP request tool, including specifying an optional payload for POST methods.

Invoke GET

Invoke POST

Publish events to Dapr applications

You can also use the extension to directly publish events to running applications, specifying both the topic and an optional payload.

Publish Message

Stop Dapr applications

The Dapr extension allows you to directly stop locally-running applications without using the command line.

Stop Application

Telemetry

Data Collection

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft's privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.

Disabling Telemetry

If you dont wish to send usage data to Microsoft, you can set the telemetry.enableTelemetry setting to false. Learn more in our FAQ.

Microsoft Open Source Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct.

License

MIT