# 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`: ```yaml apiVersion: dapr.io/v1alpha1 kind: Component metadata: name: namespace: spec: type: pubsub.azure.servicebus metadata: - name: connectionString value: # Required. - name: timeoutInSec value: # Optional. Default: "60". Timeout for sending messages and management operations. - name: handlerTimeoutInSec value: # Optional. Default: "60". Timeout for invoking app handler. - name: disableEntityManagement value: # Optional. Default: false. When set to true, topics and subscriptions do not get created automatically. - name: maxDeliveryCount value: # Optional. Defines the number of attempts the server will make to deliver a message. - name: lockDurationInSec value: # Optional. Defines the length in seconds that a message will be locked for before expiring. - name: lockRenewalInSec value: # Optional. Default: "20". Defines the frequency at which buffered message locks will be renewed. - name: maxActiveMessages value: # Optional. Default: "10000". Defines the maximum number of messages to be buffered or processing at once. - name: maxActiveMessagesRecoveryInSec value: # Optional. Default: "2". Defines the number of seconds to wait once the maximum active message limit is reached. - name: maxConcurrentHandlers value: # Optional. Defines the maximum number of concurrent message handlers - name: prefetchCount value: # Optional. Defines the number of prefetched messages (use for high throughput / low latency scenarios) - name: defaultMessageTimeToLiveInSec value: # Optional. - name: autoDeleteOnIdleInSec value: # Optional. ``` > __NOTE:__ The above settings are shared across all topics that use this component. 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 To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.