New-AzEventGridTopic
Creates a new Azure Event Grid Topic.
Syntax
New-AzEventGridTopic
[-ResourceGroupName] <String>
[-Name] <String>
[-Location] <String>
[-Tag <Hashtable>]
[-InputSchema <String>]
[-InputMappingField <Hashtable>]
[-InputMappingDefaultValue <Hashtable>]
[-InboundIpRule <Hashtable>]
[-IdentityType <String>]
[-IdentityId <String[]>]
[-PublicNetworkAccess <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Creates a new Azure Event Grid Topic. Once the topic is created, an application can publish events to the topic endpoint.
Examples
Example 1
New-AzEventGridTopic -ResourceGroupName MyResourceGroupName -Name Topic1 -Location westus2
Creates an Event Grid topic `Topic1` in the specified geographic location `westus2`, in resource group `MyResourceGroupName`.
Example 2
New-AzEventGridTopic -ResourceGroupName MyResourceGroupName -Name Topic1 -Location westus2 -Tag @{ Department="Finance"; Environment="Test" }
Creates an Event Grid topic `Topic1` in the specified geographic location `westus2`, in resource group `MyResourceGroupName` with the specified tags "Department" and "Environment".
Example 3
New-AzEventGridTopic -ResourceGroupName MyResourceGroupName -Name Topic1 -Location westus2 -IdentityType "SystemAssigned"
Creates an Event Grid topic `Topic1` in the specified geographic location `westus2`, in resource group `MyResourceGroupName` with `SystemAssigned` identity type.
Example 4
$id1 = '/subscriptions/{subscriptionId}/resourceGroups/{resourcegroup}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MSIName'
$id2 = '/subscriptions/{subscriptionId}/resourceGroups/{resourcegroup}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MSIName'
New-AzEventGridTopic -ResourceGroupName MyResourceGroupName -Name Topic1 -Location westus2 -IdentityType "UserAssigned" -IdentityId $id1,$id2
Creates an Event Grid topic `Topic1` in the specified geographic location `westus2`, in resource group `MyResourceGroupName` with `UserAssigned` identity type with given identity ids.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-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 |
-IdentityId
The list of user assigned identities
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-IdentityType
Different identity types. Could be either of following 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'
Type: | String |
Accepted values: | SystemAssigned, UserAssigned, SystemAssigned, UserAssigned, None |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-InboundIpRule
Hashtable which represents list of inbound IP rules. Each rule specifies the IP Address in CIDR notation e.g., 10.0.0.0/8 along with the corresponding Action to be performed based on the match or no match of the IpMask. Possible Action values include Allow only
Type: | Hashtable |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-InputMappingDefaultValue
Hashtable which represents the input mapping fields with default value in space separated key = value format. Allowed key names are: subject, eventtype, and dataversion. This is used when InputSchemaHelp is customeventschema only.
Type: | Hashtable |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-InputMappingField
Hashtable which represents the input mapping fields in space separated key = value format. Allowed key names are: id, topic, eventtime, subject, eventtype, and dataversion. This is used when InputSchemaHelp is customeventschema only.
Type: | Hashtable |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-InputSchema
The schema of the input events for the topic. Allowed values are: eventgridschema, customeventschema, or cloudeventv01Schema. Default value is eventgridschema. Note that if customeventschema is specified, then InputMappingField or/and InputMappingDefaultValue parameters need to be specified as well.
Type: | String |
Accepted values: | EventGridSchema, CustomEventSchema, CloudEventSchemaV1_0 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Location
The location of the topic
Type: | String |
Position: | 2 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
The name of the topic.
Type: | String |
Aliases: | TopicName |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-PublicNetworkAccess
This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific IPs by configuring InboundIpRule parameters. Allowed values are disabled and enabled.
Type: | String |
Accepted values: | enabled, disabled |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ResourceGroupName
The resource group in which the topic should be created.
Type: | String |
Aliases: | ResourceGroup |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Tag
Hashtables which represents resource Tags.
Type: | Hashtable |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Outputs
Azure PowerShell
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for