Azure / Azure/azure-functions-core-tools

No functions in my function app only when publishing -- working fine 'locally' when using the v4 model

Open
#3,765 1 comment 0 reactions 0 assignees View on GitHub
core-tools needs-investigation
Dominant language
C#
Stars
1.5k
Forks
498
Avg merge
4d 20h
Merged PRs (30d)
14

Description

Trying to get the node v4 model up and running in Azure without any luck.

Locally things work fine.

Here's my package.json

```js
{
"name": "",
"version": "1.0.0",
"description": "",
"main": "src/index.js",
"type": "module",
"scripts": {
"start": "func start",
"test": "echo \"No tests yet...\""
},
"dependencies": {
"@azure/functions": "^4.5.0",
"@azure/search-documents": "^12.0.0",
"lodash": "^4.17.21"
},
"devDependencies": {
"azure-functions-core-tools": "^4.x"
}
}
```

host.json
```js
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[4.*, 5.0.0)"
}
}
```

Both of those I've seen many "working" examples on the web and I am pretty sure are correct. When I run func start I get something like

```Skipping 'FUNCTIONS_WORKER_RUNTIME' from local settings as it's already defined in current environment variables.
[2024-07-13T03:24:41.748Z] DB HOST IS cirojobsdata-dev.postgres.database.azure.com
[2024-07-13T03:24:41.749Z] DB_SCHEMA_PG IS ww
[2024-07-13T03:24:41.808Z] Worker process started and initialized.

Functions:

127.0.0.1 - - [13/Jul/2024:03:24:41 +0000] "HEAD /devstoreaccount1/azure-webjobs-hosts/locks/msalexwosx-1507412914/Host.Functions.IndexActiveJobs.Listener HTTP/1.1" 200 0
IndexActiveJobs: timerTrigger
```
Which is exactly what's in index.js

I've also tried having `src/functions/*.js` as the value for `main` in `package.json` without luck as well. My folder structure is correct afaik.

image

But when publishing all I see is

```
Getting site publishing info...
[2024-07-13T03:25:52.296Z] Starting the function app deployment...
Creating archive for current directory...
Uploading 3.78 MB [###############################################################################]
127.0.0.1 - - [13/Jul/2024:03:26:00 +0000] "GET /devstoreaccount1/Tables('AzureFunctionsDiagnosticEvents202407') HTTP/1.1" 200 -
127.0.0.1 - - [13/Jul/2024:03:26:00 +0000] "GET /devstoreaccount1/Tables('AzureFunctionsDiagnosticEvents202407') HTTP/1.1" 200 -
127.0.0.1 - - [13/Jul/2024:03:26:00 +0000] "GET /devstoreaccount1/Tables('AzureFunctionsDiagnosticEvents202407') HTTP/1.1" 200 -
127.0.0.1 - - [13/Jul/2024:03:26:00 +0000] "GET /devstoreaccount1/Tables('AzureFunctionsDiagnosticEvents202407') HTTP/1.1" 200 -
127.0.0.1 - - [13/Jul/2024:03:26:00 +0000] "GET /devstoreaccount1/Tables('AzureFunctionsDiagnosticEvents202407') HTTP/1.1" 200 -
127.0.0.1 - - [13/Jul/2024:03:26:00 +0000] "GET /devstoreaccount1/Tables('AzureFunctionsDiagnosticEvents202407') HTTP/1.1" 200 -
Upload completed successfully.
Deployment completed successfully.
[2024-07-13T03:26:12.106Z] Syncing triggers...
Functions in IndexMyJobs:
```

That's the end of the output! What am I doing wrong?

FWIW `FUNCTIONS_WORKER_RUNTIME` is set to `node`.
`WEBSITE_RUN_FROM_PACKAGE` is set to `1` in app settings.
`EnableWorkerIndexing` most importantly is
image

Contributor guide

Open the contributing guide

Research direction

Start by comparing package.json and the src/index.js entry point with the deployed archive and the output from func start. Check why trigger synchronization reports no functions despite local discovery, then verify the deployed function list and confirm that publishing exposes the expected index.js function.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, node.js
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.