Skip to main content

subscriptions

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

Overview

Namesubscriptions
TypeResource
Idazure.service_bus.subscriptions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
accessedAtstring (date-time)Last time there was a receive request to this subscription.
autoDeleteOnIdlestringISO 8061 timeSpan idle interval after which the topic is automatically deleted. The minimum duration is 5 minutes.
clientAffinePropertiesobjectProperties specific to client affine subscriptions.
countDetailsobjectMessage count details.
createdAtstring (date-time)Exact time the message was created.
deadLetteringOnFilterEvaluationExceptionsbooleanValue that indicates whether a subscription has dead letter support on filter evaluation exceptions.
deadLetteringOnMessageExpirationbooleanValue that indicates whether a subscription has dead letter support when a message expires.
defaultMessageTimeToLivestringISO 8061 Default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself.
duplicateDetectionHistoryTimeWindowstringISO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is 10 minutes.
enableBatchedOperationsbooleanValue that indicates whether server-side batched operations are enabled.
forwardDeadLetteredMessagesTostringQueue/Topic name to forward the Dead Letter message.
forwardTostringQueue/Topic name to forward the messages.
isClientAffinebooleanValue that indicates whether the subscription has an affinity to the client id.
locationstringThe geo-location where the resource lives.
lockDurationstringISO 8061 lock duration timespan for the subscription. The default value is 1 minute.
maxDeliveryCountintegerNumber of maximum deliveries.
messageCountintegerNumber of messages.
requiresSessionbooleanValue indicating if a subscription supports the concept of sessions.
statusstringEnumerates the possible values for the status of a messaging entity. Known values are: "Active", "Disabled", "Restoring", "SendDisabled", "ReceiveDisabled", "Creating", "Deleting", "Renaming", and "Unknown".
systemDataobjectThe system meta data relating to this resource.
typestringThe type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs".
updatedAtstring (date-time)The exact time the message was updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, namespace_name, topic_name, subscription_name, subscription_idReturns a subscription description for the specified topic. .. seealso:: - https://msdn.microsoft.com/en-us/library/azure/mt639402.aspx
list_by_topicselectresource_group_name, namespace_name, topic_name, subscription_id$skip, $topList all the subscriptions under a specified topic. .. seealso:: - https://msdn.microsoft.com/en-us/library/azure/mt639400.aspx
create_or_updateinsertresource_group_name, namespace_name, topic_name, subscription_name, subscription_idCreates a topic subscription. .. seealso:: - https://msdn.microsoft.com/en-us/library/azure/mt639385.aspx
create_or_updatereplaceresource_group_name, namespace_name, topic_name, subscription_name, subscription_idCreates a topic subscription. .. seealso:: - https://msdn.microsoft.com/en-us/library/azure/mt639385.aspx
deletedeleteresource_group_name, namespace_name, topic_name, subscription_name, subscription_idDeletes a subscription from the specified topic. .. seealso:: - https://msdn.microsoft.com/en-us/library/azure/mt639381.aspx

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
namespace_namestringThe namespace name. Required.
resource_group_namestringName of the Resource group within the Azure subscription. Required.
subscription_idstring
subscription_namestringThe subscription name. Required.
topic_namestringThe topic name. Required.
$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

Returns a subscription description for the specified topic. .. seealso:: - https://msdn.microsoft.com/en-us/library/azure/mt639402.aspx

SELECT
id,
name,
accessedAt,
autoDeleteOnIdle,
clientAffineProperties,
countDetails,
createdAt,
deadLetteringOnFilterEvaluationExceptions,
deadLetteringOnMessageExpiration,
defaultMessageTimeToLive,
duplicateDetectionHistoryTimeWindow,
enableBatchedOperations,
forwardDeadLetteredMessagesTo,
forwardTo,
isClientAffine,
location,
lockDuration,
maxDeliveryCount,
messageCount,
requiresSession,
status,
systemData,
type,
updatedAt
FROM azure.service_bus.subscriptions
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND namespace_name = '{{ namespace_name }}' -- required
AND topic_name = '{{ topic_name }}' -- required
AND subscription_name = '{{ subscription_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Creates a topic subscription. .. seealso:: - https://msdn.microsoft.com/en-us/library/azure/mt639385.aspx

INSERT INTO azure.service_bus.subscriptions (
properties,
resource_group_name,
namespace_name,
topic_name,
subscription_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ namespace_name }}',
'{{ topic_name }}',
'{{ subscription_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
systemData,
type
;

REPLACE examples

Creates a topic subscription. .. seealso:: - https://msdn.microsoft.com/en-us/library/azure/mt639385.aspx

REPLACE azure.service_bus.subscriptions
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND namespace_name = '{{ namespace_name }}' --required
AND topic_name = '{{ topic_name }}' --required
AND subscription_name = '{{ subscription_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
type;

DELETE examples

Deletes a subscription from the specified topic. .. seealso:: - https://msdn.microsoft.com/en-us/library/azure/mt639381.aspx

DELETE FROM azure.service_bus.subscriptions
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND namespace_name = '{{ namespace_name }}' --required
AND topic_name = '{{ topic_name }}' --required
AND subscription_name = '{{ subscription_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;