編輯

共用方式為


New-AzPeering

Creates a new peering or updates an existing peering with the specified name under the given subscription and resource group.

Syntax

New-AzPeering
   -Name <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   -Kind <Kind>
   -Location <String>
   [-DirectConnection <IDirectConnection[]>]
   [-DirectPeerAsnId <String>]
   [-DirectPeeringType <DirectPeeringType>]
   [-ExchangeConnection <IExchangeConnection[]>]
   [-ExchangePeerAsnId <String>]
   [-PeeringLocation <String>]
   [-Sku <String>]
   [-Tag <Hashtable>]
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Creates a new peering or updates an existing peering with the specified name under the given subscription and resource group.

Examples

Example 1: Create a new direct peering object

$peerAsnId = "/subscriptions/{subId}/providers/Microsoft.Peering/peerAsns/ContosoEdgeTest"
$directConnections = New-AzPeeringDirectConnectionObject -BandwidthInMbps 10000 -BgpSessionMaxPrefixesAdvertisedV4 20000

New-AzPeering -Name TestPeeringPs -ResourceGroupName DemoRG -Kind Direct -Location "South Central US" -DirectConnection $directConnections -DirectPeeringType Cdn -DirectPeerAsnId $peerAsnId -PeeringLocation Dallas -Sku Premium_Direct_Unlimited

Name        SkuName                  Kind   PeeringLocation ProvisioningState Location
----        -------                  ----   --------------- ----------------- --------
TestPeering Premium_Direct_Unlimited Direct Dallas          Succeeded         South Central US

Create a new direct peering object

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

-DirectConnection

The set of connections that constitute a direct peering. To construct, see NOTES section for DIRECTCONNECTION properties and create a hash table.

Type:IDirectConnection[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DirectPeerAsnId

The identifier of the referenced resource.

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

-DirectPeeringType

The type of direct peering.

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

-ExchangeConnection

The set of connections that constitute an exchange peering. To construct, see NOTES section for EXCHANGECONNECTION properties and create a hash table.

Type:IExchangeConnection[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ExchangePeerAsnId

The identifier of the referenced resource.

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

-Kind

The kind of the peering.

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

-Location

The location of the resource.

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

-Name

The name of the peering.

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

-PeeringLocation

The location of the peering.

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

-ResourceGroupName

The name of the resource group.

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

-Sku

The name of the peering SKU.

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

-SubscriptionId

The Azure subscription ID.

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

-Tag

The resource tags.

Type:Hashtable
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

Outputs

IPeering