#27065982: ASM powershell for creating gateway connection should not have gatewayConnectionType parameter case sensitive. #3256
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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