Skip to main content

namespaces

Creates, updates, deletes, gets or lists a namespaces resource.

Overview

Namenamespaces
TypeResource
Idazure.event_hub.namespaces

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, authorization_rule_name, subscription_idGets the primary and secondary connection strings for the Namespace.
getselectresource_group_name, namespace_name, subscription_idGets the description of the specified namespace.
list_by_resource_groupselectresource_group_name, subscription_idLists the available Namespaces within a resource group.
check_name_availabilityselectsubscription_idCheck the give Namespace name availability.
listselectsubscription_idLists all the available Namespaces within a subscription, irrespective of the resource groups.
create_or_updateinsertresource_group_name, namespace_name, subscription_idCreates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent.
updateupdateresource_group_name, namespace_name, subscription_idCreates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent.
create_or_updatereplaceresource_group_name, namespace_name, subscription_idCreates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent.
deletedeleteresource_group_name, namespace_name, subscription_idDeletes an existing namespace. This operation also removes all associated resources under the namespace.
list_network_rule_setexecresource_group_name, namespace_name, subscription_idGets NetworkRuleSet for a Namespace.
list_authorization_rulesexecresource_group_name, namespace_name, subscription_idGets a list of authorization rules for a Namespace.
get_network_rule_setexecresource_group_name, namespace_name, subscription_idGets NetworkRuleSet for a Namespace.
create_or_update_network_rule_setexecresource_group_name, namespace_name, subscription_idCreate or update NetworkRuleSet for a Namespace.
get_authorization_ruleexecresource_group_name, namespace_name, authorization_rule_name, subscription_idGets an AuthorizationRule for a Namespace by rule name.
create_or_update_authorization_ruleexecresource_group_name, namespace_name, authorization_rule_name, subscription_idCreates or updates an AuthorizationRule for a Namespace.
delete_authorization_ruleexecresource_group_name, namespace_name, authorization_rule_name, subscription_idDeletes an AuthorizationRule for a Namespace.
regenerate_keysexecresource_group_name, namespace_name, authorization_rule_name, subscription_id, keyTypeRegenerates the primary or secondary connection strings for the specified Namespace.

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.
namespace_namestringThe Namespace name. Required.
resource_group_namestringName of the resource group within the azure subscription. Required.
subscription_idstring

SELECT examples

Gets the primary and secondary connection strings for the Namespace.

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

INSERT examples

Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent.

INSERT INTO azure.event_hub.namespaces (
location,
tags,
sku,
identity,
properties,
resource_group_name,
namespace_name,
subscription_id
)
SELECT
'{{ location }}',
'{{ tags }}',
'{{ sku }}',
'{{ identity }}',
'{{ properties }}',
'{{ resource_group_name }}',
'{{ namespace_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
identity,
location,
properties,
sku,
systemData,
tags,
type
;

UPDATE examples

Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent.

UPDATE azure.event_hub.namespaces
SET
location = '{{ location }}',
tags = '{{ tags }}',
sku = '{{ sku }}',
identity = '{{ identity }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND namespace_name = '{{ namespace_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
identity,
location,
properties,
sku,
systemData,
tags,
type;

REPLACE examples

Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent.

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

DELETE examples

Deletes an existing namespace. This operation also removes all associated resources under the namespace.

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

Lifecycle Methods

Gets NetworkRuleSet for a Namespace.

EXEC azure.event_hub.namespaces.list_network_rule_set 
@resource_group_name='{{ resource_group_name }}' --required,
@namespace_name='{{ namespace_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;