Thanks Vinay for the the workaround and It is really helpful to know that we can use azure cli in terraform data block but I was able to fetch container app env using same data block but this time I fetched calling container app and retrieved its nested element without relying App environment resource
data "azurerm_container_app" "ca_data" {
name = "containerappname"
resource_group_name = data.azurerm_resource_group.rg_data.name
}