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"
}
}
]