0

I am currently doing some work in Azure, and I'm trying to get the Resource ID of an Internal IP address located in an Azure virtual network. I essentially need the equivalent of the below command, but for an internal IP. Does anyone know how I can retrieve this?

Thanks,

az network public-ip list --query "[?ipAddress!=null]|[?contains(ipAddress, '$IP')].[id]" --output tsv

adan11
  • 647
  • 1
  • 7
  • 24
  • 1
    Private IPs are the part of configuration of Network Interfaces (NIC), so there is no such thing as "Resource ID of internal IP address". Are you searching for a Resource ID for NIC with your Private IP? – Ivan Ignatiev Sep 15 '21 at 11:43
  • Hi @IvanIgnatiev Essentially I want the resource ID to configure a DNS name for an Ingress controller. I'm using the following tutorial, but they use a public IP, whereas I'm trying to do the same thing with an internal IP: https://godatadriven.com/blog/deploying-apache-airflow-on-azure-kubernetes-service/ – adan11 Sep 16 '21 at 00:03
  • in the case of your tutorial, it is impossible to deal with a Private IP address (AKS will force creation and association with Public IP), you should follow a tutorial for Private AKS: https://learn.microsoft.com/en-us/azure/aks/private-clusters – Ivan Ignatiev Sep 16 '21 at 07:22

1 Answers1

0

I have tested in my environment.

To fetch the Resource ID of an private IP address which is associated with the Application Gateway that is used as an Ingress Controller for the AKS Cluster, please use below command :

az network application-gateway frontend-ip list -g RGName --gateway-name ApplicationGatewayName --query "[?privateIpAddress!=null]|[?contains(privateIpAddress, ‘$IP’)].[id]" --output tsv 

enter image description here

RamaraoAdapa
  • 2,837
  • 2
  • 5
  • 11