From f5e14e85e2ba4ce24a06813b69882ae84986b3b1 Mon Sep 17 00:00:00 2001 From: Yaron Schneider Date: Mon, 11 Nov 2019 14:57:04 -0800 Subject: [PATCH] Add Azure Service Bus Topics How To (#245) --- howto/setup-pub-sub-message-broker/README.md | 1 + .../setup-azure-servicebus.md | 51 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 howto/setup-pub-sub-message-broker/setup-azure-servicebus.md diff --git a/howto/setup-pub-sub-message-broker/README.md b/howto/setup-pub-sub-message-broker/README.md index c0c849efe..d10ce3aec 100644 --- a/howto/setup-pub-sub-message-broker/README.md +++ b/howto/setup-pub-sub-message-broker/README.md @@ -44,3 +44,4 @@ kubectl apply -f pubsub.yaml [Setup Redis Streams](./setup-redis.md) [Setup NATS](./setup-nats.md) +[Setup Azure Service bus](./setup-azure-servicebus.md) diff --git a/howto/setup-pub-sub-message-broker/setup-azure-servicebus.md b/howto/setup-pub-sub-message-broker/setup-azure-servicebus.md new file mode 100644 index 000000000..ac437e50d --- /dev/null +++ b/howto/setup-pub-sub-message-broker/setup-azure-servicebus.md @@ -0,0 +1,51 @@ +# Setup Azure Service Bus + +Follow the instructions [here](https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-quickstart-topics-subscriptions-portal) on setting up Azure Service Bus Topics. + +## Create a Dapr component + +The next step is to create a Dapr component for Azure Service Bus. + +Create the following YAML file named `azuresb.yaml`: + +``` +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: +spec: + type: pubsub.azure.servicebus + metadata: + - name: connectionString + value: # Required. + - name: timeoutInSec + value: # Optional. Default: "60". + - name: disableEntityManagement + value: # Optional. Default: false. When set to true, topics and subscriptions do not get created automatically. + - name: maxDeliveryCount + value: # Optional. + - name: lockDurationInSec + value: # Optional. + - name: defaultMessageTimeToLiveInSec + value: # Optional. + - name: autoDeleteOnIdleInSec + value: # Optional. +``` + +The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here](../../concepts/components/secrets.md) + + +## Apply the configuration + +### In Kubernetes + +To apply the Azure Service Bus pub/sub to Kubernetes, use the `kubectl` CLI: + +``` +kubectl apply -f azuresb.yaml +``` + +### Running locally + +The Dapr CLI will automatically create a directory named `components` in your current working directory with a Redis component. +To use Azure Service Bus, replace the redis_messagebus.yaml file with azuresb.yaml above.