Hello,
I am having a problem and suspecting it is a bug. Was thinking to create a bug on GitHub, but figured that I might get a faster answer here and maybe there is an obvious fix. I am using VS Codes Azure Function extension to create the standard typescript code base for an Azure Function and then try to start debugging locally form the vs code extension. In the terminal I then get the error:
No job functions found. Try making your job classes and methods public...
And in the extension gives me the error: Error: connect ECONNREFUSED 127.0.0.1:7071
.
This error happens with all functions that I want to debug locally, so I cant work on any Azure Functions, but in the case I provide here all files are completely the standard generated ones (by the Azure Function Extension for VS Code), but I will post them anyway here to make sure.
host.json
:
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[4.*, 5.0.0)"
}
}
package.json
:
{
"name": "hforce-devops-github-automatizations-temporary",
"version": "1.0.0",
"description": "",
"scripts": {
"build": "tsc",
"watch": "tsc -w",
"clean": "rimraf dist",
"prestart": "npm run clean && npm run build",
"start": "func start",
"test": "echo \"No tests yet...\""
},
"dependencies": {
"@azure/functions": "^4.0.0"
},
"devDependencies": {
"@types/node": "^18.x",
"typescript": "^4.0.0",
"rimraf": "^5.0.0"
},
"main": "dist/src/functions/*.js"
}
local.settings.json
:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName=...",
"FUNCTIONS_WORKER_RUNTIME": "node",
"AzureWebJobsFeatureFlags": "EnableWorkerIndexing"
}
}
tsconfig.json
:
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "dist",
"rootDir": ".",
"sourceMap": true,
"strict": false
}
}
and the src\functions\manualTestTagUpdate.ts
:
import { app, HttpRequest, HttpResponseInit, InvocationContext } from "@azure/functions";
export async function manualTestTagUpdate(request: HttpRequest, context: InvocationContext): Promise<HttpResponseInit> {
context.log(`Http function processed request for url "${request.url}"`);
const name = request.query.get('name') || await request.text() || 'world';
return { body: `Hello, ${name}!` };
};
app.http('manualTestTagUpdate', {
methods: ['GET', 'POST'],
authLevel: 'anonymous',
handler: manualTestTagUpdate
});
I dont know how interesting it is, but I will also provide the whole terminal output:
* Executing task: npm install
up to date, audited 50 packages in 698ms
14 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
* Terminal will be reused by tasks, press any key to close it.
* Executing task: npm run clean
> hforce-devops-github-automatizations-temporary@1.0.0 clean
> rimraf dist
* Terminal will be reused by tasks, press any key to close it.
* Executing task: npm run build
> hforce-devops-github-automatizations-temporary@1.0.0 build
> tsc
* Terminal will be reused by tasks, press any key to close it.
* Executing task: func host start
Azure Functions Core Tools
Core Tools Version: 4.0.4483 Commit hash: N/A (64-bit)
Function Runtime Version: 4.1.3.17473
[2024-05-17T14:25:48.952Z] No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
For detailed output, run func with --verbose flag.
[2024-05-17T14:25:54.307Z] Host lock lease acquired by instance ID '000000000000000000000000DBED5792'.
Would be nice to have some feedback on what the problem could be and some possible fixes.