Skip to content

Conversation

@dedhar
Copy link
Contributor

@dedhar dedhar commented May 2, 2018

Description

This PR adds support for Add, New, Set, Remove, Get CmdLet for Express Route Circuit Connection Resource. Express Route Circuit Connection would be a child of Express Route Peering resource and grand child of Express Route Circuit Resource. Customers would be required to create both Express Route Circuits and Private Peerings on them before creating a Circuit Connection Resource to peer two Express Route Circuits.

Checklist

@dedhar
Copy link
Contributor Author

dedhar commented May 2, 2018

Tested End to End on NRP Slice : "\scratch2\scratch\dedhar\pstesting.txt"
Let me know if you need more information.

@dedhar
Copy link
Contributor Author

dedhar commented May 2, 2018

@dedhar
Copy link
Contributor Author

dedhar commented May 2, 2018

do I need to update this file since we are adding new commands ? https://github.com/Azure/azure-powershell/blob/preview/src/ResourceManager/Network/ChangeLog.md -- Done fixed in latest commit

@maddieclayton
Copy link
Contributor

@dedhar Yes, please update the changelog. Please also fill out a cmdlet review here: https://github.com/Azure/azure-powershell-cmdlet-review-pr

@dedhar
Copy link
Contributor Author

dedhar commented May 3, 2018

Started filling out cmdlet review here : https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/66

@dedhar
Copy link
Contributor Author

dedhar commented May 3, 2018

Can someone from PS Team please review this https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/66

@dedhar
Copy link
Contributor Author

dedhar commented May 4, 2018

@maddieclayton / @markcowl : do you have any comments?

@vladimir-shcherbakov
Copy link
Contributor

vladimir-shcherbakov commented May 8, 2018

@dedhar You have ci-build failure and merge conflict.

@dedhar
Copy link
Contributor Author

dedhar commented May 8, 2018

Fix the build failure related to unwanted changes to common.ps1

@markcowl markcowl removed this from the 2018-05-18 milestone May 9, 2018
}

[Fact(Skip = "Express Route Circuits need to be manually provisioned by Service Providers and the whole setup can't be automated.")]
[Trait(Category.AcceptanceType, Category.CheckIn)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why include the test and skip it right away?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Today to enable Azure Private Peering on an Express Route Circuit, a service provider needs to mark the Circuit as provisioned which is a manual step. we are planning to add a check in backend server code to skip this check so that PS tests can be automated. The fix is merged but yet to be rolled. Once the change is rolled we will fix the test for Circuit Connection.

{
"Entries": [
{
"RequestUri": "/subscriptions/8c992d64-fce9-426d-b278-85642dfeab03/resourceGroups/dedharpspeer/providers/Microsoft.Network/expressRouteCircuits/dedharcktpeer?api-version=2018-02-01",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need the recorded file if you skip the test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the recorded file to store the output for circuit connection creation and deletion commands

#>
function Test-ExpressRouteCircuitConnectionCRUD
{
$circuitName = "dedharcktpeer"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need the test if you skip it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a test for future reference so that we fix the test case once the backend code is released.

HelpMessage = "Express Route Circuit Peering intiating connection")]
[ValidateNotNullOrEmpty]
public PSExpressRouteCircuit ExpressRouteCircuit { get; set; }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add-AzureRmExpressRouteCircuitConnectionConfig [-Name] [-ExpressRouteCircuit] [-PeerExpressRouteCircuitPeering] [-AddressPrefix] [[-AuthorizationKey] ]

ExpressRouteCircuit parameter is declared as required positional - please add a position.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

HelpMessage = "Express Route Circuit Peering intiating connection")]
[ValidateNotNullOrEmpty]
public PSExpressRouteCircuit ExpressRouteCircuit { get; set; }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get-AzureRmExpressRouteCircuitConnectionConfig [-Name] [-ExpressRouteCircuit]

ExpressRouteCircuit parameter is declared as required positional - please add a position.

Copy link
Contributor Author

@dedhar dedhar May 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.


## EXAMPLES
### Example 1: Display the circuit connection configuration for an ExpressRoute circuit

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to add some examples including piping scenario example we discussed in the design review here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Remove-AzureRmExpressRouteCircuitConnectionConfig -Name $circuitConnectionName -ExpressRouteCircuit $circuit_init
Set-AzureRmExpressRouteCircuit -ExpressRouteCircuit $circuit_init
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to add a piping scenario example we discussed in the design review here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

HelpMessage = "The name of the Circuit Connection")]
[ValidateNotNullOrEmpty]
public override string Name { get; set; }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Name property - the base class AzureExpressRouteCircuitConnectionConfigBase has already declared the same property

Copy link
Contributor Author

@dedhar dedhar May 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the property is virtual in the base class. Modeled it on other Express Route Circuit Resources : Circuit, Peering, Route Filter etc.

HelpMessage = "Private IP Addresses to create VxLAN Tunnels")]
[ValidateNotNullOrEmpty]
public string AddressPrefix { get; set; }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all positional required properties (declared like this: CmdletName [ParamName] <ParamType> in the design review/Syntax changes/New Cmdlets section) Position property should be set.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AddressPrefix is required property. Do all required properties need to have position?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved based on offline conversation with Vladimir.

HelpMessage = "Express Route Circuit Peering intiating connection")]
[ValidateNotNullOrEmpty]
public PSExpressRouteCircuit ExpressRouteCircuit { get; set; }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove-AzureRmExpressRouteCircuitConnectionConfig [-Name] [-ExpressRouteCircuit]

ExpressRouteCircuit parameter is declared as a position required - so the Position property should be set.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@dedhar
Copy link
Contributor Author

dedhar commented May 9, 2018

Tested latest changes in Express Route NRP Slice
PS D:\temp> Get-AzureRmExpressRouteCircuit -Name 'dedhar-localckt' -ResourceGroupName 'dedhar-testinit' |Add-AzureRmExpressRouteCircuitConnectionConfig -Name 'pipetest' -PeerExpressRouteCircuitPeering '/subscriptions/8c992d64-fce9-426d-b278-85642dfeab03/resourceGroups/de
dhar-testpeer/providers/Microsoft.Network/expressRouteCircuits/dedhar-remoteckt/peerings/AzurePrivatePeering' -AddressPrefix '90.0.0.0/29' -AuthorizationKey '0a5831b3-6a0b-4def-9152-2ecd5857838d'|Set-AzureRmExpressRouteCircuit

AllowClassicOperations : False
CircuitProvisioningState : Enabled
ServiceProviderProvisioningState : Provisioned
Peerings : {AzurePrivatePeering}
Authorizations : {}
ServiceKey : 5d171255-10f8-492d-a339-4b432d545809
ServiceProviderNotes :
ServiceProviderProperties : Microsoft.Azure.Commands.Network.Models.PSServiceProviderProperties
Sku : Microsoft.Azure.Commands.Network.Models.PSExpressRouteCircuitSku
ProvisioningState : Succeeded
GatewayManagerEtag : 16
SkuText : {
"Name": "Premium_MeteredData",
"Tier": "Premium",
"Family": "MeteredData"
}
ServiceProviderPropertiesText : {
"ServiceProviderName": "bvtazureixp01",
"PeeringLocation": "Boydton 1 DC",
"BandwidthInMbps": 200
}
PeeringsText : [
{
"Name": "AzurePrivatePeering",
"Etag": "W/"5d192402-86f2-4b59-8013-701e042bc31a"",
"Id": "/subscriptions/99c33776-9f4e-4e58-abe8-9263db1b9c6e/resourceGroups/dedhar-testinit/providers/Microsoft.Network/expressRouteCircuits/dedhar-localckt/peerings/AzurePrivatePeering",
"PeeringType": "AzurePrivatePeering",
"State": "Enabled",
"AzureASN": 12076,
"PeerASN": 100,
"PrimaryPeerAddressPrefix": "10.0.0.0/30",
"SecondaryPeerAddressPrefix": "10.0.0.4/30",
"PrimaryAzurePort": "",
"SecondaryAzurePort": "",
"VlanId": 300,
"MicrosoftPeeringConfig": {
"AdvertisedPublicPrefixes": [],
"AdvertisedCommunities": [],
"AdvertisedPublicPrefixesState": "NotConfigured",
"CustomerASN": 0,
"LegacyMode": 0,
"RoutingRegistryName": "NONE"
},
"ProvisioningState": "Succeeded",
"GatewayManagerEtag": "16",
"LastModifiedBy": "Customer",
"Connections": [
{
"AddressPrefix": "90.0.0.0/29",
"AuthorizationKey": "0a5831b3-6a0b-4def-9152-2ecd5857838d",
"CircuitConnectionStatus": "Connected",
"ProvisioningState": "Succeeded",
"PeerExpressRouteCircuitPeering": {
"Id": "/subscriptions/8c992d64-fce9-426d-b278-85642dfeab03/resourceGroups/dedhar-testpeer/providers/Microsoft.Network/expressRouteCircuits/dedhar-remoteckt/peerings/AzurePrivatePeering"
},
"ExpressRouteCircuitPeering": {
"Id": "/subscriptions/99c33776-9f4e-4e58-abe8-9263db1b9c6e/resourceGroups/dedhar-testinit/providers/Microsoft.Network/expressRouteCircuits/dedhar-localckt/peerings/AzurePrivatePeering"
},
"Name": "pipetest",
"Etag": "W/"5d192402-86f2-4b59-8013-701e042bc31a"",
"Id": "/subscriptions/99c33776-9f4e-4e58-abe8-9263db1b9c6e/resourceGroups/dedhar-testinit/providers/Microsoft.Network/expressRouteCircuits/dedhar-localckt/peerings/AzurePrivatePeering/connections/pipetest"
}
]
}
]
AuthorizationsText : []
ResourceGroupName : dedhar-testinit
Location : centraluseuap
ResourceGuid :
Type : Microsoft.Network/expressRouteCircuits
Tag :
TagsTable :
Name : dedhar-localckt
Etag : W/"5d192402-86f2-4b59-8013-701e042bc31a"
Id : /subscriptions/99c33776-9f4e-4e58-abe8-9263db1b9c6e/resourceGroups/dedhar-testinit/providers/Microsoft.Network/expressRouteCircuits/dedhar-localckt
PS D:\temp> Get-AzureRmExpressRouteCircuit -Name 'dedhar-localckt' -ResourceGroupName 'dedhar-testinit' |Get-AzureRmExpressRouteCircuitConnectionConfig -Name 'pipetest'

AddressPrefix : 90.0.0.0/29
AuthorizationKey : 0a5831b3-6a0b-4def-9152-2ecd5857838d
CircuitConnectionStatus : Connected
ProvisioningState : Succeeded
PeerExpressRouteCircuitPeering : Microsoft.Azure.Commands.Network.Models.PSResourceId
ExpressRouteCircuitPeering : Microsoft.Azure.Commands.Network.Models.PSResourceId
Name : pipetest
Etag : W/"d5f8103b-ac78-423a-9a98-98c408cb7cf6"
Id : /subscriptions/99c33776-9f4e-4e58-abe8-9263db1b9c6e/resourceGroups/dedhar-testinit/providers/Microsoft.Network/expressRouteCircuits/dedhar-localckt/peerings/AzurePrivatePeering/connections/pipetest
PS D:\temp> Get-AzureRmExpressRouteCircuit -Name 'dedhar-localckt' -ResourceGroupName 'dedhar-testinit' |Remove-AzureRmExpressRouteCircuitConnectionConfig -Name 'pipetest'|Set-AzureRmExpressRouteCircuit

AllowClassicOperations : False
CircuitProvisioningState : Enabled
ServiceProviderProvisioningState : Provisioned
Peerings : {AzurePrivatePeering}
Authorizations : {}
ServiceKey : 5d171255-10f8-492d-a339-4b432d545809
ServiceProviderNotes :
ServiceProviderProperties : Microsoft.Azure.Commands.Network.Models.PSServiceProviderProperties
Sku : Microsoft.Azure.Commands.Network.Models.PSExpressRouteCircuitSku
ProvisioningState : Succeeded
GatewayManagerEtag : 25
SkuText : {
"Name": "Premium_MeteredData",
"Tier": "Premium",
"Family": "MeteredData"
}
ServiceProviderPropertiesText : {
"ServiceProviderName": "bvtazureixp01",
"PeeringLocation": "Boydton 1 DC",
"BandwidthInMbps": 200
}
PeeringsText : [
{
"Name": "AzurePrivatePeering",
"Etag": "W/"003bbbb1-91d4-4dac-b18c-3884b605b171"",
"Id": "/subscriptions/99c33776-9f4e-4e58-abe8-9263db1b9c6e/resourceGroups/dedhar-testinit/providers/Microsoft.Network/expressRouteCircuits/dedhar-localckt/peerings/AzurePrivatePeering",
"PeeringType": "AzurePrivatePeering",
"State": "Enabled",
"AzureASN": 12076,
"PeerASN": 100,
"PrimaryPeerAddressPrefix": "10.0.0.0/30",
"SecondaryPeerAddressPrefix": "10.0.0.4/30",
"PrimaryAzurePort": "",
"SecondaryAzurePort": "",
"VlanId": 300,
"MicrosoftPeeringConfig": {
"AdvertisedPublicPrefixes": [],
"AdvertisedCommunities": [],
"AdvertisedPublicPrefixesState": "NotConfigured",
"CustomerASN": 0,
"LegacyMode": 0,
"RoutingRegistryName": "NONE"
},
"ProvisioningState": "Succeeded",
"GatewayManagerEtag": "25",
"LastModifiedBy": "Customer",
"Connections": []
}
]
AuthorizationsText : []
ResourceGroupName : dedhar-testinit
Location : centraluseuap
ResourceGuid :
Type : Microsoft.Network/expressRouteCircuits
Tag :
TagsTable :
Name : dedhar-localckt
Etag : W/"003bbbb1-91d4-4dac-b18c-3884b605b171"
Id : /subscriptions/99c33776-9f4e-4e58-abe8-9263db1b9c6e/resourceGroups/dedhar-testinit/providers/Microsoft.Network/expressRouteCircuits/dedhar-localckt

@dedhar
Copy link
Contributor Author

dedhar commented May 10, 2018

Removed the unnecessary ValueFromPipelineByPropertyName  from Set Express Route Circuit command, re tested the changes and updated PR

HelpMessage = "Express Route Circuit Peering intiating connection")]
[ValidateNotNullOrEmpty]
public PSExpressRouteCircuit ExpressRouteCircuit { get; set; }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the property

public PSExpressRouteCircuit ExpressRouteCircuit { get; set; } 

why do you need

ValueFromPipelineByPropertyName = true, 

?

HelpMessage = "Express Route Circuit Peering intiating connection")]
[ValidateNotNullOrEmpty]
public PSExpressRouteCircuit ExpressRouteCircuit { get; set; }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the property

public PSExpressRouteCircuit ExpressRouteCircuit { get; set; }

why do you need

ValueFromPipelineByPropertyName = true,

HelpMessage = "Express Route Circuit Peering intiating connection")]
[ValidateNotNullOrEmpty]
public PSExpressRouteCircuit ExpressRouteCircuit { get; set; }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the property

public PSExpressRouteCircuit ExpressRouteCircuit { get; set; }

why do you need

ValueFromPipelineByPropertyName = true,

ValueFromPipelineByPropertyName = true,
HelpMessage = "The ExpressRouteCircuit")]
public PSExpressRouteCircuit ExpressRouteCircuit { get; set; }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need ValueFromPipelineByPropertyName = true, here?

@dedhar
Copy link
Contributor Author

dedhar commented May 10, 2018

Removed Value From pipeline property name from all circuit connection commands and re tested changes

@vladimir-shcherbakov
Copy link
Contributor

@vladimir-shcherbakov
Copy link
Contributor

@vladimir-shcherbakov vladimir-shcherbakov merged commit 2b7bfd3 into Azure:preview May 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants