Skip to content

Get-AzPrivateEndpointConnection shows friendly message if rp and resource is not supported #17091

@dingmeng-xue

Description

@dingmeng-xue

Description

From #16984

Azure PowerShell provides error message Object reference not set to an instance of an object when rp or resource is not supported. Cmdlet should show better message to end user.

Besides Get-AzPrivateEndpointConnection, other cmdlets relying on configuration list should show better message as well.

Issue script & Debug output

PS /Users/myusername> Get-AzPrivateEndpointConnection -ResourceId /subscriptions/my-subscription/resourceGroups/my-rg/providers/Microsoft.Network/privateLinkServices/MyPrivateLinkService
DEBUG: 10:28:07 AM - GetAzurePrivateEndpointConnection begin processing with ParameterSet 'ByResourceId'.
DEBUG: 10:28:07 AM - using account id '[email protected]'...
Get-AzPrivateEndpointConnection: Object reference not set to an instance of an object.
DEBUG: AzureQoSEvent: Module: Az.Network:4.14.0; CommandName: Get-AzPrivateEndpointConnection; PSVersion: 7.1.5; IsSuccess: False; Duration: 00:00:00.1252211; Exception: Object reference not set to an instance of an object.;
DEBUG: Finish sending metric.
DEBUG: 10:28:07 AM - GetAzurePrivateEndpointConnection end processing.

Environment data

All

Module versions

Az.Network

Error output

No response

Metadata

Metadata

Assignees

Labels

Network - Private LinkbugThis issue requires a change to an existing behavior in the product in order to be resolved.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions