Get-AzPrivateEndpoint powershell command is not working as expected

Apurva Pathak 535 Reputation points
2023-08-30T18:22:54.6666667+00:00

hi folks,

I am trying to use 'Get-AzPrivateEndpoint' to query properties and configurations of my private endpoints but it is not working as expected. It doesn't show the expected results. Below are the details:

Result that I am getting is below (I am unable to query IP or DNS configs):

PS C:\Users\apurva.pathak> $privateEndpoint = Get-AzPrivateEndpoint -ResourceGroupName $resourceGroupName -Name $pe_name

PS C:\Users\apurva.pathak> $privateEndpoint

ResourceGroupName                  Name                             Location ProvisioningState Subnet
-----------------                  ----                             -------- ----------------- ------
SpeciesAI-dev-1.00-001-Platform-RG SpeciesAI-dev-MachineLearning-pe uksouth  Succeeded               



PS C:\Users\apurva.pathak> $privateEndpoint.Subnet

AddressPrefix Name NetworkSecurityGroup Name RouteTable Name NatGateway Name ProvisioningState PrivateEndpointNetworkPolicies PrivateLinkServiceNetworkPolicies
------------- ---- ------------------------- --------------- --------------- ----------------- ------------------------------ ---------------------------------
                                                                                                                                                               



PS C:\Users\apurva.pathak> $privateEndpoint.IpConfigurations

PS C:\Users\apurva.pathak> $privateEndpoint.CustomDnsConfigs

PS C:\Users\apurva.pathak> 


Expected result as per MS docs (https://learn.microsoft.com/en-us/powershell/module/az.network/get-azprivateendpoint?view=azps-10.2.0):

Get-AzPrivateEndpoint -Name MyPrivateEndpoint1 -ResourceGroupName TestResourceGroup

Name                                : MyPrivateEndpoint1
ResourceGroupName                   : TestResourceGroup
Location                            : eastus2euap
Id                                  : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TestResourceGroup/provi
                                      ders/Microsoft.Network/privateEndpoints/MyPrivateEndpoint1
Etag                                : W/"00000000-0000-0000-0000-000000000000"
ProvisioningState                   : Succeeded
Subnet                              : {
                                        "Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TestResourceGroup/providers/Microsoft.Network/virtualNetworks/MyVirtualNetwork1/subnets/backendSubnet",
                                      }
NetworkInterfaces                   : [
                                        {

                                          "Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TestResourceGroup/providers/Microsoft.Network/networkInterfaces/MyNic1",
                                        }
                                      ]
PrivateLinkServiceConnections       : []
ManualPrivateLinkServiceConnections : [
                                        {
                                          "Name": "MyPrivateLinkServiceConnection",
                                          "Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TestResourceGroup/providers/Microsoft.Network/privateEndpoints/MyPrivateEndpoint1/manualPrivateLinkServi
                                      ceConnections/MyPrivateLinkServiceConnection",
                                          "PrivateLinkServiceId": "/subscriptions/00000000-0000-0000-0000-000000000000/
                                      resourceGroups/TestResourceGroup/providers/Microsoft.Network/priv
                                      ateLinkServices/MyPrivateLinkService",
                                          "PrivateLinkServiceConnectionState": {
                                            "Status": "Pending",
                                            "Description": "Awaiting approval"
                                          }
                                        }
                                      ]
Azure Private Link
Azure Private Link
An Azure service that provides private connectivity from a virtual network to Azure platform as a service, customer-owned, or Microsoft partner services.
504 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,460 questions
0 comments No comments
{count} votes

Accepted answer
  1. ChaitanyaNaykodi-MSFT 25,841 Reputation points Microsoft Employee
    2023-08-31T05:08:12.53+00:00

    @Apurva Pathak

    Thank you for reaching out.

    I was able to reproduce this issue on my end and I have reported it as a bug to the PowerShell Team here

    I was able to get the required details using Az CLI command "az network private-endpoint show" and also using the REST API Call Private Endpoints - Get

    Hope this helps! Please let me know if you have any additional questions. Thank you!

    ​​Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Wiegand, Eric 0 Reputation points
    2024-02-01T18:40:20.81+00:00

    Is this still broken? I recently updated to using VS Code and Powershell as per Microsoft docs and Get-AzPrivateEndpoint doesn't return all the data like its supposed to


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.