Azure Function vnet integrated calls APIM vnet Internal mode

Lopez Alonso, Luis 186 Reputation points
2023-01-20T12:32:31.6466667+00:00

Hi,

I've configured an APIM in internal VNET mode. I want to call from Azure Function vnet integrated (same vnet as APIM) to APIM.

I've followed instructions on Deploying Azure API Management in an Internal mode (inside VNet) so DNS Private Zones are configured, linked to the VNET and tested from onprem to azure (postman calls to APIM works fine).

My function is pretty easy, an HTTPS call to APIM, works fine on local, but after pushing my function to Azure and test it from Code+Test error 400:"Name or service not known" is happening.

Please, could you help me to understand what I am missing?

Thanks in advance for your support!

Luis

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,462 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,936 questions
{count} votes

Accepted answer
  1. Santhi Swaroop Naik Bukke 595 Reputation points
    2023-01-20T21:00:56.5566667+00:00

    The error message "Name or service not known" typically indicates that the hostname you are trying to connect to cannot be resolved by the DNS server.

    Here are a few possible causes for this issue when making an HTTPS call to an APIM instance from an Azure Function:

    1. The Azure Function is not in the same virtual network as the APIM instance: Make sure that the Azure Function and APIM instances are in the same VNET and subnet.
    2. The service endpoint for the Microsoft.ApiManagement service is not configured: Make sure that the Azure Function has been granted access to the APIM subnet by creating a service endpoint for the Microsoft.ApiManagement service.
    3. The Azure Function's IP address is not in the list of allowed IP addresses in the APIM configuration: Make sure that the Azure Function has been granted access to the APIM instance by adding its IP address to the list of allowed IP addresses in the APIM configuration.
    4. The Azure Function is not using the internal URL of the APIM: Make sure that the Azure Function is calling the internal URL of the APIM, which can be found under the "Networking" tab of the APIM instance in the Azure Portal.
    5. The private endpoint for the APIM instance is not created: Make sure that you have created a private endpoint for the APIM instance in the same VNet and subnet of the Azure Function.
    6. The DNS server of the VNET is not configured to resolve the APIM's hostname: Make sure that the DNS server of the VNET is configured to resolve the hostname of the APIM instance.

    You can check the Azure function's application logs for more information about the error. Also, you can try to use the FQDN of the APIM instance instead of the hostname to see if it resolves the issue.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.