I'm building a project that consists in one web site and one Java application. The web site is running as a Web App inside Azure, and my application is in a Virtual Machine in Azure too. This java application is a Web Server that an user could consume it from the internet.
So what i'm am trying to accomplish here is, when an user types
Per my experience, there are two ways which can satify your needs, and it's not necessary to specify an alone port for a redirect request to VM.
As @DavidMakogon said, you can create a request filter in your Java Application to use the function like
response.sendRedirect() to redirect a request for an url mapping pattern, that's based on
You can try to create an Azure Application Gateway for your website & VM to direct the request using URL pattern routing, please see the offical article Create an application gateway using URL based routing to know how to get started.