-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.

2

4 Answers 4

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.

Sign up to request clarification or add additional context in comments.

Comments

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..

Comments

-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 :)

Comments

-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.

1 Comment

Does nothing for me! It has to do something with production ready angular app.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.