Skip to main content

namespaces

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

Overview

Namenamespaces
TypeResource
Idazure.relay.namespaces

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
keyNamestringA string that describes the authorization rule.
primaryConnectionStringstringPrimary connection string of the created namespace authorization rule.
primaryKeystringA base64-encoded 256-bit primary key for signing and validating the SAS token.
secondaryConnectionStringstringSecondary connection string of the created namespace authorization rule.
secondaryKeystringA base64-encoded 256-bit secondary 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_idPrimary and secondary connection strings to the namespace.
getselectresource_group_name, namespace_name, subscription_idReturns the description for the specified namespace.
list_by_resource_groupselectresource_group_name, subscription_idLists all the available namespaces within the ResourceGroup.
check_name_availabilityselectsubscription_idCheck the specified namespace name availability.
listselectsubscription_idLists all the available namespaces within the subscription regardless of the resourceGroups.
create_or_updateinsertresource_group_name, namespace_name, subscription_id, locationCreate Azure Relay namespace.
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_id, locationCreate Azure Relay namespace.
deletedeleteresource_group_name, namespace_name, subscription_idDeletes an existing namespace. This operation also removes all associated resources under the namespace.
list_authorization_rulesexecresource_group_name, namespace_name, subscription_idAuthorization rules for a namespace.
get_authorization_ruleexecresource_group_name, namespace_name, authorization_rule_name, subscription_idAuthorization rule for a namespace by name.
create_or_update_authorization_ruleexecresource_group_name, namespace_name, authorization_rule_name, subscription_id, propertiesCreates or updates an authorization rule for a namespace.
delete_authorization_ruleexecresource_group_name, namespace_name, authorization_rule_name, subscription_idDeletes a namespace authorization rule.
regenerate_keysexecresource_group_name, namespace_name, authorization_rule_name, subscription_id, keyTypeRegenerates the primary or secondary connection strings to the 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

Primary and secondary connection strings to the namespace.

SELECT
keyName,
primaryConnectionString,
primaryKey,
secondaryConnectionString,
secondaryKey
FROM azure.relay.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

Create Azure Relay namespace.

INSERT INTO azure.relay.namespaces (
location,
tags,
sku,
resource_group_name,
namespace_name,
subscription_id
)
SELECT
'{{ location }}' /* required */,
'{{ tags }}',
'{{ sku }}',
'{{ resource_group_name }}',
'{{ namespace_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
sku,
tags,
type
;

UPDATE examples

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

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

REPLACE examples

Create Azure Relay namespace.

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

DELETE examples

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

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

Lifecycle Methods

Authorization rules for a namespace.

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