I have recently moved a .NET Web API 2 app from an Azure Cloud Service to an Azure Web App. However, we have a legacy application that needs to communicate with the API on p
In case you consider containerizing and deploying your app:
By default, App Service assumes your custom container is listening on port 80. If your container listens to a different port, set the WEBSITES_PORT app setting in your App Service app. You can set it via the Cloud Shell. In Bash:
az webapp config appsettings set --resource-group <group-name> --name <app-name> --settings WEBSITES_PORT=8000
App Service currently allows your container to expose only one port for HTTP requests.
Source: https://docs.microsoft.com/en-us/azure/app-service/configure-custom-container?pivots=container-linux#configure-port-number
No, you cannot. Only ports 80 and 443 are open.
Check this answer on Server Fault: https://serverfault.com/a/751548/394375.
If you need that control, you can use Cloud Services or Virtual Machines.
While Azure Web App cannot expose ports 8080 and 444, you could use Application Gateway to export those ports and route incoming traffic on 8080 and 444 to ports 80 or 443 on a Web App.
You can configure the app to use other ports. Based on the answer on Github,
the automatic port detection detects the port (port 80 is the default), we will attempt to detect which port to bind to your container, but you can also use the WEBSITES_PORT app setting and configure it with a value for the port you want to bind to your container. However, the webserver in your custom image may use a port other than 80. You tell Azure about the port that your custom container uses by using the WEBSITES_PORT app setting. In this case, yes you will have to change the App Setting configuration from the Portal.
As described here: https://docs.microsoft.com/en-us/azure/load-balancer/tutorial-load-balancer-port-forwarding-portal you can achieve port forwarding with azure load balancer.
No, As junnas mentioned that only 80 or 443 Tcp ports are already-explosed.We also can get more detail info about WebApp sandbox from the document.
All Azure Web Apps (as well as Mobile App/Services, WebJobs and Functions) run in a secure environment called a sandbox.The only way an application can be accessed via the internet is through the already-exposed HTTP (80) and HTTPS (443) TCP ports. However, applications may create a socket which can listen for connections from within the sandbox.