How can I get the ip address of the azure app service custom domain using terraform?

I want to get the ip address in terraform as shown in the image.
image

Howzit @laguz1254

removed previous reply

I see you have a solution from the github repo

Feature request : get azurerm_app_service custom domains ip address for azurerm_dns_a_record · Issue #14642 · hashicorp/terraform-provider-azurerm (github.com)

for people reading here only and in case that reply is removed

You can use hashicorp/dns provider to get this IP address by default hostname.
For example:

resource "azurerm_linux_web_app" "example" {
  name                = "example"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_service_plan.example.location
  service_plan_id     = azurerm_service_plan.example.id

  site_config {}
}

data "dns_a_record_set" "app_ip_address" {
  host = azurerm_linux_web_app.example.default_hostname
}

resource "azurerm_dns_a_record" "dns_a" {
  # ...
  target_resource_id  = data.dns_a_record_set.app_ip_address.addrs[0]
}