none
Deployment from azure devops (angular) to azure web app exception RRS feed

  • Question

  • I created Project that listen to port 80
    I use azure devops. 
    Run it locally work perfect.
    When run with pipeline and publish to Azure App service it got exception.

    I create Pipline->Build
    that Build Use Yml file

    trigger:
    - dev
    
    pool:
      vmImage: 'ubuntu-latest'
    
    steps:
    - task: NodeTool@0
      inputs:
        versionSpec: '10.x'
      displayName: 'Install Node.js'
    
    - script: |
        npm install -g @angular/cli
        npm install
        NG BUILD --prod
      displayName: 'npm install and build'
      
    - task: PublishBuildArtifacts@1
      inputs:
        pathtoPublish: $(Build.ArtifactStagingDirectory)
        artifactName: MyBuildOutputs
    
    - task: AzureRmWebAppDeployment@4
      inputs:
        ConnectionType: 'AzureRM'
        azureSubscription: '<SubScription>'
        appType: 'webAppLinux'
        WebAppName: 'TestItay'
        packageForLinux: '$(System.DefaultWorkingDirectory)/dist'
        StartupCommand: 'npm start'

    that run on Build:

    npm install angular@cli
    npm install
    ng build --prod (That create the Dist Folder)

    After the building
    there Task to deploy:
    task: AzureRmWebAppDeployment@4"

    packageForLinux: '$(System.DefaultWorkingDirectory)/dist'
    StartupCommand: 'npm start'


    It run
    successful and it get there
    After the pipeline finish
    I get into the website and get:



    in the diagnostic
    i get
    Application logs from instance: RD281878EC89C7

    2019-06-16T09:48:26.050696070Z   _____                               
    2019-06-16T09:48:26.050738070Z   /  _  \ __________ _________   ____  
    2019-06-16T09:48:26.050742570Z  /  /_\  \___   /  |  \_  __ \_/ __ \ 
    2019-06-16T09:48:26.050745870Z /    |    \/    /|  |  /|  | \/\  ___/ 
    2019-06-16T09:48:26.050749070Z \____|__  /_____ \____/ |__|    \___  >
    2019-06-16T09:48:26.050752370Z         \/      \/                  \/ 
    2019-06-16T09:48:26.050755470Z A P P   S E R V I C E   O N   L I N U X
    2019-06-16T09:48:26.050758570Z 
    2019-06-16T09:48:26.050761470Z Documentation: http://aka.ms/webapp-linux
    2019-06-16T09:48:26.050764470Z NodeJS quickstart: https://aka.ms/node-qs
    2019-06-16T09:48:26.050767370Z NodeJS Version : v10.14.1
    2019-06-16T09:48:26.050770470Z 
    2019-06-16T09:48:26.809893145Z Generating app startup command
    2019-06-16T09:48:26.845848143Z Found command: npm start
    2019-06-16T09:48:26.882935847Z Running npm start
    2019-06-16T09:48:34.056640578Z npm ERR! path /home/site/wwwroot/package.json
    2019-06-16T09:48:34.073169470Z npm ERR! code ENOENT
    2019-06-16T09:48:34.110340376Z npm ERR! errno -2
    2019-06-16T09:48:34.110366276Z npm ERR! syscall open
    2019-06-16T09:48:34.110371576Z npm ERR! enoent ENOENT: no such file or directory, open '/home/site/wwwroot/package.json'
    2019-06-16T09:48:34.110378976Z npm ERR! enoent This is related to npm not being able to find a file.
    2019-06-16T09:48:34.128202475Z npm ERR! enoent 
    2019-06-16T09:48:34.145709072Z 
    2019-06-16T09:48:34.173191724Z npm ERR! A complete log of this run can be found in:
    2019-06-16T09:48:34.176526142Z npm ERR!     /root/.npm/_logs/2019-06-16T09_48_34_122Z-debug.log
    


    Docker logs from instance: RD281878EC89C7

    2019-06-16 09:43:26.681 INFO  - Starting container for site
    2019-06-16 09:43:26.681 INFO  - docker run -d -p 33678:8080 --name testitay_0 -e WEBSITE_NODE_DEFAULT_VERSION=6 -e APPSETTING_WEBSITE_NODE_DEFAULT_VERSION=6 -e WEBSITE_SITE_NAME=TestItay -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=testitay.azurewebsites.net -e WEBSITE_INSTANCE_ID=945195e1f60010c33c817fd7ae1c28de08dc486224321f51d599531c29bb5725 appsvc/node:lts_1904041152  
    
    2019-06-16 09:43:26.681 INFO  - Logging is not enabled for this container.
    Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here.
    2019-06-16 09:43:28.761 INFO  - Initiating warmup request to container testitay_0 for site testitay
    2019-06-16 09:43:39.423 INFO  - Container testitay_0 for site testitay initialized successfully and is ready to serve requests.
    2019-06-16 09:48:14.828 INFO  - Starting container for site
    2019-06-16 09:48:14.828 INFO  - docker run -d -p 11162:8080 --name testitay_1 -e WEBSITE_NODE_DEFAULT_VERSION=6 -e APPSETTING_WEBSITE_NODE_DEFAULT_VERSION=6 -e WEBSITE_SITE_NAME=TestItay -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=testitay.azurewebsites.net -e WEBSITE_INSTANCE_ID=945195e1f60010c33c817fd7ae1c28de08dc486224321f51d599531c29bb5725 appsvc/node:lts_1904041152  
    
    2019-06-16 09:48:14.828 INFO  - Logging is not enabled for this container.
    Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here.
    2019-06-16 09:48:16.059 INFO  - Initiating warmup request to container testitay_1 for site testitay
    2019-06-16 09:48:23.520 INFO  - Container testitay_1 for site testitay initialized successfully and is ready to serve requests.
    2019-06-16 09:48:23.541 INFO  - Recycling container because of AppCommandLineChange and appCommandLine = npm start
    2019-06-16 09:48:23.633 INFO  - Starting container for site
    2019-06-16 09:48:23.633 INFO  - docker run -d -p 46381:8080 --name testitay_2 -e WEBSITE_NODE_DEFAULT_VERSION=6 -e APPSETTING_WEBSITE_NODE_DEFAULT_VERSION=6 -e WEBSITE_SITE_NAME=TestItay -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=testitay.azurewebsites.net -e WEBSITE_INSTANCE_ID=945195e1f60010c33c817fd7ae1c28de08dc486224321f51d599531c29bb5725 appsvc/node:lts_1904041152 npm start 
    
    2019-06-16 09:48:23.633 INFO  - Logging is not enabled for this container.
    Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here.
    2019-06-16 09:48:26.069 INFO  - Initiating warmup request to container testitay_2 for site testitay
    2019-06-16 09:48:35.495 ERROR - Container testitay_2 for site testitay has exited, failing site start
    2019-06-16 09:48:35.599 ERROR - Container testitay_2 didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
    2019-06-16 09:52:52.216 INFO  - Starting container for site
    2019-06-16 09:52:52.217 INFO  - docker run -d -p 50536:8080 --name testitay_0 -e WEBSITE_NODE_DEFAULT_VERSION=6 -e APPSETTING_WEBSITE_NODE_DEFAULT_VERSION=6 -e WEBSITE_SITE_NAME=TestItay -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=testitay.azurewebsites.net -e WEBSITE_INSTANCE_ID=945195e1f60010c33c817fd7ae1c28de08dc486224321f51d599531c29bb5725 appsvc/node:lts_1904041152 npm start 
    
    2019-06-16 09:52:52.217 INFO  - Logging is not enabled for this container.
    Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here.
    2019-06-16 09:52:53.714 INFO  - Initiating warmup request to container testitay_0 for site testitay
    2019-06-16 09:52:56.864 ERROR - Container testitay_0 for site testitay has exited, failing site start
    2019-06-16 09:52:56.880 ERROR - Container testitay_0 didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
    2019-06-16 09:52:58.313 INFO  - Starting container for site
    2019-06-16 09:52:58.319 INFO  - docker run -d -p 20956:8080 --name testitay_0 -e WEBSITE_NODE_DEFAULT_VERSION=6 -e APPSETTING_WEBSITE_NODE_DEFAULT_VERSION=6 -e WEBSITE_SITE_NAME=TestItay -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=testitay.azurewebsites.net -e WEBSITE_INSTANCE_ID=945195e1f60010c33c817fd7ae1c28de08dc486224321f51d599531c29bb5725 appsvc/node:lts_1904041152 npm start 
    
    2019-06-16 09:52:58.320 INFO  - Logging is not enabled for this container.
    Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here.
    2019-06-16 09:52:59.393 INFO  - Initiating warmup request to container testitay_0 for site testitay
    2019-06-16 09:53:01.709 ERROR - Container testitay_0 for site testitay has exited, failing site start
    2019-06-16 09:53:01.773 ERROR - Container testitay_0 didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.





    Sunday, June 16, 2019 10:08 AM

Answers