0

Requirement - One URL(https://.azurewebsites.net) - The index.html page containing 2 links(href) to localhost:xxx1 and localhost:xxx2 - localhosts xxx1 & xxx2 are two different ReactJS apps

Configured package.json as per this post. "PORT=xxx1 ...". But when I click the app1 link after running yarn build in app1's folder the request is timing out. What is it that I am missing?

user51
  • 8,843
  • 21
  • 79
  • 158
Anup
  • 41
  • 9

1 Answers1

2

Not sure what ports you're choosing but... Azure Web Apps only support ports 80 and 443. If you need additional ports, you'll need to choose something different to host your apps (e.g. containers, vm's), or separate your apps into independent web apps where they can each listen on 80/443.

Note: Multiple web apps can share the same App Service Plan, so there's not necessarily a cost impact to having multiple web apps.

David Makogon
  • 69,407
  • 21
  • 141
  • 189
  • I cracked up when I read your answer and remembered reading it somewhere before, looked it up and it was you again haha. Good stuff. https://serverfault.com/questions/751504/azure-web-app-port-mapping-forwarding/751548#751548 – Joseph Bisaillon Jan 02 '19 at 19:43
  • @JosephBisaillon - wow - good memory (and good sleuthing :) ). I forgot I posted about it on ServerFault. – David Makogon Jan 02 '19 at 19:44
  • @DavidMakogon Thanks!! Seems like I have to go for the VM option finally. Would surely welcome any possible alternate ways to accomplish this like one react app containing smaller react apps. – Anup Jan 02 '19 at 20:01
  • @Anup - Like I stated in my answer, you can split your app across multiple "web apps" (then each gets its own URL and can listen directly to port 443 or 80), with no need for VMs. Ultimately, the decision to use VM's or web apps is up to you which way you host your app (or even containers, which has its own service). There are many other approaches to building your app, but that would be too broad a topic here (and lead to lengthy discussion, something not supported here). – David Makogon Jan 02 '19 at 20:55
  • Using VMs for this reason seems really overkill. – juunas Jan 03 '19 at 06:41