0
votes

I have a URL which is only accessible to internal network. Due to certain business requirement, this URL has to be accessible from Azure APIM. The way I call the endpoint is as per screenshot below which I got from Microsoft docs https://docs.microsoft.com/en-us/azure/api-management/mock-api-responses

enter image description here

However, I got the following error message because myprivatedomain.com is only accessible from internal VPN. May I know how APIM execute the test API? (ie, what's the IP address? ,etc..) Thanks.

HTTP/1.1 400 Bad Request

content-length: 85

content-type: application/json

vary: Origin

{
    "error": "The remote name could not be resolved: 'myprivatedomain.com'"
}
1

1 Answers

0
votes

When API Management deploys in internal virtual network mode, all the service endpoints are only visible within a virtual network that you control the access to. None of the service endpoints are registered on the public DNS server.

  1. Enable a virtual network connection using the Azure portal

enter image description here

2.Enable a virtual network connection by using PowerShell cmdlets

Update-AzApiManagementRegion
      -ApiManagement <PsApiManagement>
      -Location <String>
      -Sku <PsApiManagementSku>
      -Capacity <Int32>
      [-VirtualNetwork <PsApiManagementVirtualNetwork>]
      [-DefaultProfile <IAzureContextContainer>]
      [<CommonParameters>]

3.For internal virtual network mode, you have to manage your own DNS. You can set up custom domain names for all your service endpoints as shown in the following image:

enter image description here

Then you can create records in your DNS server to access the endpoints that are only accessible from within your virtual network.

For more details, you could refer to this article.