-1

I'm a beginner, I want concrete explanation.

I'd like to deploy Angular2 basic project to Azure Web/App service.

I have finished Azure setting and deployed it to my github repository. and By angular cli, I have created angular2 project.

ng new ~~ npm i ng serve -o

finally, I don't know how to deploy this folder to my azure.

AjayKumar
  • 2,812
  • 1
  • 9
  • 28
SeongUk Mun
  • 213
  • 3
  • 8

4 Answers4

1

You need to build your application by using the following cli command:

ng build

There are a lot more parameters that you can use with this, you can read about them here.

Running the build will produce a new folder called dist. The content of this is what you need to deploy to Azure, or to any other cloud service / server.

Andrei Matracaru
  • 3,511
  • 1
  • 25
  • 29
0

You need to build your application by using the following cli command: ng build --prod build will create a new folder called dist.Copy files in dist and paste it to server folder.It will works..

Arun kumar
  • 1,535
  • 3
  • 12
  • 17
-1

Step : 1 Install Angular cli

npm install -g angular-cli

Step:2 Create a project by using Angular-cli

ng new myApp

Step:3

cd myApp

Step : 4

you can use http-server to serve your app .

npm install http-server -g

Step : 5

ng build --aot

it is going to copy everything from source code to dist folder

step 6 :

http-server dist/ -p 80 > .output.log &

it will serve all the files in your folder. you can check the terminal what ip-address and port you can use to access the application. Now open up your browser and type

ip-adress:port

Hope it will help you :)

Saravanan Nandhan
  • 579
  • 10
  • 19
-2

I wanted to share an easy way to publish Angular application to Azure.

Background: angualar2 combo web api project native asp.net project

Answer: publish main project that was not complete until I took two steps

  1. right click on app directory holding angular2 files and menu publish
  2. show all files and right click on node directory and menu publish

Until I did 1 and 2 all I got was a blank index html page. hope this helps someone.

Mickael
  • 4,458
  • 2
  • 28
  • 40
Jim B
  • 11
  • 3