New-AzRelayKey

Regenerates the primary or secondary connection strings to the namespace.

Syntax

New-AzRelayKey
   -Name <String>
   -Namespace <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   -RegenerateKey <KeyType>
   [-KeyValue <String>]
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzRelayKey
   -Name <String>
   -Namespace <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   -HybridConnection <String>
   -RegenerateKey <KeyType>
   [-KeyValue <String>]
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzRelayKey
   -Name <String>
   -Namespace <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   -WcfRelay <String>
   -RegenerateKey <KeyType>
   [-KeyValue <String>]
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Regenerates the primary or secondary connection strings to the namespace.

Examples

Example 1: Regenerates the primary or secondary connection strings for the given Relay namespace

New-AzRelayKey -ResourceGroupName lucas-relay-rg -Namespace namespace-pwsh01 -Name authRule-01 -RegenerateKey 'PrimaryKey'

KeyName     PrimaryConnectionString
-------     -----------------------                                                                                                                          
authRule-01 Endpoint=sb://namespace-pwsh01.servicebus.windows.net/;SharedAccessKeyName=authRule-01;SharedAccessKey=xxxxxxxxxxxxxxxxx

This cmdlet regenerates the primary or secondary connection strings for the given Relay namespace.

Example 2: Regenerates the primary or secondary connection strings for the given Hybrid Connection

New-AzRelayKey -ResourceGroupName lucas-relay-rg -Namespace namespace-pwsh01 -HybridConnection connection-01  -Name authRule-01 -RegenerateKey 'PrimaryKey'

KeyName     PrimaryConnectionString
-------     -----------------------                                                                                                                          
authRule-01 Endpoint=sb://namespace-pwsh01.servicebus.windows.net/;SharedAccessKeyName=authRule-01;SharedAccessKey=xxxxxxxxxxxxxxxxx

This cmdlet regenerates the primary or secondary connection strings for the given Hybrid Connection.

Example 3: Regenerates the primary or secondary connection strings for the given Wcf Relay

New-AzRelayKey -ResourceGroupName lucas-relay-rg -Namespace namespace-pwsh01 -WcfRelay wcf-01  -Name authRule-01 -RegenerateKey 'PrimaryKey'

KeyName     PrimaryConnectionString
-------     -----------------------                                                                                                                          
authRule-01 Endpoint=sb://namespace-pwsh01.servicebus.windows.net/;SharedAccessKeyName=authRule-01;SharedAccessKey=xxxxxxxxxxxxxxxxx

This cmdlet regenerates the primary or secondary connection strings for the given Wcf Relay.

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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-HybridConnection

The hybrid connection name.

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

-KeyValue

Optional. If the key value is provided, this is set to key type, or autogenerated key value set for key type.

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

-Name

The authorization rule name.

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

-Namespace

The namespace name

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

-RegenerateKey

The access key to regenerate.

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

-ResourceGroupName

Name of the Resource group within the Azure subscription.

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

-SubscriptionId

Subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

Type:String
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WcfRelay

The relay name.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
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

Outputs

IAccessKeys