0

I´ve been trying to deploy my angular application to azure web service (web app service).

Steps:

  1. Use a build pipeline to generate an artifact (zip file) in Azure DevOps
  2. Use a release pipeline that uses the previous generated artifact to deploy to my app service
  3. An error occurs

Notes:

  1. The zip file has a total size of 150MB
  2. I have used 2 different tasks without any success (AzureWebApp@1 and AzureRmWebAppDeployment@4)

Can someone help me please ? Don't know if I'm doing something wrong or if there´s a known issue related to release pipelines

STACKTRACE

2023-08-13T05:07:14.5302848Z FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

2023-08-13T05:07:14.7863924Z 1: 00007FF6FEF489AA v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+4506

2023-08-13T05:07:14.7866373Z 2: 00007FF6FEF234E6 node::MakeCallback+4534

2023-08-13T05:07:14.7869155Z 3: 00007FF6FEF23E60 node_module_register+2032

2023-08-13T05:07:14.7871100Z 4: 00007FF6FF242F4E v8::internal::FatalProcessOutOfMemory+846

2023-08-13T05:07:14.7872124Z 5: 00007FF6FF242E7F v8::internal::FatalProcessOutOfMemory+639

2023-08-13T05:07:14.7873097Z 6: 00007FF6FF429674 v8::internal::Heap::MaxHeapGrowingFactor+9620

2023-08-13T05:07:14.7874238Z 7: 00007FF6FF420656 v8::internal::ScavengeJob::operator=+24550

2023-08-13T05:07:14.7875507Z 8: 00007FF6FF41ECAC v8::internal::ScavengeJob::operator=+17980

2023-08-13T05:07:14.7876896Z 9: 00007FF6FF4279F7 v8::internal::Heap::MaxHeapGrowingFactor+2327

2023-08-13T05:07:14.7878550Z 10: 00007FF6FF427A76 v8::internal::Heap::MaxHeapGrowingFactor+2454

2023-08-13T05:07:14.7879539Z 11: 00007FF6FF551D17 v8::internal::Factory::NewFillerObject+55

2023-08-13T05:07:14.7881203Z 12: 00007FF6FF5CEF06 v8::internal::operator<<+73494

2023-08-13T05:07:14.7881902Z 13: 000000B013FDC6C1

2023-08-13T05:07:15.2310298Z ##[error]Exit code 134 returned from process: file name 'C:\externals\node10\bin\node.exe', arguments '"C:_work_tasks\AzureWebApp_18bde28a-8172-45cb-b204-5cef1393dbb1\1.225.2\azurermwebappdeployment.js"'.

2023-08-13T05:07:15.2336536Z ##[section]Finishing: Deploy Azure Web App Service

I have used 2 different tasks without any success (AzureWebApp@1 and AzureRmWebAppDeployment@4)

Bernardo
  • 1
  • 1

1 Answers1

0

In order to resolve this error refer this npm commands for the same error code in your yaml pipeline and these SO thread answers like below:-

trigger:
- master

variables:

  
  azureSubscription: '2b091df1-9e5a-4afa-a8d5-3646ec58c115'

  
  webAppName: 'valleywebapp98'

  
  environmentName: 'valleywebapp98'

  
  vmImageName: 'ubuntu-latest'

stages:
- stage: Build
  displayName: Build stage
  jobs:
  - job: Build
    displayName: Build
    pool:
      vmImage: $(vmImageName)

    steps:
    - task: ArchiveFiles@2
      displayName: 'Archive files'
      inputs:
        rootFolderOrFile: '$(System.DefaultWorkingDirectory)'
        includeRootFolder: false
        archiveType: zip
        archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
        replaceExistingArchive: true

    - upload: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
      artifact: drop

- stage: Deploy
  displayName: Deploy stage
  dependsOn: Build
  condition: succeeded()
  jobs:
  - deployment: Deploy
    displayName: Deploy
    environment: $(environmentName)
    pool:
      vmImage: $(vmImageName)
    strategy:
      runOnce:
        deploy:
          steps:
          - task: AzureRmWebAppDeployment@4
            displayName: 'Azure App Service Deploy: valleywebapp98'
            inputs:
              azureSubscription: $(azureSubscription)
              appType: webAppLinux
              WebAppName: $(webAppName)
              packageForLinux: '$(Pipeline.Workspace)/drop/$(Build.BuildId).zip'
              RuntimeStack: 'NODE|10.10'
              StartupCommand: 'npm run start'
              ScriptType: 'Inline Script'
              InlineScript: |
                npm install
                npm run build --if-present
                npm install -g increase-memory-limit
                increase-memory-limit
                set NODE_OPTIONS=--max_old_space_size=4096

Output:-

enter image description here

SiddheshDesai
  • 3,668
  • 1
  • 2
  • 11