New-AzRelayHybridConnection
Creates or updates a service hybrid connection. This operation is idempotent.
Syntax
New-AzRelayHybridConnection
-Name <String>
-Namespace <String>
-ResourceGroupName <String>
[-SubscriptionId <String>]
[-RequiresClientAuthorization]
[-UserMetadata <String>]
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzRelayHybridConnection
-Name <String>
-Namespace <String>
-ResourceGroupName <String>
[-SubscriptionId <String>]
-InputObject <IHybridConnection>
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Creates or updates a service hybrid connection. This operation is idempotent.
Examples
Example 1: Creates a Hybrid Connection in the specified Relay namespace
New-AzRelayHybridConnection -ResourceGroupName lucas-relay-rg -Namespace namespace-pwsh01 -Name connection-01 -UserMetadata "test 01" | Format-List
CreatedAt : 1/1/0001 12:00:00 AM
Id : /subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-relay-rg/providers/Microso
ft.Relay/namespaces/namespace-pwsh01/hybridconnections/connection-01
ListenerCount : 0
Location : eastus
Name : connection-01
RequiresClientAuthorization : True
ResourceGroupName : lucas-relay-rg
SystemDataCreatedAt :
SystemDataCreatedBy :
SystemDataCreatedByType :
SystemDataLastModifiedAt :
SystemDataLastModifiedBy :
SystemDataLastModifiedByType :
Type : Microsoft.Relay/namespaces/hybridconnections
UpdatedAt : 1/1/0001 12:00:00 AM
UserMetadata :
This cmdlet creates a Hybrid Connection in the specified Relay namespace.
Example 2: Create a new Hybrid Connection using an existing Hybrid Connection as a parameter
$connection = Get-AzRelayHybridConnection -ResourceGroupName lucas-relay-rg -Namespace namespace-pwsh01 -Name connection-01
$connection.RequiresClientAuthorization = $false
New-AzRelayHybridConnection -ResourceGroupName lucas-relay-rg -Namespace namespace-pwsh01 -Name connection-02 -InputObject $connection | Format-List
CreatedAt : 12/20/2022 9:13:18 AM
Id : /subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-relay-rg/providers/Microsoft.Relay/namespaces/namespa
ce-pwsh01/hybridconnections/connection-02
ListenerCount : 0
Location : eastus
Name : connection-02
RequiresClientAuthorization : False
ResourceGroupName : lucas-relay-rg
SystemDataCreatedAt :
SystemDataCreatedBy :
SystemDataCreatedByType :
SystemDataLastModifiedAt :
SystemDataLastModifiedBy :
SystemDataLastModifiedByType :
Type : Microsoft.Relay/namespaces/hybridconnections
UpdatedAt : 12/20/2022 9:13:18 AM
UserMetadata : test 03
This cmdlet creates a new Hybrid Connection using an existing Hybrid Connection as a parameter.
Example 3: Update an existing Hybrid Connection
$connection = Get-AzRelayHybridConnection -ResourceGroupName lucas-relay-rg -Namespace namespace-pwsh01 -Name connection-02
$connection.UserMetadata = "TestHybirdConnection2"
New-AzRelayHybridConnection -ResourceGroupName lucas-relay-rg -Namespace namespace-pwsh01 -Name connection-02 -InputObject $connection | Format-List
CreatedAt : 1/1/0001 12:00:00 AM
Id : /subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-relay-rg/providers/Microsoft.Relay/namespaces/namespa
ce-pwsh01/hybridconnections/connection-02
ListenerCount : 0
Location : eastus
Name : connection-02
RequiresClientAuthorization : False
ResourceGroupName : lucas-relay-rg
SystemDataCreatedAt :
SystemDataCreatedBy :
SystemDataCreatedByType :
SystemDataLastModifiedAt :
SystemDataLastModifiedBy :
SystemDataLastModifiedByType :
Type : Microsoft.Relay/namespaces/hybridconnections
UpdatedAt : 1/1/0001 12:00:00 AM
UserMetadata : TestHybirdConnection2
This cmdlet updates an existing Hybrid Connection.
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 |
-InputObject
Description of hybrid connection resource. To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
Type: | IHybridConnection |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
The hybrid connection name.
Type: | String |
Aliases: | HybridConnectionName |
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 |
-RequiresClientAuthorization
Returns true if client authorization is needed for this hybrid connection; otherwise, false.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
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 |
-UserMetadata
The usermetadata is a placeholder to store user-defined string data for the hybrid connection endpoint. For example, it can be used to store descriptive data, such as a list of teams and their contact information. Also, user-defined configuration settings can be stored.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
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 |
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