Thank you for posting a detailed question here.
If I understand it correctly you want to fetch private IP address used by the Application gateway instance, which is dynamically allocated from Application gateway subnet.
This IP cannot be fetched as it is not exposed by the Application Gateway, although as documented here the IP addresses are allocated from the beginning of the defined subnet space for gateway instances, which can help estimate the IP addresses. In general, if you need these IPs for any firewall configuration its recommended to whitelist the whole Application Gateway Subnet address space as when App Gatwy scales it uses the available IPs from the subnet.
Based on your use case if you wish to have this feature, please file a feature request on our feedback portal
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.