I am using Azure DevOps and I have an Angular Frontend and a express.js Backend, which I need to deploy on a Azure VM instance. How do I that? I already managed to take care of CI by using Azure Pipelines to build and publish (to Artifacts) the Angular Frontend. My Azure VM (running CentOS) instance already runs a web server, I just need to synchronize the files from the Artifacts and also to build my express.js backend. Here is my azure-pipelines.yml for reference:

# Node.js with Angular
# Build a Node.js project that uses Angular.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript

- master

  vmImage: 'ubuntu-latest'

- task: NodeTool@0
    versionSpec: '10.x'
  displayName: 'Install Node.js'

- task: CmdLine@2
    script: |
      npm uninstall -g @angular/cli
      npm install -g @angular/cli
      ng update @angular/core
      npm install
      ng build --prod
      ng test --watch=false --browsers=ChromeHeadless
    workingDirectory: 'Projectname/src'
  displayName: 'Npm Install und Build'

- task: PublishBuildArtifacts@1
    PathtoPublish: 'Projectname/dist'
    ArtifactName: 'angular'
    publishLocation: 'Container'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.