Document Azure ServiceBus params for AAD auth (#2337)

* Document Azure ServiceBus params for AAD auth

For both the pubsub and input/output bindings using Azure
ServiceBus, antoher parameter is required in order to use AAD auth.
This commit adds documentation for that parameter.

https://github.com/dapr/docs/issues/1867

Signed-off-by: Hal Spang <halspang@microsoft.com>

* Update servicebusqueues.md

Removing extra heading for AAD

Co-authored-by: Mark Fussell <markfussell@gmail.com>
This commit is contained in:
halspang 2022-04-07 20:50:50 +00:00 committed by GitHub
parent 84f5617b73
commit 6130fbb629
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 92 additions and 4 deletions

View File

@ -11,7 +11,7 @@ aliases:
To setup Azure Service Bus Queues binding create a component of type `bindings.azure.servicebusqueues`. See [this guide]({{< ref "howto-bindings.md#1-create-a-binding" >}}) on how to create and apply a binding configuration.
### Connection String Authentication
```yaml
apiVersion: dapr.io/v1alpha1
@ -23,14 +23,13 @@ spec:
type: bindings.azure.servicebusqueues
version: v1
metadata:
- name: connectionString
- name: connectionString # Required when not using Azure Authentication.
value: "Endpoint=sb://************"
- name: queueName
value: queue1
- name: ttlInSeconds
value: 60
```
{{% alert title="Warning" color="warning" %}}
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
{{% /alert %}}
@ -42,10 +41,36 @@ The above example uses secrets as plain strings. It is recommended to use a secr
| connectionString | Y | Input/Output | The Service Bus connection string | `"Endpoint=sb://************"` |
| queueName | Y | Input/Output | The Service Bus queue name. Queue names are case-insensitive and will always be forced to lowercase. | `"queuename"` |
| ttlInSeconds | N | Output | Parameter to set the default message [time to live](https://docs.microsoft.com/azure/service-bus-messaging/message-expiration). If this parameter is omitted, messages will expire after 14 days. See [also](#specifying-a-ttl-per-message) | `"60"` |
| namespaceName| N | Input/Output | Parameter to set the name of the Service Bus namespace. Required if using AAD authentication. | `"namespace"` |
### Azure Active Directory (AAD) authentication
The Azure Service Bus Queues binding component supports authentication using all Azure Active Directory mechanisms. For further information and the relevant component metadata fields to provide depending on the choice of AAD authentication mechanism, see the [docs for authenticating to Azure]({{< ref authenticating-azure.md >}}).
#### Example Configuration
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <NAME>
namespace: <NAMESPACE>
spec:
type: bindings.azure.servicebusqueues
version: v1
metadata:
- name: azureTenantId
value: "***"
- name: azureClientId
value: "***"
- name: azureClientSecret
value: "***"
- name: namespaceName # Required when using Azure Authentication.
value: "<SERVICEBUS_NAMESPACE>"
- name: queueName
value: queue1
- name: ttlInSeconds
value: 60
```
## Binding support
This component supports both **input and output** binding interfaces.

View File

@ -68,6 +68,45 @@ The above example uses secrets as plain strings. It is recommended to use a secr
### Azure Active Directory (AAD) authentication
The Azure Event Hubs pubsub component supports authentication using all Azure Active Directory mechanisms. For further information and the relevant component metadata fields to provide depending on the choice of AAD authentication mechanism, see the [docs for authenticating to Azure]({{< ref authenticating-azure.md >}}).
#### Example Configuration
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: eventhubs-pubsub
namespace: default
spec:
type: pubsub.azure.eventhubs
version: v1
metadata:
# Azure Authentication Used
- name: azureTenantId
value: "***"
- name: azureClientId
value: "***"
- name: azureClientSecret
value: "***"
- name: eventHubNamespace
value: "namespace"
- name: enableEntityManagement
value: "false"
## The following four properties are needed only if enableEntityManagement is set to true
- name: resourceGroupName
value: "test-rg"
- name: subscriptionID
value: "value of Azure subscription ID"
- name: partitionCount
value: "1"
- name: messageRetentionInDays
## Subscriber attributes
- name: storageAccountName
value: "myeventhubstorage"
- name: storageAccountKey
value: "112233445566778899"
- name: storageContainerName
value: "myeventhubstoragecontainer"
```
## Create an Azure Event Hub
Follow the instructions [here](https://docs.microsoft.com/azure/event-hubs/event-hubs-create) on setting up Azure Event Hubs.

View File

@ -10,6 +10,8 @@ aliases:
## Component format
To setup Azure Service Bus pubsub create a component of type `pubsub.azure.servicebus`. See [this guide]({{< ref "howto-publish-subscribe.md#step-1-setup-the-pubsub-component" >}}) on how to create and apply a pubsub configuration.
### Connection String Authentication
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -20,7 +22,7 @@ spec:
type: pubsub.azure.servicebus
version: v1
metadata:
- name: connectionString # Required
- name: connectionString # Required when not using Azure Authentication.
value: "Endpoint=sb://{ServiceBusNamespace}.servicebus.windows.net/;SharedAccessKeyName={PolicyName};SharedAccessKey={Key};EntityPath={ServiceBus}"
# - name: timeoutInSec # Optional
# value: 60
@ -83,10 +85,32 @@ The above example uses secrets as plain strings. It is recommended to use a secr
| connectionRecoveryInSec | N |Time in seconds to wait between connection recovery attempts. Defaults: `2` | `2`
| publishMaxRetries | N | The max number of retries for when Azure Service Bus responds with "too busy" in order to throttle messages. Defaults: `5` | `5`
| publishInitialRetryInternalInMs | N | Time in milliseconds for the initial exponential backoff when Azure Service Bus throttle messages. Defaults: `500` | `500`
| namespaceName| N | Parameter to set the name of the Service Bus namespace. Required if using AAD authentication. | `"namespace"` |
### Azure Active Directory (AAD) authentication
The Azure Service Bus pubsub component supports authentication using all Azure Active Directory mechanisms. For further information and the relevant component metadata fields to provide depending on the choice of AAD authentication mechanism, see the [docs for authenticating to Azure]({{< ref authenticating-azure.md >}}).
#### Example Configuration
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: servicebus-pubsub
namespace: default
spec:
type: pubsub.azure.servicebus
version: v1
metadata:
- name: namespaceName # Required when using Azure Authentication.
value: "servicebusnamespace"
- name: azureTenantId
value: "***"
- name: azureClientId
value: "***"
- name: azureClientSecret
value: "***"
```
## Message metadata
Azure Service Bus messages extend the Dapr message format with additional contextual metadata. Some metadata fields are set by Azure Service Bus itself (read-only) and others can be set by the client when publishing a message.