0

I'm battling with getting an angular app to build and then publish to an Azure resource. The Pipeline runs "successfully" but I am getting the ":( Application Error" when accessing the site. If I view wwwroot via Azure Portal -> Advanced Tools I ~~see the entire repo~~ see nothing:

enter image description here

If I look at the directory via CLI - I see the files

enter image description here

The downloaded artifact appears correct: enter image description here

[EDIT - updated .yml file] Right now, my pipeline yml file is

variables:
  System.Debug: true

trigger:
- develop

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
  displayName: 'npm install and build'

- task: ArchiveFiles@2
  inputs:
    rootFolderOrFile: '$(System.DefaultWorkingDirectory)/dist/question-ui'
    includeRootFolder: false
    archiveType: 'zip'
    archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
    replaceExistingArchive: true

- task: PublishBuildArtifacts@1
  inputs:
    pathtoPublish: '$(Build.ArtifactStagingDirectory)'
    artifactName: app

- task: DownloadBuildArtifacts@0
  inputs:
    buildType: 'current'
    downloadType: 'single'
    artifactName: 'app'
    downloadPath: '$(System.ArtifactsDirectory)'

- task: AzureRmWebAppDeployment@4
  inputs:
    ConnectionType: 'AzureRM'
    azureSubscription: 'qt-question-ui - Azure'
    appType: 'webAppLinux'
    WebAppName: 'qt-question-ui'
    deployToSlotOrASE: true
    ResourceGroupName: 'DEV_QTv2'
    SlotName: 'production'
    packageForLinux: '$(System.ArtifactsDirectory)/app/$(Build.BuildId).zip'
    RuntimeStack: 'NODE|10-lts'

I've updated this as I progress, thinking I'm getting closer.

Chris Rockwell
  • 1,688
  • 2
  • 21
  • 36
  • You can download the build artifacts if you look at a successful build afterwards. Check this artifact. If it is correct, you are probably uploading something else to Azure - unfortunately you did not show how you are uploading it. – Alex AIT Mar 28 '20 at 07:40
  • I thought the PublishBuildArtifact is the part that uploads it - I put the entire yml file, sounds like I'm missing something? – Chris Rockwell Mar 28 '20 at 11:54
  • Please try to deploy your app to Azure App Service manually so that we can check if it's your application itself caused the error instead of ADO. Also, please refer to [this thread](https://stackoverflow.com/questions/59039716/application-error-message-when-browsing-azure-deployed-web-app) and you can see what the true problem is rather than ":( Application Error". – Yang Shen - MSFT Mar 30 '20 at 08:25
  • Could you please share the log op the application? You might have the same problem I [had](https://stackoverflow.com/questions/59196290/deploy-create-react-app-with-azure-pipelines) Though I am using React instead of Angular. Should work the same since it can both use the pm2 environment – Joost Luijben May 05 '20 at 15:01
  • Check out this: https://stackoverflow.com/a/63501266/6908282 – Gangula May 28 '21 at 16:06

0 Answers0