Skip to content

runtimeStack NODE and npm dependencies succeeds silently with no trace, when node_modules are missing resulting in a failed deployment #19313

Open
@noontz

Description

New issue checklist

Task name

AzureFunctionApp

Task version

@1 and @2

Issue Description

Hi

I had an issue when upgrading from azure-functions v3 to v4 node.js programming model, where my AzureFunctionApp tasks succeeded with no clue on anything wrong, but all functions where suddenly missing on the running function app on Azure, as in a breaking change. It took me some time, before I realized that I was missing an (sudo) npm install command in the pipeline to deploy the @azure/functions dependency needed for v4. My project has no other external dependencies, hence working with v3 without the npm install command in the pipeline.

It should be trivial for the AzureFunctionApp task to check package.json for dependencies, fail the task and log the error if the node_modules folder is missing ( when needed as per package.json )

Cheers

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

ubuntu-latest

Relevant log output

The problem is that there is no error message ;)..

Full task logs with system.debug enabled

image

Repro steps

Create an azure functions node project with external dependencies
Create a yml pipeline for deployment without the (sudo) npm install command
Use AzureFunctionApp task for deployment

 - task: AzureFunctionApp@2
    displayName: 'Deploying to api to proxy on production'
    condition: eq(variables['Build.SourceBranchName'], 'main')
    inputs:
      azureSubscription: ##
      resourceGroupName: ##
      appName: ##    
      appType: functionApp    
      package: $(Agent.BuildDirectory)/src/functions
      deploymentMethod: runFromPackage
      runtimeStack: 'NODE|18'

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions