publish CLI command reference

Detailed information on the publish CLI command

Description

Publish a pub-sub event.

Supported platforms

Usage

  1. dapr publish [flags]

Flags

NameEnvironment VariableDefaultDescription
—publish-app-id, -iThe ID that represents the app from which you are publishing
—pubsub, -pThe name of the pub/sub component
—topic, -tThe topic to be published to
—data, -dThe JSON serialized string (optional)
—data-file, -fA file containing the JSON serialized data (optional)
—help, -hPrint this help message

Examples

Publish to sample topic in target pubsub

  1. dapr publish --publish-app-id appId --topic sample --pubsub target --data '{"key":"value"}'

Last modified September 17, 2021 : Merge pull request #1757 from georgestevens99/1440SecretKeyRefExplanation (620a5f8)