Create external network between Azure API Manager and a virtual machine

Viewed 141

I have created an API Manager Service (AMS) in Azure with its subnet.

enter image description here

I have created a Virtual Machine with Ubuntu that exposes some APIs on the port 8000. It has a public IP and an internal IP (10.0.1.5). This is the network configuration.

enter image description here

I don't want a public IP on this machine. What I want is that only the AMS speaks with the Virtual Machine to expose the API.

I can't find a way to create a private network (or external network in the AMS point of view) between the AMS and the virtual machine. In the network configuration of the virtual machine, the AMS subnet is not available.

In a normal network I would create a NAT between the 2 subnets but in Azure I don't know how to do it.

Do you have any advice?

1 Answers

Create a Virtual network first in some region . Then , while creating APIM services go to the Virtual network tab and select type as external instead of none and select the same Virtual network that you have created earlier.

enter image description here

Once the APIM service is deployed then create a VM and while creating the VM go to the networking tab and select the same virtual network that you have used in APIM but different subnet for the VM (as APIM and VM cannot use same subnet , it is not supported in azure) . You can add a new subnet in the same Vnet for using it in the VM by going to the VNet resource you have created and in Subnets page clicking on add subnet. (Note : All the resources must be in same region)

enter image description here

After this configuration is done the resources can communicate which are present inside the VNet even if they have different subnets. As by default resources under the same vnet can communicate in azure.

Related