> For the complete documentation index, see [llms.txt](https://docs.frends.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.frends.com/tasks/tasks/azure-event-hub/receive.md).

# Receive

Task version: 2.7.0

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.AzureEventHub/tree/main/Frends.AzureEventHub.Receive>

## Task Parameters

{% tabs %}
{% tab title="Consumer" %}

| Name                                          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| AuthenticationMethod : `AuthenticationMethod` | <p>Specifies the method used for authentication.</p><p>Default is AuthenticationMethod.ConnectionString.</p><p>Possible values:</p><ul><li><code>ConnectionString</code>: Specifies the method used for authentication.</li></ul><p>Default is AuthenticationMethod.ConnectionString.</p><ul><li><code>SASToken</code>: Specifies the method used for authentication.</li></ul><p>Default is AuthenticationMethod.ConnectionString.</p><ul><li><code>OAuth2</code>: Specifies the method used for authentication.</li></ul><p>Default is AuthenticationMethod.ConnectionString.</p><p><br>Default: <code>0</code><br>Example: <code>AuthenticationMethod.ConnectionString</code></p> |
| EventHubName : `String`                       | <p>Specifies the name of the Event Hub to connect to.</p><p><br>Default: <code>-</code><br>Example: <code>ExampleHub</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ConsumerGroup : `String`                      | <p>Specifies the name of the consumer group for reading events.</p><p>If left empty, the default consumer group will be used.</p><p><br>Default: <code>-</code><br>Example: <code>$Default</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| 🗝ConnectionString : `String`                 | <p>Specifies the connection string for the Event Hub.</p><p>Required when using AuthenticationMethod.ConnectionString.</p><p><br>Default: <code>-</code><br>Example: <code>Endpoint=sb://NamespaceName.servicebus.windows.net/;SharedAccessKeyName=KeyName;SharedAccessKey=KeyValue</code></p>                                                                                                                                                                                                                                                                                                                                                                                       |
| Namespace : `String`                          | <p>Specifies the fully qualified namespace of the Event Hub.</p><p>Required when using SAS Token or OAuth2 authentication methods.</p><p><br>Default: <code>-</code><br>Example: <code>{yournamespace}.servicebus.windows.net</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| 🗝SASToken : `String`                         | <p>Specifies the Shared Access Signature token for authentication.</p><p>Access controls may be specified by the Event Hubs namespace or the requested Event Hub, depending on Azure configuration.</p><p><br>Default: <code>-</code><br>Example: <code>sv=2021-04-10\&se=2022-04-10T10%3A431Z\&sr=c\&sp=l\&sig=ZJg983RovE%2BZXI</code></p>                                                                                                                                                                                                                                                                                                                                          |
| 🗝TenantId : `String`                         | <p>Specifies the Azure Active Directory tenant (directory) ID for OAuth2 authentication.</p><p><br>Default: <code>-</code><br>Example: <code>Y6b1hf2a-80e2-xyz2-qwer3h-3a7c3a8as4b7f</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| 🗝ClientId : `String`                         | <p>Specifies the client (application) ID for OAuth2 authentication.</p><p><br>Default: <code>-</code><br>Example: <code>Y6b1hf2a-80e2-xyz2-qwer3h-3a7c3a8as4b7f</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| 🗝ClientSecret : `String`                     | <p>Specifies the client secret generated for the App Registration used for OAuth2 authentication.</p><p><br>Default: <code>-</code><br>Example: <code>Password</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| MaximumWaitTime : `Double`                    | <p>Specifies the maximum wait time (in seconds) for an event to become available before emitting an empty event.</p><p>If set to 0, the processor will wait indefinitely for an event to become available.</p><p>Note: <code>Consumer.MaximumWaitTime</code> cannot exceed <code>Options.MaxRunTime</code> when <code>Options.MaxRunTime</code> is greater than 0.</p><p><br>Default: <code>0</code><br>Example: <code>0, 10 , 10.1</code></p>                                                                                                                                                                                                                                       |
| {% endtab %}                                  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |

{% tab title="Checkpoint" %}

| Name                                          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| AuthenticationMethod : `AuthenticationMethod` | <p>Specifies the method used for authentication.</p><p>Default is AuthenticationMethod.ConnectionString.</p><p>Possible values:</p><ul><li><code>ConnectionString</code>: Specifies the method used for authentication.</li></ul><p>Default is AuthenticationMethod.ConnectionString.</p><ul><li><code>SASToken</code>: Specifies the method used for authentication.</li></ul><p>Default is AuthenticationMethod.ConnectionString.</p><ul><li><code>OAuth2</code>: Specifies the method used for authentication.</li></ul><p>Default is AuthenticationMethod.ConnectionString.</p><p><br>Default: <code>0</code><br>Example: <code>AuthenticationMethod.ConnectionString</code></p> |
| ContainerName : `String`                      | <p>The name of the blob container.</p><p><br>Default: <code>-</code><br>Example: <code>examplecontainer</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| CreateContainer : `Boolean`                   | <p>If true, a new container is created under the specified account if it doesn’t exist.</p><p>Not supported when using SAS Token as an authentication method.</p><p><br>Default: <code>False</code><br>Example: <code>false</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| 🗝ConnectionString : `String`                 | <p>A connection string for the blob container.</p><p><br>Default: <code>-</code><br>Example: <code>DefaultEndpointsProtocol=https;AccountName=accountname;AccountKey=Pdlrxyz==;EndpointSuffix=core.windows.net</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| BlobContainerUri : `String`                   | <p>The URI of the blob container.</p><p>Required when using SAS Token or OAuth2 authentication method.</p><p><br>Default: <code>-</code><br>Example: <code>https\://{account\_name}.blob.core.windows.net/{container\_name}</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| 🗝SASToken : `String`                         | <p>Shared access signature token.</p><p><br>Default: <code>-</code><br>Example: <code>sv=2021-04-10\&se=2022-04-10T10%3A431Z\&sr=c\&sp=l\&sig=ZJg9aovE%2BZXI</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| 🗝TenantId : `String`                         | <p>The Azure Active Directory tenant (directory) Id.</p><p>Required for OAuth2 authentication method.</p><p><br>Default: <code>-</code><br>Example: <code>Y6b1hf2a-80e2-xyz2-qwer3h-3a7c3a8as4b7f</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| 🗝ClientId : `String`                         | <p>The client (application) ID.</p><p>Required for OAuth2 authentication method.</p><p><br>Default: <code>-</code><br>Example: <code>Y6b1hf2a-80e2-xyz2-qwer3h-3a7c3a8as4b7f</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| 🗝ClientSecret : `String`                     | <p>A client secret.</p><p>Required for OAuth2 authentication method.</p><p><br>Default: <code>-</code><br>Example: <code>Password</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| {% endtab %}                                  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |

{% tab title="Options" %}

| Name                                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ExceptionHandler : `ExceptionHandlers` | <p>Determines how exceptions are handled during Task execution.</p><p>Setting this to ExceptionHandlers.Info will log the exception message to Result.Errors and attempt to continue the Task execution, if possible.</p><p>Possible values:</p><ul><li><code>Info</code>: Determines how exceptions are handled during Task execution.</li></ul><p>Setting this to ExceptionHandlers.Info will log the exception message to Result.Errors and attempt to continue the Task execution, if possible.</p><ul><li><code>Throw</code>: Determines how exceptions are handled during Task execution.</li></ul><p>Setting this to ExceptionHandlers.Info will log the exception message to Result.Errors and attempt to continue the Task execution, if possible.</p><p><br>Default: <code>0</code><br>Example: <code>ExceptionHandlers.Info</code></p> |
| ConsumeAttemptDelay : `Double`         | <p>Specifies the delay (in seconds) between each attempt to consume data.</p><p>NOTE: Must be at least 0.1</p><p><br>Default: <code>1</code><br>Example: <code>1, 0.5</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| MaxRunTime : `Double`                  | <p>Sets the maximum duration (in seconds) for the Task to run.</p><p>If set to 0, the Task can run indefinitely.</p><p>Note that both MaxRunTime and MaxEvents cannot be set to unlimited.</p><p><br>Default: <code>0</code><br>Example: <code>0, 10, 1.5</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| MaxEvents : `Int32`                    | <p>Defines the maximum number of events to be received before ending the Task.</p><p>If set to 0, the Task can receive an unlimited number of events.</p><p>Note that both MaxRunTime and MaxEvents cannot be set to unlimited.</p><p><br>Default: <code>0</code><br>Example: <code>0, 5</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| {% endtab %}                           |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| {% endtabs %}                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |

## Task Result

| Name                    | Description                                                                                                                                                     |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Success : `Boolean`     | <p>Indicates whether the Task completed without errors.<br>Example: <code>true</code></p>                                                                       |
| Data : `List<Object>`   | <p>Contains a list of events.<br>Example: <code>{ "foo", bar }</code></p>                                                                                       |
| Errors : `List<Object>` | <p>Contains a list of errors If Options.ExceptionHandlers is set to Throw.<br>Example: <code>{ "An exception occured", "Another exception occured" }</code></p> |

## Task Changelog

Changelog for Task Frends.AzureEventHub.Receive.

### \[2.7.0] - 2026-04-26

#### Fixed

* Resolve the problem with short delays between checks

### \[2.6.0] - 2026-01-16

#### Changed

* Update Azure packages to latest versions.
  * Azure.Identity to 1.17.1
  * Azure.Messaging.EventHubs to 5.12.2
  * Azure.Messaging.EventHubs.Processor to 5.12.2

### \[2.5.0] - 2025-09-22

#### Changed

* Show ContainerName parameter only when AuthenticationMethod is set to ConnectionString.

### \[2.4.0] - 2024-11-13

#### Changed

* Upgraded Azure.Messaging.EventHubs to version 5.11.5.
* Upgraded Azure.Messaging.EventHubs.Processor to version 5.11.5.

### \[2.3.0] - 2024-10-30

#### Fixed

* Issue #11 - Fixed Receive hanging in execution by adding a check for the MaximumWaitTime.

### \[2.2.0] - 2024-08-22

#### Added

* Updated Azure.Identity to the latest version 1.12.0.

### \[2.1.0] - 2024-05-31

#### Changed

* Replaced the List<> with a ConcurrentBag<> for the received messages.

### \[2.0.1] - 2023-11-29

#### Fixed

* Fixed ExceptionHandler check in catch and documentational fixes.

### \[2.0.0] - 2023-10-31

#### Added

* New property `Result.Errors`.

#### Changed

* Improved descriptions and examples.
* Errors and exceptions will be listed in `Result.Errors` if `Options.ExceptionHandler` is set to `ExceptionHandlers.Info`.
* Renamed `Options.MaximumWaitTimeInMinutes` to `Options.MaxRunTime`.
* `Options.MaxRunTime` (previously called `Options.MaximumWaitTimeInMinutes`) is now in seconds instead of minutes.
* `Consumer.MaximumWaitTime` cannot exceed `Options.MaxRunTime` when `Options.MaxRunTime` is greater than 0.
* Renamed `Consumer.FullyQualifiedNamespace` to `Consumer.Namespace`.
* Renamed `Options.Delay` to `Options.ConsumeAttemptDelay`.
* Package updates:
  * Azure.Identity 1.8.2 to 1.10.3
  * Azure.Messaging.EventHubs 5.9.0 to 5.9.3
  * Azure.Messaging.EventHubs.Processor 5.9.0 to 5.9.3
  * System.ComponentModel.Annotations 4.7.0 to 5.0.0

### \[1.0.0] - 2023-05-31

#### Added

* Initial implementation


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.frends.com/tasks/tasks/azure-event-hub/receive.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
