New-AzEventGridDomainKey

Regenerates the shared access key for an Azure Event Grid Domain.

Syntax

New-AzEventGridDomainKey
   [-ResourceGroupName] <String>
   [-DomainName] <String>
   [-Name] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzEventGridDomainKey
   [-Name] <String>
   [-DomainInputObject] <PSDomain>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzEventGridDomainKey
   [-Name] <String>
   [-DomainResourceId] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Regenerates the shared access key for an Azure Event Grid Domain.

Examples

Example 1

Regenerate the key corresponding to key 'key1'\ of Event Grid domain `Domain1` in resource group `MyResourceGroupName`.

New-AzEventGridDomainKey -ResourceGroupName MyResourceGroupName -DomainName Domain1 -Name key1

Key1                                         Key2
----                                         ----
<New Value for Key1>                        <Old Value for Key2>

Example 2

Regenerate the key corresponding to key 'key1'\ of Event Grid domain `Domain1` in resource group `MyResourceGroupName`.

Get-AzEventGridDomain -ResourceGroupName MyResourceGroupName -Name Domain1 | New-AzEventGridTopicKey -KeyName "key1"

Key1                                         Key2
----                                         ----
<New Value for Key1>                        <Old Value for Key2>

Example 3

Regenerate the key corresponding to key 'key2'\ of Event Grid domain `Domain1` in resource group `MyResourceGroupName` using its full resource Id.

New-AzEventGridDomainKey -DomainResourceId /subscriptions/$subscriptionId/resourceGroups/MyResourceGroupName/providers/Microsoft.EventGrid/domains/Domain1 -KeyName Key2

Key1                                         Key2
----                                         ----
<Old Value for Key1>                        <New Value for Key2>

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

-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:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-DomainResourceId

Resource Identifier representing the Event Grid Domain.

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

-Name

The name of the key that needs to be regenerated

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

-ResourceGroupName

The name of the resource group.

Type:String
Aliases:ResourceGroup
Position:0
Default value:None
Required:True
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

String

PSDomain

Outputs

DomainSharedAccessKeys