Skip to main content

event_subscriptions

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

Overview

Nameevent_subscriptions
TypeResource
Idazure.event_grid.event_subscriptions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified identifier of the resource.
namestringName of the resource.
propertiesobjectProperties of the event subscription.
systemDataobjectThe system metadata relating to Event Subscription resource.
typestringType of the resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_by_resourceselectsubscriptionId, resourceGroupName, providerNamespace, resourceTypeName, resourceName$filter, $topList all event subscriptions that have been created for a specific resource.
list_by_domain_topicselectsubscriptionId, resourceGroupName, domainName, topicName$filter, $topList all event subscriptions that have been created for a specific domain topic.
getselectscope, eventSubscriptionNameGet properties of an event subscription.
create_or_updateinsertscope, eventSubscriptionNameAsynchronously creates a new event subscription or updates an existing event subscription based on the specified scope.
updateupdatescope, eventSubscriptionNameAsynchronously updates an existing event subscription.
deletedeletescope, eventSubscriptionNameDelete an existing event subscription.

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
domainNamestringName of the top level domain.
eventSubscriptionNamestringName of the event subscription to be deleted.
providerNamespacestringNamespace of the provider of the topic.
resourceGroupNamestringThe name of the resource group within the user's subscription.
resourceNamestringName of the resource.
resourceTypeNamestringName of the resource type.
scopestringThe scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
subscriptionIdstringSubscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
topicNamestringName of the domain topic.
$filterstringThe query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
$topinteger (int32)The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.

SELECT examples

List all event subscriptions that have been created for a specific resource.

SELECT
id,
name,
properties,
systemData,
type
FROM azure.event_grid.event_subscriptions
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND providerNamespace = '{{ providerNamespace }}' -- required
AND resourceTypeName = '{{ resourceTypeName }}' -- required
AND resourceName = '{{ resourceName }}' -- required
AND $filter = '{{ $filter }}'
AND $top = '{{ $top }}'
;

INSERT examples

Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope.

INSERT INTO azure.event_grid.event_subscriptions (
data__properties,
scope,
eventSubscriptionName
)
SELECT
'{{ properties }}',
'{{ scope }}',
'{{ eventSubscriptionName }}'
RETURNING
id,
name,
properties,
systemData,
type
;

UPDATE examples

Asynchronously updates an existing event subscription.

UPDATE azure.event_grid.event_subscriptions
SET
data__destination = '{{ destination }}',
data__deliveryWithResourceIdentity = '{{ deliveryWithResourceIdentity }}',
data__filter = '{{ filter }}',
data__labels = '{{ labels }}',
data__expirationTimeUtc = '{{ expirationTimeUtc }}',
data__eventDeliverySchema = '{{ eventDeliverySchema }}',
data__retryPolicy = '{{ retryPolicy }}',
data__deadLetterDestination = '{{ deadLetterDestination }}',
data__deadLetterWithResourceIdentity = '{{ deadLetterWithResourceIdentity }}'
WHERE
scope = '{{ scope }}' --required
AND eventSubscriptionName = '{{ eventSubscriptionName }}' --required
RETURNING
id,
name,
properties,
systemData,
type;

DELETE examples

Delete an existing event subscription.

DELETE FROM azure.event_grid.event_subscriptions
WHERE scope = '{{ scope }}' --required
AND eventSubscriptionName = '{{ eventSubscriptionName }}' --required
;