Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Angular2 Client Application deploy on Azure Website #2812


User avatar
0
vineforce created

Hello Support,

I have deployed the Server project on Azure and also updated the API URL in client project under src/assets/appconfig.Json file. Now I want to deploy the client project on Azure also using the same WPI Url. If I am running the client application on local browser under localhost:4200 after starting the npm start then it is running correctly, but I amn't able to deploy the application on Azure server. Even I followed the below article, not able to find out the solution. I might be doing some mistakes in the URLs. Could you please help me to resolve this issue. As I want to deploy both as different projects.

#2285@10c752de-7894-4f60-b1bb-c7d1279f2c00

Note: I am using VS 2015 Update 3

Thanks Harsh


5 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    I think angular-cli removed build commands from it's homepage.

    Basically, you need to do this:

    • Open a command prompt and navigate to root of angular project (angular folder in your solution)
    • then run "ng build -prod" and it will publish client app to dist folder.
    • Then transfer files under dist folder to your azure website for angular client side app. Also transfer web.config file under angular folder to azure website, otherwise you will have some problems.
    • After that configure appconfig.json according to your website addresses both for host and client.

    Then it should work.

    Please let us know if it does not.

    Thanks.

  • User Avatar
    0
    vineforce created

    Thanks for Reply,

    It's almost working, but having one issue. Ít is not connecting database API. I have updated appconfig.json and also put the web.config file from the angular folder on Azure. Please guide me, may I miss something.

    Thanks

  • User Avatar
    0
    vineforce created

    please check the issue <a class="postlink" href="https://www.screencast.com/t/XHdrxlAGEe">https://www.screencast.com/t/XHdrxlAGEe</a>

  • User Avatar
    0
    vineforce created

    Support,

    Application is working correctly now, I needed to deply the host application again.

    Thanks

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks for your quick feedback :)