Skip to content

#27065982: ASM powershell for creating gateway connection should not have gatewayConnectionType parameter case sensitive. #3256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 7, 2016

Conversation

Nilambari
Copy link
Member

ASM PS command let:- New-AzureVirtualNetworkGatewayConnection:-
Problem:-
Acceptable parameter:- GatewayConnectionType values by server are :- ExpressRoute, IPsec, Vnet2Vnet, VPNClient
If customer passes this param value as anything different / in different casing than this, server will throw error:- BadRequest:- The specified request content was not valid and could not be deserialized.

Solution:-
Added validateset for parameter:- GatewayConnectionType values and now it accepts case sensitive value and passes correct value in the request to the service.

Validated that it works fine :-
PS C:\SD\PS\azure-powershell\src\Package\Debug\ServiceManagement\Azure\Networking> New-AzureVirtualNetworkGatewayConnection -ConnectedEntityId
ca619094-a213-403c-9326-915711fe3a59 -GatewayConnectionName con11 -GatewayConnectionType ipsec -SharedKey abc123 -VirtualNetworkGatewayId e86c8
b4d-55ec-4af0-a43a-1252680097bf -Verbose

Error :
HttpStatusCode : OK
Id : 3267697c-7632-4349-ac3e-f87fb0613465
Status : Successful
RequestId : 00be8049f68f31d0946f06c8453b1e8e
StatusCode : OK

PS C:\SD\PS\azure-powershell\src\Package\Debug\ServiceManagement\Azure\Networking> Get-AzureVirtualNetworkGatewayConnection -GatewayId e86c8b4d
-55ec-4af0-a43a-1252680097bf -ConnectedEntityId ca619094-a213-403c-9326-915711fe3a59

GatewayConnectionName : con11
VirtualNetworkGatewayId : e86c8b4d-55ec-4af0-a43a-1252680097bf
ConnectedEntityId : ca619094-a213-403c-9326-915711fe3a59
GatewayConnectionType : IPsec
RoutingWeight : 0
SharedKey : abc123
EnableBgp : False
OperationDescription : Get-AzureVirtualNetworkGatewayConnection
OperationId : c3dd19d7-d1c4-3c2f-bf89-ddc365091086
OperationStatus : Succeeded

[ValidateNotNullOrEmpty]
[ValidateSet(ServiceManagement.Model.VirtualNetworkGatewayConnectionType.ExpressRoute, ServiceManagement.Model.VirtualNetworkGatewayConnectionType.IPsec, ServiceManagement.Model.VirtualNetworkGatewayConnectionType.Vnet2Vnet, ServiceManagement.Model.VirtualNetworkGatewayConnectionType.VPNClient, IgnoreCase = true)]
Copy link
Member

Choose a reason for hiding this comment

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

@Nilambari this is a breaking change; existing scripts that use this parameter with any value that's not in the ValidateSet will no longer work

Copy link
Member Author

Choose a reason for hiding this comment

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

This commandlet would have never worked with any values other than the listed ones in validateset. It used to fail from server side and show general error message as :- "The specified request content was not valid and could not be deserialized" which adds more confusion to customers. So, I don't think this is any breaking change, it will help customers to understand error sooner and in better way.

Copy link
Member

Choose a reason for hiding this comment

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

@Nilambari thanks for the clarification

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure. :)

@cormacpayne
Copy link
Member

@cormacpayne
Copy link
Member

@Nilambari can you log the changes you made in the ChangeLog under the Current Release section?

@Nilambari
Copy link
Member Author

Updated changelog. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants