New-AzPeeringAsn

Creates a new peer ASN or updates an existing peer ASN with the specified name under the given subscription.

Syntax

New-AzPeeringAsn
   -Name <String>
   [-SubscriptionId <String>]
   [-PeerAsn <Int32>]
   [-PeerContactDetail <IContactDetail[]>]
   [-PeerName <String>]
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Creates a new peer ASN or updates an existing peer ASN with the specified name under the given subscription.

Examples

Example 1: Create a new peering asn

$contactDetail = New-AzPeeringContactDetailObject -Email "abc@xyz.com" -Phone 1234567890 -Role "Noc"
$PeerContactList = ,$contactDetail
New-AzPeeringAsn -Name PsTestAsn -PeerAsn 65001 -PeerContactDetail $PeerContactList -PeerName DemoPeering

Name      PeerName    PropertiesPeerAsn ValidationState PeerContactDetail
----      --------    ----------------- --------------- -----------------
PsTestAsn DemoPeering 65001             Pending         {{…

Create a new peering asn with the specified properties

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

-Name

The peer ASN name.

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

-PeerAsn

The Autonomous System Number (ASN) of the peer.

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

-PeerContactDetail

The contact details of the peer. To construct, see NOTES section for PEERCONTACTDETAIL properties and create a hash table.

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

-PeerName

The name of the peer.

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

-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

IPeerAsn