New-AzEventHubKey
Creates a new primary or secondary key for the specified Event Hubs authorization rule.
Syntax
NamespaceAuthorizationRuleSet (Default)
New-AzEventHubKey
[-ResourceGroupName] <String>
[-Namespace] <String>
[-Name] <String>
[-RegenerateKey] <String>
[[-KeyValue] <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
EventhubAuthorizationRuleSet
New-AzEventHubKey
[-ResourceGroupName] <String>
[-Namespace] <String>
[-EventHub] <String>
[-Name] <String>
[-RegenerateKey] <String>
[[-KeyValue] <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The New-AzEventHubKey cmdlet regenerates the primary or secondary SAS key for the specified Event Hubs authorization rule.
Examples
Example 1.1 - Namespace - AuthorizationRule PrimaryKey
PS C:\> New-AzEventHubKey -ResourceGroup MyResourceGroupName -Namespace MyNamespaceName -Name MyAuthRuleName -RegenerateKey PrimaryKey
Regenerates the primary key for the authorization rule `MyAuthRuleName`.
Example 1.2 - EventHub - AuthorizationRule PrimaryKey
PS C:\> New-AzEventHubKey -ResourceGroup MyResourceGroupName -Namespace MyNamespaceName -EventHub MyEventHubName -Name MyAuthRuleName -RegenerateKey PrimaryKey
Regenerates the primary key for the authorization rule `MyAuthRuleName`.
Example 2.1 - Namespace - AuthorizationRule SecondaryKey
PS C:\> New-AzEventHubKey -ResourceGroup MyResourceGroupName -Namespace MyNamespaceName -Name MyAuthRuleName -RegenerateKey SecondaryKey
Example 2.2 - EventHub - AuthorizationRule SecondaryKey
PS C:\> New-AzEventHubKey -ResourceGroup MyResourceGroupName -Namespace MyNamespaceName -EventHub MyEventHubName -Name MyAuthRuleName -RegenerateKey SecondaryKey
Regenerates the secondary key for the authorization rule `MyAuthRuleName`.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: cf
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
Type: IAzureContextContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzContext, AzureRmContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-EventHub
EventHub Name
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: EventHubName
Parameter sets
EventhubAuthorizationRuleSet
Position: 2
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-KeyValue
A base64-encoded 256-bit key for signing and validating the SAS token.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: 5
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Name
AuthorizationRule Name
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AuthorizationRuleName
Parameter sets
(All)
Position: 3
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-Namespace
Namespace Name
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: NamespaceName
Parameter sets
(All)
Position: 1
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-RegenerateKey
Regenerate Keys - 'PrimaryKey'/'SecondaryKey'
Parameter properties
Type: String
Default value: None
Accepted values: PrimaryKey, SecondaryKey
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: 4
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ResourceGroupName
Resource Group Name
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: ResourceGroup
Parameter sets
(All)
Position: 0
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: wi
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Outputs