Sdílet prostřednictvím


EventHubConnection Constructors

Definition

Overloads

EventHubConnection()

Initializes a new instance of the EventHubConnection class.

EventHubConnection(String)

Initializes a new instance of the EventHubConnection class.

EventHubConnection(String, EventHubConnectionOptions)

Initializes a new instance of the EventHubConnection class.

EventHubConnection(String, String)

Initializes a new instance of the EventHubConnection class.

EventHubConnection(String, String, EventHubConnectionOptions)

Initializes a new instance of the EventHubConnection class.

EventHubConnection(String, String, AzureNamedKeyCredential, EventHubConnectionOptions)

Initializes a new instance of the EventHubConnection class.

EventHubConnection(String, String, AzureSasCredential, EventHubConnectionOptions)

Initializes a new instance of the EventHubConnection class.

EventHubConnection(String, String, TokenCredential, EventHubConnectionOptions)

Initializes a new instance of the EventHubConnection class.

EventHubConnection()

Source:
EventHubConnection.cs
Source:
EventHubConnection.cs

Initializes a new instance of the EventHubConnection class.

protected EventHubConnection ();
Protected Sub New ()

Applies to

EventHubConnection(String)

Source:
EventHubConnection.cs
Source:
EventHubConnection.cs

Initializes a new instance of the EventHubConnection class.

public EventHubConnection (string connectionString);
new Azure.Messaging.EventHubs.EventHubConnection : string -> Azure.Messaging.EventHubs.EventHubConnection
Public Sub New (connectionString As String)

Parameters

connectionString
String

The connection string to use for connecting to the Event Hubs namespace; it is expected that the Event Hub name and the shared key properties are contained in this connection string.

Remarks

If the connection string is copied from the Event Hubs namespace, it will likely not contain the name of the desired Event Hub, which is needed. In this case, the name can be added manually by adding ";EntityPath=[[ EVENT HUB NAME ]]" to the end of the connection string. For example, ";EntityPath=telemetry-hub".

If you have defined a shared access policy directly on the Event Hub itself, then copying the connection string from that Event Hub will result in a connection string that contains the name.

Applies to

EventHubConnection(String, EventHubConnectionOptions)

Source:
EventHubConnection.cs
Source:
EventHubConnection.cs

Initializes a new instance of the EventHubConnection class.

public EventHubConnection (string connectionString, Azure.Messaging.EventHubs.EventHubConnectionOptions connectionOptions);
new Azure.Messaging.EventHubs.EventHubConnection : string * Azure.Messaging.EventHubs.EventHubConnectionOptions -> Azure.Messaging.EventHubs.EventHubConnection
Public Sub New (connectionString As String, connectionOptions As EventHubConnectionOptions)

Parameters

connectionString
String

The connection string to use for connecting to the Event Hubs namespace; it is expected that the Event Hub name and the shared key properties are contained in this connection string.

connectionOptions
EventHubConnectionOptions

A set of options to apply when configuring the connection.

Remarks

If the connection string is copied from the Event Hubs namespace, it will likely not contain the name of the desired Event Hub, which is needed. In this case, the name can be added manually by adding ";EntityPath=[[ EVENT HUB NAME ]]" to the end of the connection string. For example, ";EntityPath=telemetry-hub".

If you have defined a shared access policy directly on the Event Hub itself, then copying the connection string from that Event Hub will result in a connection string that contains the name.

Applies to

EventHubConnection(String, String)

Source:
EventHubConnection.cs
Source:
EventHubConnection.cs

Initializes a new instance of the EventHubConnection class.

public EventHubConnection (string connectionString, string eventHubName);
new Azure.Messaging.EventHubs.EventHubConnection : string * string -> Azure.Messaging.EventHubs.EventHubConnection
Public Sub New (connectionString As String, eventHubName As String)

Parameters

connectionString
String

The connection string to use for connecting to the Event Hubs namespace; it is expected that the shared key properties are contained in this connection string, but not the Event Hub name.

eventHubName
String

The name of the specific Event Hub to associate the connection with.

Remarks

If the connection string is copied from the Event Hub itself, it will contain the name of the desired Event Hub, and can be used directly without passing the eventHubName. The name of the Event Hub should be passed only once, either as part of the connection string or separately.

Applies to

EventHubConnection(String, String, EventHubConnectionOptions)

Source:
EventHubConnection.cs
Source:
EventHubConnection.cs

Initializes a new instance of the EventHubConnection class.

public EventHubConnection (string connectionString, string eventHubName, Azure.Messaging.EventHubs.EventHubConnectionOptions connectionOptions);
new Azure.Messaging.EventHubs.EventHubConnection : string * string * Azure.Messaging.EventHubs.EventHubConnectionOptions -> Azure.Messaging.EventHubs.EventHubConnection
Public Sub New (connectionString As String, eventHubName As String, connectionOptions As EventHubConnectionOptions)

Parameters

connectionString
String

The connection string to use for connecting to the Event Hubs namespace; it is expected that the shared key properties are contained in this connection string, but not the Event Hub name.

eventHubName
String

The name of the specific Event Hub to associate the connection with.

connectionOptions
EventHubConnectionOptions

A set of options to apply when configuring the connection.

Remarks

If the connection string is copied from the Event Hub itself, it will contain the name of the desired Event Hub, and can be used directly without passing the eventHubName. The name of the Event Hub should be passed only once, either as part of the connection string or separately.

Applies to

EventHubConnection(String, String, AzureNamedKeyCredential, EventHubConnectionOptions)

Source:
EventHubConnection.cs
Source:
EventHubConnection.cs

Initializes a new instance of the EventHubConnection class.

public EventHubConnection (string fullyQualifiedNamespace, string eventHubName, Azure.AzureNamedKeyCredential credential, Azure.Messaging.EventHubs.EventHubConnectionOptions connectionOptions = default);
new Azure.Messaging.EventHubs.EventHubConnection : string * string * Azure.AzureNamedKeyCredential * Azure.Messaging.EventHubs.EventHubConnectionOptions -> Azure.Messaging.EventHubs.EventHubConnection
Public Sub New (fullyQualifiedNamespace As String, eventHubName As String, credential As AzureNamedKeyCredential, Optional connectionOptions As EventHubConnectionOptions = Nothing)

Parameters

fullyQualifiedNamespace
String

The fully qualified Event Hubs namespace to connect to. This is likely to be similar to {yournamespace}.servicebus.windows.net.

eventHubName
String

The name of the specific Event Hub to associate the connection with.

credential
AzureNamedKeyCredential

The AzureNamedKeyCredential to use for authorization. Access controls may be specified by the Event Hubs namespace or the requested Event Hub, depending on Azure configuration.

connectionOptions
EventHubConnectionOptions

A set of options to apply when configuring the connection.

Applies to

EventHubConnection(String, String, AzureSasCredential, EventHubConnectionOptions)

Source:
EventHubConnection.cs
Source:
EventHubConnection.cs

Initializes a new instance of the EventHubConnection class.

public EventHubConnection (string fullyQualifiedNamespace, string eventHubName, Azure.AzureSasCredential credential, Azure.Messaging.EventHubs.EventHubConnectionOptions connectionOptions = default);
new Azure.Messaging.EventHubs.EventHubConnection : string * string * Azure.AzureSasCredential * Azure.Messaging.EventHubs.EventHubConnectionOptions -> Azure.Messaging.EventHubs.EventHubConnection
Public Sub New (fullyQualifiedNamespace As String, eventHubName As String, credential As AzureSasCredential, Optional connectionOptions As EventHubConnectionOptions = Nothing)

Parameters

fullyQualifiedNamespace
String

The fully qualified Event Hubs namespace to connect to. This is likely to be similar to {yournamespace}.servicebus.windows.net.

eventHubName
String

The name of the specific Event Hub to associate the connection with.

credential
AzureSasCredential

The AzureSasCredential to use for authorization. Access controls may be specified by the Event Hubs namespace or the requested Event Hub, depending on Azure configuration.

connectionOptions
EventHubConnectionOptions

A set of options to apply when configuring the connection.

Applies to

EventHubConnection(String, String, TokenCredential, EventHubConnectionOptions)

Source:
EventHubConnection.cs
Source:
EventHubConnection.cs

Initializes a new instance of the EventHubConnection class.

public EventHubConnection (string fullyQualifiedNamespace, string eventHubName, Azure.Core.TokenCredential credential, Azure.Messaging.EventHubs.EventHubConnectionOptions connectionOptions = default);
new Azure.Messaging.EventHubs.EventHubConnection : string * string * Azure.Core.TokenCredential * Azure.Messaging.EventHubs.EventHubConnectionOptions -> Azure.Messaging.EventHubs.EventHubConnection
Public Sub New (fullyQualifiedNamespace As String, eventHubName As String, credential As TokenCredential, Optional connectionOptions As EventHubConnectionOptions = Nothing)

Parameters

fullyQualifiedNamespace
String

The fully qualified Event Hubs namespace to connect to. This is likely to be similar to {yournamespace}.servicebus.windows.net.

eventHubName
String

The name of the specific Event Hub to associate the connection with.

credential
TokenCredential

The Azure managed identity credential to use for authorization. Access controls may be specified by the Event Hubs namespace or the requested Event Hub, depending on Azure configuration.

connectionOptions
EventHubConnectionOptions

A set of options to apply when configuring the connection.

Applies to