run CLI command reference

Detailed information on the run CLI command

Description

Run Dapr and (optionally) your application side by side. A full list comparing daprd arguments, CLI arguments, and Kubernetes annotations can be found here.

Supported platforms

Usage

  1. dapr run [flags] [command]

Flags

NameEnvironment VariableDefaultDescription
—app-id, -aAPP_IDThe id for your application, used for service discovery
—app-max-concurrencyunlimitedThe concurrency level of the application, otherwise is unlimited
—app-port, -pAPP_PORTThe port your application is listening on
—app-protocol, -PhttpThe protocol (gRPC or HTTP) Dapr uses to talk to the application. Valid values are: http or grpc
—app-sslfalseEnable https when Dapr invokes the application
—components-path, -dLinux & Mac: $HOME/.dapr/components, Windows: %USERPROFILE%.dapr\componentsThe path for components directory
—config, -cLinux & Mac: $HOME/.dapr/config.yaml, Windows: %USERPROFILE%.dapr\config.yamlDapr configuration file
—dapr-grpc-portDAPR_GRPC_PORT50001The gRPC port for Dapr to listen on
—dapr-http-portDAPR_HTTP_PORT3500The HTTP port for Dapr to listen on
—enable-profilingfalseEnable pprof profiling via an HTTP endpoint
—help, -hPrint this help message
—imageThe image to build the code in. Input is: repository/image
—log-levelinfoThe log verbosity. Valid values are: debug, info, warn, error, fatal, or panic
—enable-api-loggingfalseEnable the logging of all API calls from application to Dapr
—metrics-portDAPR_METRICS_PORT9090The port that Dapr sends its metrics information to
—profile-port7777The port for the profile server to listen on
—unix-domain-socket, -uPath to a unix domain socket dir mount. If specified, communication with the Dapr sidecar uses unix domain sockets for lower latency and greater throughput when compared to using TCP ports. Not available on Windows OS
—dapr-http-max-request-size4Max size of request body in MB.
—dapr-http-read-buffer-size4Max size of http header read buffer in KB. The default 4 KB. When sending bigger than default 4KB http headers, you should set this to a larger value, for example 16 (for 16KB).

Examples

  1. # Run a .NET application
  2. dapr run --app-id myapp --app-port 5000 -- dotnet run
  3. # Run a .Net application with unix domain sockets
  4. dapr run --app-id myapp --app-port 5000 --unix-domain-socket /tmp -- dotnet run
  5. # Run a Java application
  6. dapr run --app-id myapp -- java -jar myapp.jar
  7. # Run a NodeJs application that listens to port 3000
  8. dapr run --app-id myapp --app-port 3000 -- node myapp.js
  9. # Run a Python application
  10. dapr run --app-id myapp -- python myapp.py
  11. # Run sidecar only
  12. dapr run --app-id myapp
  13. # Run a gRPC application written in Go (listening on port 3000)
  14. dapr run --app-id myapp --app-port 5000 --app-protocol grpc -- go run main.go
  15. # Run a NodeJs application that listens to port 3000 with API logging enabled
  16. dapr run --app-id myapp --app-port 3000 --enable-api-logging -- node myapp.js

Last modified June 23, 2022: Merge pull request #2550 from ItalyPaleAle/cosmosdb-harcoded-dapr-version (cf03237)