Home > Blockchain >  How to use Azure App Services domain for Static Web Apps?
How to use Azure App Services domain for Static Web Apps?

Time:02-12

I have an Azure App Services instance, which by default goes to https://myappservice.azurewebsites.net (not actually mine, but it's the same format). It's not a bad domain and a lot better than the sporadic randomized domains from Static Web Apps (https://lively-tree-randomletters.azurestaticapps.net).

Is there any way to switch the serverless website running on static web apps to also use the https://myappservice.azurewebsites.net domain?

Or is the only possible solution for hosting (1) react and (2) spring boot on the same domain, to buy one? Or this isn't possible at all?

(I want them to be on the same domain so I don't need to worry about CORS)

CodePudding user response:

I think you could pull this off by using an Application Gateway. With the Application Gateway you can set up path-based rules so that you've got both your app service and your static website, but say yoursite.com/sprintBoot will be routed to your App Service and everything else on yoursite.com, to your static website.

See this article as an example: Create an application gateway with path-based routing rules using the Azure portal

Though it is up for debate if this is easier than worrying about CORS.

  • Related