Various examples of using Dapr with the pubsub building block across runtimes.
NOTE: These example(s) and the below instructions use Event Hub - however, other pubsub providers can be input as desired.
- Install some type of Kubernetes cluster. An easy method is to just enable Kubernetes in Docker Desktop
- Each language folder has a
local-k8s
sub folder. This contains apubsub.yaml
,deployment.yaml
andservice.yaml
file.- Prior to deployment, update the
pubsub.yaml
with the required values needed
- Prior to deployment, update the
- Build the image with the
Dockerfile
in the language folder being used. If the image name is not the same name indeployment.yaml
, then updatedeployment.yaml
- Deploy the project with
kubectl apply -f local-k8s/
- Create a Container App and Container App environment
- Push the image built from the language
Dockerfile
to an Azure Container Registry - Create a
pubsub
dapr component, with the following:
- Add in the same
metaData
thats in thelocal-k8s
folders in the examples connectionString
: EventHub connection stringstorageAccountName
: Storage account namestorageAccountKey
: Storage account keystorageContainerName
: Storage ontainer nameconsumerID
: Name of the consumer ID, if not defined, it uses theappId
- Add the component to the application by specifying it in
scopes
- Enable dapr on the Container App
- Ensure ingress is set to the appropriate port for the language example being used