Get-AzEventGridSubscription

Gets the details of an event subscription, or gets a list of all event subscriptions in the current Azure subscription.

Syntax

Get-AzEventGridSubscription
   [-EventSubscriptionName <String>]
   [-ResourceGroupName <String>]
   [-TopicName <String>]
   [-IncludeFullEndpointUrl]
   [-ODataQuery <String>]
   [-Top <Int32>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzEventGridSubscription
   [-EventSubscriptionName <String>]
   [-ResourceId] <String>
   [-IncludeFullEndpointUrl]
   [-ODataQuery <String>]
   [-Top <Int32>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzEventGridSubscription
   [-EventSubscriptionName <String>]
   [-ResourceGroupName <String>]
   [-DomainName <String>]
   [-DomainTopicName <String>]
   [-IncludeFullEndpointUrl]
   [-ODataQuery <String>]
   [-Top <Int32>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzEventGridSubscription
   [-ResourceGroupName <String>]
   [-TopicTypeName <String>]
   [-Location <String>]
   [-IncludeFullEndpointUrl]
   [-ODataQuery <String>]
   [-Top <Int32>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzEventGridSubscription
   [-InputObject] <PSTopic>
   [-ODataQuery <String>]
   [-Top <Int32>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzEventGridSubscription
   [-DomainInputObject] <PSDomain>
   [-ODataQuery <String>]
   [-Top <Int32>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzEventGridSubscription
   [-DomainTopicInputObject] <PSDomainTopic>
   [-ODataQuery <String>]
   [-Top <Int32>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzEventGridSubscription
   [-NextLink <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Get-AzEventGridSubscription cmdlet gets either the details of a specified Event Grid subscription, or a list of all Event Grid subscriptions in the current Azure subscription or resource group. If the event subscription name is provided, the details of a single Event Grid subscription is returned. If the event subscription name is not provided, a list of all event subscriptions is returned. The number of elements returned in this list is controlled by the Top parameter. If the Top value is not specified or $null, the list will contain all the event subscription items. Otherwise, Top will indicate the maximum number of elements to be returned in the list. If more event subscriptions are still available, the value in NextLink should be used in the next call to get the next page of event subscriptions. Finally, ODataQuery parameter is used to perform filtering for the search results. The filtering query follows OData syntax using the Name property only. The supported operations include: CONTAINS, eq (for equal), ne (for not equal), AND, OR and NOT.

Examples

Example 1

Get-AzEventGridSubscription -ResourceGroupName MyResourceGroupName -TopicName Topic1 -EventSubscriptionName EventSubscription1

Gets the details of event subscription `EventSubscription1` created for topic `Topic1` in resource group `MyResourceGroupName`.

Example 2

Get-AzEventGridSubscription -ResourceGroupName MyResourceGroupName -TopicName Topic1 -EventSubscriptionName EventSubscription1 -IncludeFullEndpointUrl

Gets the details of event subscription `EventSubscription1` created for topic `Topic1` in resource group `MyResourceGroupName`, including the full endpoint URL if it is a webhook based event subscription.

Example 3

Get-AzEventGridSubscription -ResourceGroupName MyResourceGroupName -TopicName Topic1

Get a list of all the event subscriptions created for topic `Topic1` in resource group `MyResourceGroupName` without pagination.

Example 4

$odataFilter = "Name ne 'ABCD'"
Get-AzEventGridSubscription -ResourceGroupName MyResourceGroupName -TopicName Topic1 -Top 10 -ODataQuery $odataFilter
Get-AzEventGridSubscription $result.NextLink

List the first 10 event subscriptions (if any) created for topic `Topic1` in resource group `MyResourceGroupName` that satisfies the $odataFilter query. If more results are available, the $result.NextLink will not be $null. In order to get next page(s) of event subscriptions, user is expected to re-call Get-AzEventGridSubscription and uses result.NextLink obtained from the previous call. Caller should stop when result.NextLink becomes $null.

Example 5

Get-AzEventGridSubscription -ResourceGroupName MyResourceGroupName -EventSubscriptionName EventSubscription1

Gets the details of event subscription `EventSubscription1` created for resource group `MyResourceGroupName`.

Example 6

Get-AzEventGridSubscription -EventSubscriptionName EventSubscription1

Gets the details of event subscription `EventSubscription1` created for the currently selected Azure subscription.

Example 7

Get-AzEventGridSubscription -ResourceGroupName MyResourceGroupName

Gets the list of all global event subscriptions created under the resource group `MyResourceGroupName` without pagination.

Example 8

$odataFilter = "Name ne 'ABCD'"
Get-AzEventGridSubscription -ResourceGroupName MyResourceGroupName -Top 5 -ODataQuery $odataFilter
Get-AzEventGridSubscription $result.NextLink

List the first 5 event subscriptions (if any) created under resource group `MyResourceGroupName` that satisfies the $odataFilter query. If more results are available, the $result.NextLink will not be $null. In order to get next page(s) of event subscriptions, user is expected to re-call Get-AzEventGridSubscription and uses result.NextLink obtained from the previous call. Caller should stop when result.NextLink becomes $null.

Example 9

Get-AzEventGridSubscription

Gets the list of all global event subscriptions created under the currently selected Azure subscription without pagination.

Example 10

$odataFilter = "Name ne 'ABCD'"
Get-AzEventGridSubscription -Top 15 -ODataQuery $odataFilter
Get-AzEventGridSubscription $result.NextLink

List the first 15 global event subscriptions (if any) created under the currently selected Azure subscription that satisfies the $odataFilter query. If more results are available, the $result.NextLink will not be $null. In order to get next page(s) of event subscriptions, user is expected to re-call Get-AzEventGridSubscription and uses result.NextLink obtained from the previous call. Caller should stop when result.NextLink becomes $null.

Example 11

Get-AzEventGridSubscription -ResourceGroupName MyResourceGroupName -Location westus2

Gets the list of all regional event subscriptions created under resource group `MyResourceGroupName` in the specified location `westus2` without pagination.

Example 12

$odataFilter = "Name ne 'ABCD'"
Get-AzEventGridSubscription -ResourceGroupName MyResourceGroupName -Location westus2 -Top 15 -ODataQuery $odataFilter
Get-AzEventGridSubscription $result.NextLink

List the first 15 regional event subscriptions (if any) created under resource group `MyResourceGroupName` in the specified location `westus2` that satisfies the $odataFilter query. If more results are available, the $result.NextLink will not be $null. In order to get next page(s) of event subscriptions, user is expected to re-call Get-AzEventGridSubscription and uses result.NextLink obtained from the previous call. Caller should stop when result.NextLink becomes $null.

Example 13

Get-AzEventGridSubscription -ResourceId "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.EventHub/namespaces/$namespaceName"

Gets the list of all event subscriptions created for the specified EventHub namespace without pagination.

Example 14

$odataFilter = "Name ne 'ABCD'"
Get-AzEventGridSubscription -ResourceId "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.EventHub/namespaces/$namespaceName" -Top 25 -ODataQuery $odataFilter
Get-AzEventGridSubscription $result.NextLink

List the first 25 event subscriptions (if any) created for the specified EventHub namespace that satisfies the $odataFilter query. If more results are available, the $result.NextLink will not be $null. In order to get next page(s) of event subscriptions, user is expected to re-call Get-AzEventGridSubscription and uses result.NextLink obtained from the previous call. Caller should stop when result.NextLink becomes $null.

Example 15

Get-AzEventGridSubscription -TopicTypeName "Microsoft.EventHub.Namespaces" -Location $location

Gets the list of all event subscriptions created for the specified topic type (EventHub namespaces) in the specified location without pagination.

Example 16

$odataFilter = "Name ne 'ABCD'"
Get-AzEventGridSubscription -TopicTypeName "Microsoft.EventHub.Namespaces" -Location $location -Top 15 -ODataQuery $odataFilter
Get-AzEventGridSubscription $result.NextLink

List the first 15 event subscriptions (if any) created for the specified topic type (EventHub namespaces) in the specified location that satisfies the $odataFilter query. If more results are available, the $result.NextLink will not be $null. In order to get next page(s) of event subscriptions, user is expected to re-call Get-AzEventGridSubscription and uses result.NextLink obtained from the previous call. Caller should stop when result.NextLink becomes $null.

Example 17

Get-AzEventGridSubscription -TopicTypeName "Microsoft.Resources.ResourceGroups" -ResourceGroupName MyResourceGroupName

Gets the list of all event subscriptions created for the specific resource group without pagination.

Example 18

$odataFilter = "Name ne 'ABCD'"
Get-AzEventGridSubscription -TopicTypeName "Microsoft.Resources.ResourceGroups" -ResourceGroupName MyResourceGroupName -Top 100 -ODataQuery $odataFilter
Get-AzEventGridSubscription $result.NextLink

List the first 100 event subscriptions (if any) created for the specific resource group that satisfies the $odataFilter query. If more results are available, the $result.NextLink will not be $null. In order to get next page(s) of event subscriptions, user is expected to re-call Get-AzEventGridSubscription and uses result.NextLink obtained from the previous call. Caller should stop when result.NextLink becomes $null.

Parameters

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DomainInputObject

EventGrid Domain object.

Type:PSDomain
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-DomainName

EventGrid domain name.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-DomainTopicInputObject

EventGrid Domain Topic object.

Type:PSDomainTopic
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-DomainTopicName

EventGrid domain topic name.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-EventSubscriptionName

The name of the event subscription

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-IncludeFullEndpointUrl

Include the full endpoint URL of the event subscription destination.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

EventGrid Topic object.

Type:PSTopic
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Location

Location

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

The link for the next page of resources to be obtained. This value is obtained with the first Get-AzEventGrid cmdlet call when more resources are still available to be queried.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ODataQuery

The OData query used for filtering the list results. Filtering is currently allowed on the Name property only.The supported operations include: CONTAINS, eq (for equal), ne (for not equal), AND, OR and NOT.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

Resource Group Name.

Type:String
Aliases:ResourceGroup
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ResourceId

Identifier of the resource to which event subscriptions have been created.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Top

The OData query used for filtering the list results. Filtering is currently allowed on the Name property only.The supported operations include: CONTAINS, eq (for equal), ne (for not equal), AND, OR and NOT.

Type:Nullable<T>[Int32]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-TopicName

EventGrid Topic Name.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-TopicTypeName

TopicType name

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

Inputs

String

PSTopic

PSDomain

PSDomainTopic

Nullable<T>[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

Outputs

PSEventSubscription