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 resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
deadLetterDestinationobjectThe dead letter destination of the event subscription. Any event that cannot be delivered to its' destination is sent to the dead letter destination. Uses Azure Event Grid's identity to acquire the authentication tokens being used during delivery / dead-lettering.
deadLetterWithResourceIdentityobjectThe dead letter destination of the event subscription. Any event that cannot be delivered to its' destination is sent to the dead letter destination. Uses the managed identity setup on the parent resource (namely, topic or domain) to acquire the authentication tokens being used during delivery / dead-lettering.
deliveryWithResourceIdentityobjectInformation about the destination where events have to be delivered for the event subscription. Uses the managed identity setup on the parent resource (namely, topic or domain) to acquire the authentication tokens being used during delivery / dead-lettering.
destinationobjectInformation about the destination where events have to be delivered for the event subscription. Uses Azure Event Grid's identity to acquire the authentication tokens being used during delivery / dead-lettering.
eventDeliverySchemastringThe event delivery schema for the event subscription. Known values are: "EventGridSchema", "CustomInputSchema", and "CloudEventSchemaV1_0". (EventGridSchema, CustomInputSchema, CloudEventSchemaV1_0)
expirationTimeUtcstring (date-time)Expiration time of the event subscription.
filterobjectInformation about the filter for the event subscription.
labelsarrayList of user defined labels.
provisioningStatestringProvisioning state of the event subscription. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Canceled", "Failed", and "AwaitingManualAction". (Creating, Updating, Deleting, Succeeded, Canceled, Failed, AwaitingManualAction)
retryPolicyobjectThe retry policy for events. This can be used to configure maximum number of delivery attempts and time to live for events.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
topicstringName of the topic of the event subscription.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_by_resourceselectresource_group_name, provider_namespace, resource_type_name, resource_name, subscription_id$filter, $topList all event subscriptions. List all event subscriptions that have been created for a specific resource.
list_by_domain_topicselectresource_group_name, domain_name, topic_name, subscription_id$filter, $topList all event subscriptions for a specific domain topic. List all event subscriptions that have been created for a specific domain topic.
list_regional_by_resource_group_for_topic_typeselectresource_group_name, location, topic_type_name, subscription_id$filter, $topList all regional event subscriptions under an Azure subscription and resource group for a topic type. List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type.
list_global_by_resource_group_for_topic_typeselectresource_group_name, topic_type_name, subscription_id$filter, $topList all global event subscriptions under a resource group for a topic type. List all global event subscriptions under a resource group for a specific topic type.
list_regional_by_resource_groupselectresource_group_name, location, subscription_id$filter, $topList all regional event subscriptions under an Azure subscription and resource group. List all event subscriptions from the given location under a specific Azure subscription and resource group.
list_regional_by_subscription_for_topic_typeselectlocation, topic_type_name, subscription_id$filter, $topList all regional event subscriptions under an Azure subscription for a topic type. List all event subscriptions from the given location under a specific Azure subscription and topic type.
getselectscope, event_subscription_nameGet an event subscription. Get properties of an event subscription.
list_global_by_resource_groupselectresource_group_name, subscription_id$filter, $topList all global event subscriptions under an Azure subscription and resource group. List all global event subscriptions under a specific Azure subscription and resource group.
list_global_by_subscription_for_topic_typeselecttopic_type_name, subscription_id$filter, $topList all global event subscriptions for a topic type. List all global event subscriptions under an Azure subscription for a topic type.
list_regional_by_subscriptionselectlocation, subscription_id$filter, $topList all regional event subscriptions under an Azure subscription. List all event subscriptions from the given location under a specific Azure subscription.
list_global_by_subscriptionselectsubscription_id$filter, $topGet an aggregated list of all global event subscriptions under an Azure subscription. List all aggregated global event subscriptions under a specific Azure subscription.
create_or_updateinsertscope, event_subscription_nameCreate or update an event subscription. Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope.
updateupdatescope, event_subscription_nameUpdate an event subscription. Asynchronously updates an existing event subscription.
create_or_updatereplacescope, event_subscription_nameCreate or update an event subscription. Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope.
deletedeletescope, event_subscription_nameDelete an event subscription. Delete an existing event subscription.
get_delivery_attributesexecscope, event_subscription_nameGet delivery attributes for an event subscription. Get all delivery attributes for an event subscription.
get_full_urlexecscope, event_subscription_nameGet full URL of an event subscription. Get the full endpoint URL for an 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
domain_namestringName of the top level domain. Required.
event_subscription_namestringName of the event subscription to be found. Required.
locationstringThe location name. Required.
provider_namespacestringNamespace of the provider of the topic. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
resource_namestringName of the resource. Required.
resource_type_namestringName of the resource type. Required.
scopestringundefined. Required.
subscription_idstring
topic_namestringName of the domain topic. Required.
topic_type_namestringName of the topic type. Required.
$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'. Default value is None.
$topintegerThe 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. Default value is None.

SELECT examples

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

SELECT
id,
name,
deadLetterDestination,
deadLetterWithResourceIdentity,
deliveryWithResourceIdentity,
destination,
eventDeliverySchema,
expirationTimeUtc,
filter,
labels,
provisioningState,
retryPolicy,
systemData,
topic,
type
FROM azure.event_grid.event_subscriptions
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND provider_namespace = '{{ provider_namespace }}' -- required
AND resource_type_name = '{{ resource_type_name }}' -- required
AND resource_name = '{{ resource_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $filter = '{{ $filter }}'
AND $top = '{{ $top }}'
;

INSERT examples

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

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

UPDATE examples

Update an event subscription. Asynchronously updates an existing event subscription.

UPDATE azure.event_grid.event_subscriptions
SET
destination = '{{ destination }}',
deliveryWithResourceIdentity = '{{ deliveryWithResourceIdentity }}',
filter = '{{ filter }}',
labels = '{{ labels }}',
expirationTimeUtc = '{{ expirationTimeUtc }}',
eventDeliverySchema = '{{ eventDeliverySchema }}',
retryPolicy = '{{ retryPolicy }}',
deadLetterDestination = '{{ deadLetterDestination }}',
deadLetterWithResourceIdentity = '{{ deadLetterWithResourceIdentity }}'
WHERE
scope = '{{ scope }}' --required
AND event_subscription_name = '{{ event_subscription_name }}' --required
RETURNING
id,
name,
properties,
systemData,
type;

REPLACE examples

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

REPLACE azure.event_grid.event_subscriptions
SET
properties = '{{ properties }}'
WHERE
scope = '{{ scope }}' --required
AND event_subscription_name = '{{ event_subscription_name }}' --required
RETURNING
id,
name,
properties,
systemData,
type;

DELETE examples

Delete an event subscription. Delete an existing event subscription.

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

Lifecycle Methods

Get delivery attributes for an event subscription. Get all delivery attributes for an event subscription.

EXEC azure.event_grid.event_subscriptions.get_delivery_attributes 
@scope='{{ scope }}' --required,
@event_subscription_name='{{ event_subscription_name }}' --required
;