It got resolved by following the steps in section "DNS Resolution for Internal Container Apps Environments" of the below blog
Unable to call API endpoint hosted internally in Container Apps API
I have a simple springboot application deployed on Container Apps with ingress enabled only for the vNet. I followed the steps in this doc to import the api in API management (https://learn.microsoft.com/en-us/azure/api-management/import-container-app-with-oas). On testing I keep getting a 500 Internal server error. Diagnostic log shows the following reason in the table
500 0 forward-request\forward-request\forward-request BackendConnectionFailure The remote name could not be resolved: 'mycontainerappsurl.azurecontainerapps.io' 19 https://mycontainerappsurl.azurecontainerapps.io/cntxt?param=_
How to make this work.
Note: API management is also internal and the api is exposed to internet using application gateway