Redigera

Dela via


Add-AzExpressRoutePortAuthorization

Adds an ExpressRoutePort authorization.

Syntax

Add-AzExpressRoutePortAuthorization
   -Name <String>
   -ExpressRoutePortObject <PSExpressRoutePort>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Add-AzExpressRoutePortAuthorization cmdlet adds an authorization to an ExpressRoutePort. The owner of an ExpressRoutePort can create these authorizations which generate an authorization key that can be used by a ExpressRoute circuit owner to create the circuit on the ExpressRoutePort (with a different owner). Only one circuit can be created with one ExpressRoutePort authorization.Add-AzExpressRoutePortAuthorization adds a new authorization to a ExpressRoutePort and, at the same time, generates the corresponding authorization key. These keys can be viewed at any time by running the Get-AzExpressRoutePortAuthorization cmdlet and, as needed, can then be copied and forwarded to the appropriate circuit owner.

Examples

Example 1

$ERPort = Get-AzExpressRoutePort -Name "ContosoPort" -ResourceGroupName "ContosoResourceGroup"

Name                       : ContosoPort
ResourceGroupName          : ContosoResourceGroup
Location                   : westcentralus
Id                         : /subscriptions/62364504-2406-418e-971c-05822ff72fad/resourceGroups/ContosoResourceGroup/pr
                             oviders/Microsoft.Network/expressRoutePorts/ContosoPort
Etag                       : W/"cf987288-013e-40bf-a2aa-b29d017e7b7f"
ResourceGuid               : 4c0e5cdb-79e1-4cb8-a430-0ce9b24472ca
ProvisioningState          : Succeeded
PeeringLocation            : Area51-ERDirect
BandwidthInGbps            : 100
ProvisionedBandwidthInGbps : 0
Encapsulation              : QinQ
Mtu                        : 1500
EtherType                  : 0x8100
AllocationDate             : Thursday, March 31, 2022
Identity                   : null
Links                      : [
                               {
                                 "Name": "link1",
                                 "Etag": "W/\"cf987288-013e-40bf-a2aa-b29d017e7b7f\"",
                                 "Id": "/subscriptions/62364504-2406-418e-971c-05822ff72fad/resourceGroups/ContosoResou
                             rceGroup/providers/Microsoft.Network/expressRoutePorts/ContosoPort/links/link1",
                                 "RouterName": "a51-test-06gmr-cis-3",
                                 "InterfaceName": "HundredGigE15/15/19",
                                 "PatchPanelId": "PP:0123:1110201 - Port 42",
                                 "RackId": "A51 02050-0123-L",
                                 "ConnectorType": "LC",
                                 "AdminState": "Disabled",
                                 "ProvisioningState": "Succeeded",
                                 "MacSecConfig": {
                                   "SciState": "Disabled",
                                   "Cipher": "GcmAes128"
                                 }
                               },
                               {
                                 "Name": "link2",
                                 "Etag": "W/\"cf987288-013e-40bf-a2aa-b29d017e7b7f\"",
                                 "Id": "/subscriptions/62364504-2406-418e-971c-05822ff72fad/resourceGroups/ContosoResou
                             rceGroup/providers/Microsoft.Network/expressRoutePorts/ContosoPort/links/link2",
                                 "RouterName": "a51-test-06gmr-cis-4",
                                 "InterfaceName": "HundredGigE15/15/19",
                                 "PatchPanelId": "2050:0124:1110854 - Port 42",
                                 "RackId": "A51 02050-0124-L",
                                 "ConnectorType": "LC",
                                 "AdminState": "Disabled",
                                 "ProvisioningState": "Succeeded",
                                 "MacSecConfig": {
                                   "SciState": "Disabled",
                                   "Cipher": "GcmAes128"
                                 }
                               }
                             ]
Circuits                   : []

Add-AzExpressRoutePortAuthorization -Name "ContosoPortAuthorization" -ExpressRoutePortObject $ERPort

Name                   : ContosoPortAuthorization
Id                     : /subscriptions/62364504-2406-418e-971c-05822ff72fad/resourceGroups/ContosoResourceGroup/provid
                         ers/Microsoft.Network/expressRoutePorts/ContosoPort/authorizations/ContosoPortAuthorization
Etag                   : W/"36ccc199-c371-4d19-88cc-90d51bfe7ea9"
AuthorizationKey       : 10d01cd7-0b67-4c44-88ca-51e7effa452d
AuthorizationUseStatus : Available
ProvisioningState      : Succeeded
CircuitResourceUri     :

The commands in this example add a new authorization to an existing ExpressRoutePort. The first command uses Get-AzExpressRoutePort to create an object reference to a ExpressRoutePort named ContosoPort. That object reference is stored in a variable named $ERPort. In the second command, the Add-AzExpressRoutePortAuthorization cmdlet is used to add a new authorization (ContosoPortAuthorization) to the ExpressRoutePort.

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

-ExpressRoutePortObject

The ExpressRoutePort Object

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

-Name

Specifies a unique name for the new ExpressRoutePort authorization.

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

Inputs

PSExpressRoutePort

Outputs

PSExpressRoutePortAuthorization