Microsoft has recently announced the preview of Azure private Link support for Azure API management. In this blog, we will look into what is a
To learn about what is Azure API Management, head to…
If you prefer to watch this on youtube…
Private Link is a network-level capability that provides private connectivity to Azure PaaS services from a virtual network. PaaS resources are nothing but, a storage account, service bus, APIM etc.
When you create a private endpoint for a PaaS resource, we need to drop it in a virtual network. Now the resources inside the virtual network can access the PaaS resource securely through a private connection. Here private connection is nothing but, a Microsoft backbone network that is NOT INTERNET.
There are a couple of important points to be noted.
Now with this support, the APIM gateway can be accessed through Private Endpoint.
What does this exactly mean?
Let’s say we have an APIM gateway(without any virtual network configured) that is managing all our PaaS Services, for example, all the backend services like app services, function apps and HTTP trigger logic apps etc…
If we want to access the API Management endpoints from on-premises, the on-premises firewall needs to trust and allow the outbound connection to API Management.
With Private Endpoint for API Management
We can create a private endpoint for the API Management gateway and place it in a virtual network. The resources inside the Virtual network can access the API Management gateway through a private network which is the Microsoft backbone network.
If this Virtual Network is connected to on-premises via express route or VPN, then we can access the API Management endpoints from on-premises over a private network.
To secure it further - we can also lock in your API Management instance with backend services using an IP address(every APIM instance will have a fixed IP address and it will not change unless you recreate it) and managed identity.
With private endpoint support, we can securely access such an API Management gateway from on-premises over a private network.
It facilitates your external consumers to securely access your API Management gateway (without any virtual network configured)
We can simply create a private endpoint for the API Management gateway and place it in an external consumer virtual network. Yes, private endpoints can be reached from the same Virtual Network, regionally peered virtual networks and globally peered virtual networks and also cross tenants.
If you are stuck with any of the steps below, you can refer to my YouTube video where I showcased it in detail.
Azure functions as a backend for API Management
Lock it with the API Management Gateway IP address
Create a Virtual Network and two subnets, one for VM and another to place a private endpoint
Create VM and place it in subnet-vm without any public IP address
Create Bastion and access the VM and test the API Management endpoint with nslookup
Go to API Management —> Virtual Network —> Private Endpoint, create a private Endpoint and place it in subnet-pvt.
It will be accessible over the internet even after creating a private endpoint. You test this by accessing the endpoint. Disable the public access by running the below command
az rest --method patch --url https://management.azure.com/subscriptions/[SubscriptionID]/resourceGroups/apim/providers/Microsoft.ApiManagement/service/[APIMInstanceName]?api-version=2021-08-01 --body '{\"properties\": {\"publicNetworkAccess\": \"Disabled\"}}'
Now if you access the API Management Endpoint URL over the internet, it would through the below error.
Try accessing the API Management endpoint from VM which is in the same virtual network as the private endpoint.
Legal Stuff