0

This is the first website that I am trying to publish to make live and rather lost on how exactly I should go about it. I have a Solution in Visual Studio 2015 that is separated into two projects. My AngularJS front end is in one project and I have a web api back end that communicates with a SQL DB to fill http request from the front end. I have been testing to make sure that everything works by launching from visual studios and setting them to communicate with localhost:. Everything works fine when I do this.

I now want to host this project as an Azure web app. I have tried downloading the publish settings and hitting publish for each of the projects in visual studio. Visual Studio tells me that my solution has been successfully deployed, but when visiting the site, all I get is a "Server Error in '/' Application".

I do not really know how to go about doing this. Any help would be greatly appreciated.

rhof
  • 1
  • 2

1 Answers1

0

The problem is that each time you're publishing your project to Azure it overrides previously deployed project. So if you're deploying you client project last it will override previously deployed API and vise versa.

There are several ways to do achieve what you want.

  • First is to have two Azure Web Apps, one for client and one for API. But it will lead to cross domain requests.
  • Or you can do like pre-deploy event on your side before publish which will combine your API and Client in one "project". There are also several ways you can do this. You can reference one project from another and build API and Client proejcts in one folder or have a pre-deploy event which will merge API and Client. Also, keep in mind that you will have to merge your web.config files. Also not the best way.
  • Or the best one. Just create a several virtual directories in your Azure Web App I would prefer this one.
Community
  • 1
  • 1
user1016945
  • 877
  • 3
  • 22
  • 38