MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.2k stars 21.35k forks source link

After upgrading to v4 functions do not work on Azure #117284

Open noontz opened 10 months ago

noontz commented 10 months ago

After I followed your guide I have v4 running locally with no problems. I ran my azure pipeline and all functions are gone. As in there are NO functions on azure. The function app is running.

This is my deployment task (for staging slot) that worked prior to upgrading:

This is the folder structure on the build agent:

/home/vsts/work/1 ├── TestResults ├── a ├── b └── s ├── README.md ├── api │ ├── functions │ │ ├── api.js │ │ ├── dataAccessFunctions.js │ │ ├── identityFunctions.js │ │ └── pdfServiceFunctions.js │ ├── host.json │ ├── package-lock.json │ ├── package.json │ └── swa-local-develop.pfx

functions are in the functions folder package.json

{ "main": "functions/*.js", "name": "api", "version": "1.0.0", "description": "", "scripts": {}, "dependencies": { "@azure/functions": "^4.1.0" } }

On azure this is the settings:

FUNCTIONS_EXTENSION_VERSION : ~4 FUNCTIONS_WORKER_RUNTIME : node

There is no documentation how to deploy to azure without breaking everything!


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

Naveenommi-MSFT commented 10 months ago

@noontz Thanks for your feedback! We will investigate and update as appropriate.

noontz commented 10 months ago

@Naveenommi-MSFT I found the reason for my issue and suggest it added to the documentation. When using yml pipelines for azure functions the command npm install (or other means of deploying node-modules) is mandatory for v4, but not for v3, so this needs to be added to the pipeline if the existing v3 project has no external references

mumurug-MSFT commented 10 months ago

@noontz Thanks for sharing. We will make the changes accordingly.