Skip to main content

event_hubs

Creates, updates, deletes, gets or lists an event_hubs resource.

Overview

Nameevent_hubs
TypeResource
Idazure.event_hub.event_hubs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
aliasPrimaryConnectionStringstringPrimary connection string of the alias if GEO DR is enabled.
aliasSecondaryConnectionStringstringSecondary connection string of the alias if GEO DR is enabled.
keyNamestringA string that describes the AuthorizationRule.
primaryConnectionStringstringPrimary connection string of the created namespace AuthorizationRule.
primaryKeystringA base64-encoded 256-bit primary key for signing and validating the SAS token.
secondaryConnectionStringstringSecondary connection string of the created namespace AuthorizationRule.
secondaryKeystringA base64-encoded 256-bit primary key for signing and validating the SAS token.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_keysselectresource_group_name, namespace_name, event_hub_name, authorization_rule_name, subscription_idGets the ACS and SAS connection strings for the Event Hub.
getselectresource_group_name, namespace_name, event_hub_name, subscription_idGets an Event Hubs description for the specified Event Hub.
list_by_namespaceselectresource_group_name, namespace_name, subscription_id$skip, $topGets all the Event Hubs in a Namespace.
create_or_updateinsertresource_group_name, namespace_name, event_hub_name, subscription_idCreates or updates a new Event Hub as a nested resource within a Namespace.
create_or_updatereplaceresource_group_name, namespace_name, event_hub_name, subscription_idCreates or updates a new Event Hub as a nested resource within a Namespace.
deletedeleteresource_group_name, namespace_name, event_hub_name, subscription_idDeletes an Event Hub from the specified Namespace and resource group.
list_authorization_rulesexecresource_group_name, namespace_name, event_hub_name, subscription_idGets the authorization rules for an Event Hub.
get_authorization_ruleexecresource_group_name, namespace_name, event_hub_name, authorization_rule_name, subscription_idGets an AuthorizationRule for an Event Hub by rule name.
create_or_update_authorization_ruleexecresource_group_name, namespace_name, event_hub_name, authorization_rule_name, subscription_idCreates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule will take a few seconds to take effect.
delete_authorization_ruleexecresource_group_name, namespace_name, event_hub_name, authorization_rule_name, subscription_idDeletes an Event Hub AuthorizationRule.
regenerate_keysexecresource_group_name, namespace_name, event_hub_name, authorization_rule_name, subscription_id, keyTypeRegenerates the ACS and SAS connection strings for the Event Hub.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
authorization_rule_namestringThe authorization rule name. Required.
event_hub_namestringThe Event Hub name. Required.
namespace_namestringThe Namespace name. Required.
resource_group_namestringName of the resource group within the azure subscription. Required.
subscription_idstring
$skipintegerSkip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. Default value is None.
$topintegerMay be used to limit the number of results to the most recent N usageDetails. Default value is None.

SELECT examples

Gets the ACS and SAS connection strings for the Event Hub.

SELECT
aliasPrimaryConnectionString,
aliasSecondaryConnectionString,
keyName,
primaryConnectionString,
primaryKey,
secondaryConnectionString,
secondaryKey
FROM azure.event_hub.event_hubs
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND namespace_name = '{{ namespace_name }}' -- required
AND event_hub_name = '{{ event_hub_name }}' -- required
AND authorization_rule_name = '{{ authorization_rule_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Creates or updates a new Event Hub as a nested resource within a Namespace.

INSERT INTO azure.event_hub.event_hubs (
properties,
resource_group_name,
namespace_name,
event_hub_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ namespace_name }}',
'{{ event_hub_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
systemData,
type
;

REPLACE examples

Creates or updates a new Event Hub as a nested resource within a Namespace.

REPLACE azure.event_hub.event_hubs
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND namespace_name = '{{ namespace_name }}' --required
AND event_hub_name = '{{ event_hub_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
type;

DELETE examples

Deletes an Event Hub from the specified Namespace and resource group.

DELETE FROM azure.event_hub.event_hubs
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND namespace_name = '{{ namespace_name }}' --required
AND event_hub_name = '{{ event_hub_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Gets the authorization rules for an Event Hub.

EXEC azure.event_hub.event_hubs.list_authorization_rules 
@resource_group_name='{{ resource_group_name }}' --required,
@namespace_name='{{ namespace_name }}' --required,
@event_hub_name='{{ event_hub_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;