1

Please assist - basic azure function created using azure functions v4 model from VS Code. When running locally on the machine, I get no job functions found error.

Azure Functions Core Tools Core Tools Version: 4.0.4915 Commit hash: N/A (64-bit) Function Runtime Version: 4.14.0.19631

Building host: version spec: , startup suppressed: 'False', configuration suppressed: 'False', startup operation id: 'ec088f72-775c-422b-b73c-839cf88e4a28' Reading host configuration file 'C:\development\NodeJSBotProject\GetDataByMember\host.json' Host configuration file read: { "version": "2.0", "logging": { "applicationInsights": { "samplingSettings": { "isEnabled": true, "excludedTypes": "Request" } } }, "extensionBundle": { "id": "Microsoft.Azure.Functions.ExtensionBundle", "version": "[4., 5.0.0)" } } FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language: java FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language: powershell FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language: python Looking for extension bundle Microsoft.Azure.Functions.ExtensionBundle at C:\Users\dushy.azure-functions-core-tools\Functions\ExtensionBundles\Microsoft.Azure.Functions.ExtensionBundle [2024-08-26T23:25:49.775Z] Found a matching extension bundle at C:\Users\dushy.azure-functions-core-tools\Functions\ExtensionBundles\Microsoft.Azure.Functions.ExtensionBundle\4.17.0
Loading functions metadata Reading functions metadata Reading functions metadata 0 functions found 0 functions found 0 functions loaded Looking for extension bundle Microsoft.Azure.Functions.ExtensionBundle at C:\Users\dushy.azure-functions-core-tools\Functions\ExtensionBundles\Microsoft.Azure.Functions.ExtensionBundle Found a matching extension bundle at C:\Users\dushy.azure-functions-core-tools\Functions\ExtensionBundles\Microsoft.Azure.Functions.ExtensionBundle\4.17.0
Fetching information on versions of extension bundle Microsoft.Azure.Functions.ExtensionBundle available on https://functionscdn.azureedge.net/public/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/index.json Skipping bundle download since it already exists at path C:\Users\dushy.azure-functions-core-tools\Functions\ExtensionBundles\Microsoft.Azure.Functions.ExtensionBundle\4.17.0 Loading extension bundle from C:\Users\dushy.azure-functions-core-tools\Functions\ExtensionBundles\Microsoft.Azure.Functions.ExtensionBundle\4.17.0\bin
Script Startup resetting load context with base path: 'C:\Users\dushy.azure-functions-core-tools\Functions\ExtensionBundles\Microsoft.Azure.Functions.ExtensionBundle\4.17.0\bin'. Reading host configuration file 'C:\development\NodeJSBotProject\GetDataByMember\host.json' Host configuration file read: { "version": "2.0", "logging": { "applicationInsights": { "samplingSettings": { "isEnabled": true, "excludedTypes": "Request" } } }, "extensionBundle": { "id": "Microsoft.Azure.Functions.ExtensionBundle", "version": "[4.
, 5.0.0)" } } FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language: java FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language: powershell FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language: python Initializing Warmup Extension. Initializing Host. OperationId: 'ec088f72-775c-422b-b73c-839cf88e4a28'. Host initialization: ConsecutiveErrors=0, StartupCount=1, OperationId=ec088f72-775c-422b-b73c-839cf88e4a28 LoggerFilterOptions { "MinLevel": "None", "Rules": [ { "ProviderName": null, "CategoryName": null, "LogLevel": null, "Filter": "b__0" }, { "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider", "CategoryName": null, "LogLevel": "None", "Filter": null }, { "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider", "CategoryName": null, "LogLevel": null, "Filter": "b__0" }, { "ProviderName": "Azure.Functions.Cli.Diagnostics.ColoredConsoleLoggerProvider", "CategoryName": null, "LogLevel": null, "Filter": "b__0" } ] } LoggerFilterOptions { "MinLevel": "None", "Rules": [ { "ProviderName": null, "CategoryName": null, "LogLevel": null, "Filter": "b__0" }, { "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider", "CategoryName": null, "LogLevel": "None", "Filter": null }, { "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider", "CategoryName": null, "LogLevel": null, "Filter": "b__0" }, { "ProviderName": "Azure.Functions.Cli.Diagnostics.ColoredConsoleLoggerProvider", "CategoryName": null, "LogLevel": null, "Filter": "b__0" } ] } ConcurrencyOptions { "DynamicConcurrencyEnabled": false, "MaximumFunctionConcurrency": 500, "CPUThreshold": 0.8, "SnapshotPersistenceEnabled": true } FunctionResultAggregatorOptions { "BatchSize": 1000, "FlushTimeout": "00:00:30", "IsEnabled": true } SingletonOptions { "LockPeriod": "00:00:15", "ListenerLockPeriod": "00:00:15", "LockAcquisitionTimeout": "10675199.02:48:05.4775807", "LockAcquisitionPollingInterval": "00:00:05", "ListenerLockRecoveryPollingInterval": "00:01:00" } Starting JobHost Starting Host (HostId=laptophq93ji16-1212978244, InstanceId=d1e43003-f098-4ce6-8b9d-a26e27bac8f0, Version=4.14.0.19631, ProcessId=44148, AppDomainId=1, InDebugMode=False, InDiagnosticMode=False, FunctionsExtensionVersion=(null)) Loading functions metadata Reading functions metadata Reading functions metadata 0 functions found 0 functions found Reading functions metadata 1 functions found 0 functions loaded Generating 0 job function(s) 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.). HttpOptions { Initializing function HTTP routes "DynamicThrottlesEnabled": false, "EnableChunkedRequestBinding": false, No HTTP routes mapped "MaxConcurrentRequests": -1,

"MaxOutstandingRequests": -1, "RoutePrefix": "api" } Host initialized (90ms) Host started (101ms) Job host started Host lock lease acquired by instance ID '0000000000000000000000000BBC01A3'.

1
  • please share your function code @Sean Commented Aug 27, 2024 at 4:25

2 Answers 2

0

To execute a basic JavaScript V4 Azure Function, you need to have following codes in the given files.

const { app } = require('@azure/functions');

app.http('httpTrigger1', {
    methods: ['GET', 'POST'],
    authLevel: 'anonymous',
    handler: async (request, context) => {
        context.log(`Http function processed request for url "${request.url}"`);

        const name = request.query.get('name') || await request.text() || 'world';

        return { body: `Hello, ${name}!` };
    }
});

local settings-

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "FUNCTIONS_WORKER_RUNTIME": "node",
    "AzureWebJobsFeatureFlags": "EnableWorkerIndexing"
  }
}

host.json-

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

Ensure to use the latest version of Azure Function Core Tools. You will get expected response.

Executing task: func host start 


Azure Functions Core Tools
Core Tools Version:       4.0.5907 Commit hash: N/A +807e89766a92b14fd07b9f0bc2bea1d8777ab209 (64-bit) 
Function Runtime Version: 4.834.3.22875

[2024-08-27T09:20:51.656Z] Debugger listening on ws://****/8530acd7-fddb-4017-8207-b9f0daa357e3
[2024-08-27T09:20:51.658Z] For help, see: https://nodejs.org/en/docs/inspector
[2024-08-27T09:20:51.736Z] Worker process started and initialized.

Functions:

        httpTrigger1: [GET,POST] http://localhost:7071/api/httpTrigger1

For detailed output, run func with --verbose flag.
[2024-08-27T09:20:51.844Z] Debugger attached.
[2024-08-27T09:21:07.738Z] Executing 'Functions.httpTrigger1' (Reason='This function was programmatically called via the host APIs.', Id=23e49cb2-ad15-4179-be78-fbd2a65f2119)
[2024-08-27T09:21:07.931Z] Http function processed request for url "http://localhost:7071/api/httpTrigger1?name=Afrin"
[2024-08-27T09:21:07.975Z] Executed 'Functions.httpTrigger1' (Succeeded, Id=23e49cb2-ad15-4179-be78-fbd2a65f2119, Duration=253ms)
Sign up to request clarification or add additional context in comments.

1 Comment

thank you for responding. In the end, I feel in the end my azure functions core tools wasn't correctly installed/not the latest. In case you encounter issue with running npm i azure-functions-core-tools on your project, i would suggest to download it locally and run the installer. this should install on your windows machine at C:\Program Files\Microsoft\Azure Functions Core Tools go.microsoft.com/fwlink/?linkid=2174087
0

thank you for responding. In the end, I feel in the end my azure functions core tools wasn't correctly installed/not the latest. In case you encounter issue with running npm i azure-functions-core-tools on your project, i would suggest to download it locally and run the installer. this should install on your windows machine at C:\Program Files\Microsoft\Azure Functions Core Tools https://go.microsoft.com/fwlink/?linkid=2174087

One rookie mistake to avoid is to only execute "func start" from root of your function project and not /src or /src/functions folder where your node.js code resides

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.