0
votes

I currently have a Spring Boot REST API running on a VM in Azure.

It is starting up on localhost:8080.

I have an API Management instance at https://mydevapi.portal.azure-api.net where I have uploaded an API instance using an OpenAPI definition.

What steps do I need to take so that I can run GET requests from my PC (e.g. https://mydevapi.portal.azure-api.net/api/vehicles) and have the API Management route the request to the Spring Boot application running in the VM and have the response routed back to my PC via the APIM?

The VM is in a VNET with an NSG and a public IP.

The APIM isn't in the same VNET.

Do I modify the NSG to allow 8080 only to the APIM address? How is that done?

Do I add a policy to route requests to the public ip address of the VM? Or an internal IP or Azure resource? What does that look like?

1

1 Answers

0
votes

In short APIM must be able to make a call to your app. You could put them both into VNET (will have to use Premium or Dev APIM for that) and then set API service URL to your VM IP address. Or you need to make sure that your APP is exposed publicly so that APIM being outside of VNET still can access it. There are other options to secure it in that case, for example you could use client certificate authentication to authenticate APIM to your service.