# 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`: ```yml 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/secrets/README.md) ## Apply the configuration ### In Kubernetes To apply the Azure Service Bus pub/sub to Kubernetes, use the `kubectl` CLI: ```bash 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 contents of `messagebus.yaml` file with the contents of `azuresb.yaml` above (Don't change the filename).