DEV Community

Darragh O'Riordan
Darragh O'Riordan

Posted on • Originally published at darraghoriordan.com on

Yarn timeout when deploying a Node app to Azure app service

I was trying to deploying a node app to azure app service recently but it kept timing out trying to download all the required modules.

I was able to fix this by specifying an explicit network timeout for the npm install in my azure-pipelines.yaml file

This really helps on the lower app service tiers because they are quite slow.

The network timeout is specified in the last part of this task.

- task: AzureRmWebAppDeployment@4
    inputs:
      ConnectionType: 'AzureRM'
      azureSubscription: '$(azureSubscription)'
      appType: 'webAppLinux'
      WebAppName: '$(serverWebAppName)'
      packageForLinux: '$(System.ArtifactsDirectory)/drop/$(Build.BuildId).zip'
      RuntimeStack: 'NODE|10.16'
      StartupCommand: 'cd server && node dist/index.js'
      ScriptType: 'Inline Script'
      InlineScript: |
        cd server
        yarn install --production --network-timeout=30000
Enter fullscreen mode Exit fullscreen mode

Top comments (0)