Environment variables

The following table lists the environment variables used by the Dapr runtime, CLI, or from within your application:

Environment VariableUsed ByDescription
APP_IDYour applicationThe id for your application, used for service discovery
APP_PORTYour applicationThe port your application is listening on
APP_API_TOKENYour applicationThe token used by the application to authenticate requests from Dapr API. Read authenticate requests from Dapr using token authentication for more information.
DAPR_HTTP_PORTYour applicationThe HTTP port that the Dapr sidecar is listening on. Your application should use this variable to connect to Dapr sidecar instead of hardcoding the port value. Set by the Dapr CLI run command for self hosted or injected by the dapr-sidecar-injector into all the containers in the pod.
DAPR_GRPC_PORTYour applicationThe gRPC port that the Dapr sidecar is listening on. Your application should use this variable to connect to Dapr sidecar instead of hardcoding the port value. Set by the Dapr CLI run command for self hosted or injected by the dapr-sidecar-injector into all the containers in the pod.
DAPR_METRICS_PORTYour applicationThe HTTP Prometheus port that Dapr sends its metrics information to. Your application can use this variable to send its application specific metrics to have both Dapr metrics and application metrics together. See metrics-port for more information
DAPR_API_TOKENDapr sidecarThe token used for Dapr API authentication for requests from the application. Read enable API token authentication in Dapr for more information.
NAMESPACEDapr sidecarUsed to specify a component’s namespace in self-hosted mode

Last modified February 18, 2022: Update setup-jetstream.md (#2200) (428d8c2)