Skip to main content

topics

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

Overview

Nametopics
TypeResource
Idazure.event_grid.topics

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.
descriptionstringDescription of the event type.
displayNamestringDisplay name of the event type.
isInDefaultSetbooleanIsInDefaultSet flag of the event type.
schemaUrlstringURL of the schema for this event type.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
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_event_typesselectresource_group_name, provider_namespace, resource_type_name, resource_name, subscription_idList topic event types. List event types for a topic.
getselectresource_group_name, topic_name, subscription_idGet a topic. Get properties of a topic.
list_by_resource_groupselectresource_group_name, subscription_id$filter, $topList topics under a resource group. List all the topics under a resource group.
list_by_subscriptionselectsubscription_id$filter, $topList topics under an Azure subscription. List all the topics under an Azure subscription.
create_or_updateinsertresource_group_name, topic_name, subscription_id, locationCreate a topic. Asynchronously creates a new topic with the specified parameters.
updateupdateresource_group_name, topic_name, subscription_idUpdate a topic. Asynchronously updates a topic with the specified parameters.
create_or_updatereplaceresource_group_name, topic_name, subscription_id, locationCreate a topic. Asynchronously creates a new topic with the specified parameters.
deletedeleteresource_group_name, topic_name, subscription_idDelete a topic. Delete existing topic.
list_shared_access_keysexecresource_group_name, topic_name, subscription_idList keys for a topic. List the two keys used to publish to a topic.
regenerate_keyexecresource_group_name, topic_name, subscription_id, keyNameRegenerate key for a topic. Regenerate a shared access key for a topic.

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
provider_namespacestringthe provider namespace. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
resource_namestringName of the topic. Required.
resource_type_namestringName of the topic type. Required.
subscription_idstring
topic_namestringName of the topic. 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 topic event types. List event types for a topic.

SELECT
id,
name,
description,
displayName,
isInDefaultSet,
schemaUrl,
systemData,
type
FROM azure.event_grid.topics
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
;

INSERT examples

Create a topic. Asynchronously creates a new topic with the specified parameters.

INSERT INTO azure.event_grid.topics (
tags,
location,
properties,
sku,
identity,
kind,
extendedLocation,
resource_group_name,
topic_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ sku }}',
'{{ identity }}',
'{{ kind }}',
'{{ extendedLocation }}',
'{{ resource_group_name }}',
'{{ topic_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
extendedLocation,
identity,
kind,
location,
properties,
sku,
systemData,
tags,
type
;

UPDATE examples

Update a topic. Asynchronously updates a topic with the specified parameters.

UPDATE azure.event_grid.topics
SET
tags = '{{ tags }}',
identity = '{{ identity }}',
properties = '{{ properties }}',
sku = '{{ sku }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND topic_name = '{{ topic_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
extendedLocation,
identity,
kind,
location,
properties,
sku,
systemData,
tags,
type;

REPLACE examples

Create a topic. Asynchronously creates a new topic with the specified parameters.

REPLACE azure.event_grid.topics
SET
tags = '{{ tags }}',
location = '{{ location }}',
properties = '{{ properties }}',
sku = '{{ sku }}',
identity = '{{ identity }}',
kind = '{{ kind }}',
extendedLocation = '{{ extendedLocation }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND topic_name = '{{ topic_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND location = '{{ location }}' --required
RETURNING
id,
name,
extendedLocation,
identity,
kind,
location,
properties,
sku,
systemData,
tags,
type;

DELETE examples

Delete a topic. Delete existing topic.

DELETE FROM azure.event_grid.topics
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND topic_name = '{{ topic_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

List keys for a topic. List the two keys used to publish to a topic.

EXEC azure.event_grid.topics.list_shared_access_keys 
@resource_group_name='{{ resource_group_name }}' --required,
@topic_name='{{ topic_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;