Description of the new feature
There currently does not seem to be validation for the FilterData parameter, which means that when stopping the packet capture we only see an error ErrorCode: NoPacketCaptureResponseDataFound.
It would be helpful to validate the expected JSON string or to use a proper class so that type casting could be used instead.
Example with wrong filter
# Filter should have rather been: $filterdata = @{Filters = @(@{DestinationSubnets = @('10.0.0.0/16')})} | ConvertTo-Json -Compress -Depth 3
$filterdata = @{DestinationSubnets = @('10.0.0.0/16')} | ConvertTo-Json -Compress
Start-AzVirtualNetworkGatewayConnectionPacketCapture -ResourceGroupName some-rg -Name some-connection -FilterData $filterdata
The command is accepted despite the wrong filter and the trace is started, but when stopping:
Stop-AzVirtualNetworkGatewayConnectionPacketCapture: Long running operation failed with status 'Failed'. Additional Info:'An internal error occured. The response did not contain any data. Please check storage for the capture.'
StatusCode: 200
ReasonPhrase: OK
Status: Failed
ErrorCode: NoPacketCaptureResponseDataFound
ErrorMessage: An internal error occured. The response did not contain any data. Please check storage for the capture.
Proposed implementation details (optional)
No response
Description of the new feature
There currently does not seem to be validation for the
FilterDataparameter, which means that when stopping the packet capture we only see an errorErrorCode: NoPacketCaptureResponseDataFound.It would be helpful to validate the expected JSON string or to use a proper class so that type casting could be used instead.
Example with wrong filter
The command is accepted despite the wrong filter and the trace is started, but when stopping:
Proposed implementation details (optional)
No response