event_hubs
Creates, updates, deletes, gets or lists an event_hubs resource.
Overview
| Name | event_hubs |
| Type | Resource |
| Id | azure.event_hub.event_hubs |
Fields
The following fields are returned by SELECT queries:
- list_keys
- get
- list_by_namespace
| Name | Datatype | Description |
|---|---|---|
aliasPrimaryConnectionString | string | Primary connection string of the alias if GEO DR is enabled. |
aliasSecondaryConnectionString | string | Secondary connection string of the alias if GEO DR is enabled. |
keyName | string | A string that describes the AuthorizationRule. |
primaryConnectionString | string | Primary connection string of the created namespace AuthorizationRule. |
primaryKey | string | A base64-encoded 256-bit primary key for signing and validating the SAS token. |
secondaryConnectionString | string | Secondary connection string of the created namespace AuthorizationRule. |
secondaryKey | string | A base64-encoded 256-bit primary key for signing and validating the SAS token. |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
captureDescription | object | Properties of capture description. |
createdAt | string (date-time) | Exact time the Event Hub was created. |
location | string | The geo-location where the resource lives. |
messageRetentionInDays | integer | Number of days to retain the events for this Event Hub, value should be 1 to 7 days. |
partitionCount | integer | Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. |
partitionIds | array | Current number of shards on the Event Hub. |
status | string | Enumerates the possible values for the status of the Event Hub. Known values are: "Active", "Disabled", "Restoring", "SendDisabled", "ReceiveDisabled", "Creating", "Deleting", "Renaming", and "Unknown". |
systemData | object | The system meta data relating to this resource. |
type | string | The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs". |
updatedAt | string (date-time) | The exact time the message was updated. |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
captureDescription | object | Properties of capture description. |
createdAt | string (date-time) | Exact time the Event Hub was created. |
location | string | The geo-location where the resource lives. |
messageRetentionInDays | integer | Number of days to retain the events for this Event Hub, value should be 1 to 7 days. |
partitionCount | integer | Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. |
partitionIds | array | Current number of shards on the Event Hub. |
status | string | Enumerates the possible values for the status of the Event Hub. Known values are: "Active", "Disabled", "Restoring", "SendDisabled", "ReceiveDisabled", "Creating", "Deleting", "Renaming", and "Unknown". |
systemData | object | The system meta data relating to this resource. |
type | string | The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs". |
updatedAt | string (date-time) | The exact time the message was updated. |
Methods
The following methods are available for this resource:
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.
| Name | Datatype | Description |
|---|---|---|
authorization_rule_name | string | The authorization rule name. Required. |
event_hub_name | string | The Event Hub name. Required. |
namespace_name | string | The Namespace name. Required. |
resource_group_name | string | Name of the resource group within the azure subscription. Required. |
subscription_id | string | |
$skip | integer | Skip 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. |
$top | integer | May be used to limit the number of results to the most recent N usageDetails. Default value is None. |
SELECT examples
- list_keys
- get
- list_by_namespace
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
;
Gets an Event Hubs description for the specified Event Hub.
SELECT
id,
name,
captureDescription,
createdAt,
location,
messageRetentionInDays,
partitionCount,
partitionIds,
status,
systemData,
type,
updatedAt
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
;
Gets all the Event Hubs in a Namespace.
SELECT
id,
name,
captureDescription,
createdAt,
location,
messageRetentionInDays,
partitionCount,
partitionIds,
status,
systemData,
type,
updatedAt
FROM azure.event_hub.event_hubs
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND namespace_name = '{{ namespace_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $skip = '{{ $skip }}'
AND $top = '{{ $top }}'
;
INSERT examples
- create_or_update
- Manifest
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
;
# Description fields are for documentation purposes
- name: event_hubs
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the event_hubs resource.
- name: namespace_name
value: "{{ namespace_name }}"
description: Required parameter for the event_hubs resource.
- name: event_hub_name
value: "{{ event_hub_name }}"
description: Required parameter for the event_hubs resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the event_hubs resource.
- name: properties
value:
messageRetentionInDays: {{ messageRetentionInDays }}
partitionCount: {{ partitionCount }}
status: "{{ status }}"
captureDescription:
enabled: {{ enabled }}
encoding: "{{ encoding }}"
intervalInSeconds: {{ intervalInSeconds }}
sizeLimitInBytes: {{ sizeLimitInBytes }}
destination:
name: "{{ name }}"
properties:
storageAccountResourceId: "{{ storageAccountResourceId }}"
blobContainer: "{{ blobContainer }}"
archiveNameFormat: "{{ archiveNameFormat }}"
dataLakeSubscriptionId: "{{ dataLakeSubscriptionId }}"
dataLakeAccountName: "{{ dataLakeAccountName }}"
dataLakeFolderPath: "{{ dataLakeFolderPath }}"
skipEmptyArchives: {{ skipEmptyArchives }}
REPLACE examples
- create_or_update
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
- delete
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
- list_authorization_rules
- get_authorization_rule
- create_or_update_authorization_rule
- delete_authorization_rule
- regenerate_keys
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
;
Gets an AuthorizationRule for an Event Hub by rule name.
EXEC azure.event_hub.event_hubs.get_authorization_rule
@resource_group_name='{{ resource_group_name }}' --required,
@namespace_name='{{ namespace_name }}' --required,
@event_hub_name='{{ event_hub_name }}' --required,
@authorization_rule_name='{{ authorization_rule_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule will take a few seconds to take effect.
EXEC azure.event_hub.event_hubs.create_or_update_authorization_rule
@resource_group_name='{{ resource_group_name }}' --required,
@namespace_name='{{ namespace_name }}' --required,
@event_hub_name='{{ event_hub_name }}' --required,
@authorization_rule_name='{{ authorization_rule_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"properties": "{{ properties }}"
}'
;
Deletes an Event Hub AuthorizationRule.
EXEC azure.event_hub.event_hubs.delete_authorization_rule
@resource_group_name='{{ resource_group_name }}' --required,
@namespace_name='{{ namespace_name }}' --required,
@event_hub_name='{{ event_hub_name }}' --required,
@authorization_rule_name='{{ authorization_rule_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Regenerates the ACS and SAS connection strings for the Event Hub.
EXEC azure.event_hub.event_hubs.regenerate_keys
@resource_group_name='{{ resource_group_name }}' --required,
@namespace_name='{{ namespace_name }}' --required,
@event_hub_name='{{ event_hub_name }}' --required,
@authorization_rule_name='{{ authorization_rule_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"keyType": "{{ keyType }}",
"key": "{{ key }}"
}'
;