Search code examples
typescriptazureazure-functions

Deployed functions but they are not showing up in Azure Portal


I'm having real trouble getting some basic Typescript functions deployed to Azure. I deployed using VS code, and the deployment was successful according to the Output window, but when I look at the Function App in the Azure Portal, there are no functions listed:

enter image description here

Also no functions appear in the Azure tab in VS code:

enter image description here

I checked my project structure and it mirrors what is suggested in the Typescript developer guide:

<project_root>/
 | - .vscode/
 | - dist/
 | | - src/
 | | | - functions/
 | | | | - myFirstFunction.js
 | | | | - myFirstFunction.js.map
 | | | | - mySecondFunction.js
 | | | | - mySecondFunction.js.map
 | - node_modules/
 | - src/
 | | - functions/
 | | | - myFirstFunction.ts
 | | | - mySecondFunction.ts
 | - .funcignore
 | - host.json
 | - local.settings.json
 | - package.json
 | - tsconfig.json

I checked that AzureWebJobsFeatureFlags is set to EnableWorkerIndexing, as someone suggested that in a different SO post. The Typescript files are being successfully compiled during deployment and appear in dist > src > functions.

I also tried deploying using the Core Tools. Again, the deployment was successful. It said that the zip package was uploaded, but no functions appear.

What am I missing here?


Solution

  • It turned out to be a build error resulting from a missing npm dependency that prevented the functions from showing in the Azure Portal. There was no mention of the error upon deployment from VS Code (or Core Tools), so I guess the lesson here is to always run an npm build locally, prior to deployment, to ensure that everything is building correctly.

    I thought for sure that an npm build was part of the deployment process and that errors would halt the deployment and be reported back, but that appears to be not the case.