Following this example on multiple operating systems results in the same error – No job functions found.
JavaScript V4 containerized Azure Function
Reproducible Steps:
func --version => 4.0.5390
func init --worker-runtime node --language javascript --docker
func new --name HttpExample --template "HTTP trigger" --authlevel anonymous
docker build --tag exapt/azurefunctionsimage:v1.0.0 .
docker run -p 8080:80 exapt/azurefunctionsimage:v1.0.0
Always the same results No job functions are found and therefore No HTTP routes mapped
Any help on this would be greatly appreciated
info: Host.Triggers.Warmup[0]
Initializing Warmup Extension.
info: Host.Startup[503]
Initializing Host. OperationId: '5578f731-bbdf-411f-b3d2-a6a79c7f6aeb'.
info: Host.Startup[504]
Host initialization: ConsecutiveErrors=0, StartupCount=1, OperationId=5578f731-bbdf-411f-b3d2-a6a79c7f6aeb
info: Microsoft.Azure.WebJobs.Hosting.OptionsLoggingService[0]
LoggerFilterOptions
{
"MinLevel": "None",
"Rules": [
{
"ProviderName": null,
"CategoryName": null,
"LogLevel": null,
"Filter": "<AddFilter>b__0"
},
{
"ProviderName": null,
"CategoryName": "Host.Function.ToolingConsoleLog",
"LogLevel": "Information",
"Filter": null
},
{
"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": "<AddFilter>b__0"
}
]
}
info: Microsoft.Azure.WebJobs.Hosting.OptionsLoggingService[0]
ConcurrencyOptions
{
"DynamicConcurrencyEnabled": false,
"MaximumFunctionConcurrency": 500,
"CPUThreshold": 0.8,
"SnapshotPersistenceEnabled": true
}
info: Microsoft.Azure.WebJobs.Hosting.OptionsLoggingService[0]
FunctionResultAggregatorOptions
{
"BatchSize": 1000,
"FlushTimeout": "00:00:30",
"IsEnabled": true
}
info: Microsoft.Azure.WebJobs.Hosting.OptionsLoggingService[0]
SingletonOptions
{
"LockPeriod": "00:00:15",
"ListenerLockPeriod": "00:01:00",
"LockAcquisitionTimeout": "10675199.02:48:05.4775807",
"LockAcquisitionPollingInterval": "00:00:05",
"ListenerLockRecoveryPollingInterval": "00:01:00"
}
info: Microsoft.Azure.WebJobs.Hosting.OptionsLoggingService[0]
ScaleOptions
{
"ScaleMetricsMaxAge": "00:02:00",
"ScaleMetricsSampleInterval": "00:00:10",
"MetricsPurgeEnabled": true,
"IsTargetScalingEnabled": true,
"IsRuntimeScalingEnabled": false
}
info: Microsoft.Azure.WebJobs.Hosting.JobHostService[0]
Starting JobHost
info: Host.Startup[401]
Starting Host (HostId=8e98bfe4f974-2137340777, InstanceId=156a96ca-3e89-48f0-8b60-b377b15bf25e, Version=4.27.4.4, ProcessId=1, AppDomainId=1, InDebugMode=False, InDiagnosticMode=False, FunctionsExtensionVersion=(null))
info: Host.Startup[314]
Loading functions metadata
info: Host.Startup[326]
Reading functions metadata (Custom)
info: Host.Startup[327]
1 functions found (Custom)
info: Host.Startup[315]
0 functions loaded
info: Host.Startup[0]
Generating 0 job function(s)
warn: Host.Startup[0]
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.).
info: Microsoft.Azure.WebJobs.Hosting.OptionsLoggingService[0]
HttpOptions
{
"DynamicThrottlesEnabled": false,
"EnableChunkedRequestBinding": false,
"MaxConcurrentRequests": -1,
"MaxOutstandingRequests": -1,
"RoutePrefix": "api"
}
info: Microsoft.Azure.WebJobs.Script.WebHost.WebScriptHostHttpRoutesManager[0]
Initializing function HTTP routes
No HTTP routes mapped
info: Host.Startup[412]
Host initialized (85ms)
info: Host.Startup[413]
Host started (104ms)
info: Host.Startup[0]
Job host started
Hosting environment: Production
Content root path: /azure-functions-host
Now listening on: http://[::]:80
Application started. Press Ctrl+C to shut down.
info: Host.General[337]
Host lock lease acquired by instance ID '00000000000000000000000035830186'.
C:datagitazure-codecontainer-functionsjavascript4.xunittest>docker run -p 8080:80 exapt/azurefunctionsimage:v1.0.0
info: Host.Triggers.Warmup[0]
Initializing Warmup Extension.
info: Host.Startup[503]
Initializing Host. OperationId: 'b1b6445b-4574-4558-b048-60a071d87f76'.
info: Host.Startup[504]
Host initialization: ConsecutiveErrors=0, StartupCount=1, OperationId=b1b6445b-4574-4558-b048-60a071d87f76
info: Microsoft.Azure.WebJobs.Hosting.OptionsLoggingService[0]
LoggerFilterOptions
{
"MinLevel": "None",
"Rules": [
{
"ProviderName": null,
"CategoryName": null,
"LogLevel": null,
"Filter": "<AddFilter>b__0"
},
{
"ProviderName": null,
"CategoryName": "Host.Function.ToolingConsoleLog",
"LogLevel": "Information",
"Filter": null
},
{
"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": "<AddFilter>b__0"
}
]
}
info: Microsoft.Azure.WebJobs.Hosting.OptionsLoggingService[0]
ConcurrencyOptions
{
"DynamicConcurrencyEnabled": false,
"MaximumFunctionConcurrency": 500,
"CPUThreshold": 0.8,
"SnapshotPersistenceEnabled": true
}
info: Microsoft.Azure.WebJobs.Hosting.OptionsLoggingService[0]
FunctionResultAggregatorOptions
{
"BatchSize": 1000,
"FlushTimeout": "00:00:30",
"IsEnabled": true
}
info: Microsoft.Azure.WebJobs.Hosting.OptionsLoggingService[0]
SingletonOptions
{
"LockPeriod": "00:00:15",
"ListenerLockPeriod": "00:01:00",
"LockAcquisitionTimeout": "10675199.02:48:05.4775807",
"LockAcquisitionPollingInterval": "00:00:05",
"ListenerLockRecoveryPollingInterval": "00:01:00"
}
info: Microsoft.Azure.WebJobs.Hosting.OptionsLoggingService[0]
ScaleOptions
{
"ScaleMetricsMaxAge": "00:02:00",
"ScaleMetricsSampleInterval": "00:00:10",
"MetricsPurgeEnabled": true,
"IsTargetScalingEnabled": true,
"IsRuntimeScalingEnabled": false
}
info: Microsoft.Azure.WebJobs.Hosting.JobHostService[0]
Starting JobHost
info: Host.Startup[401]
Starting Host (HostId=849995b3309d-2137340777, InstanceId=4e06d01f-fea7-45d0-b16e-ba2394417010, Version=4.27.4.4, ProcessId=1, AppDomainId=1, InDebugMode=False, InDiagnosticMode=False, FunctionsExtensionVersion=(null))
info: Host.Startup[314]
Loading functions metadata
info: Host.Startup[326]
Reading functions metadata (Custom)
info: Host.Startup[327]
1 functions found (Custom)
info: Host.Startup[315]
0 functions loaded
info: Host.Startup[0]
Generating 0 job function(s)
warn: Host.Startup[0]
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.).
info: Microsoft.Azure.WebJobs.Hosting.OptionsLoggingService[0]
HttpOptions
{
"DynamicThrottlesEnabled": false,
"EnableChunkedRequestBinding": false,
"MaxConcurrentRequests": -1,
"MaxOutstandingRequests": -1,
"RoutePrefix": "api"
}
info: Microsoft.Azure.WebJobs.Script.WebHost.WebScriptHostHttpRoutesManager[0]
Initializing function HTTP routes
No HTTP routes mapped
info: Host.Startup[412]
Host initialized (84ms)
info: Host.Startup[413]
Host started (103ms)
info: Host.Startup[0]
Job host started
Hosting environment: Production
Content root path: /azure-functions-host
Now listening on: http://[::]:80
Application started. Press Ctrl+C to shut down.
info: Host.General[337]
Host lock lease acquired by instance ID '000000000000000000000000819BC0C8'.
2
Answers
By using the commands mentioned in the above, I also got the same error.
check below:
When I used the commands, they didn’t create a function.json file.
I added function.json to my httptrigger function, which is given below:
function.json:
Below is my folder structure and status after added function.json:
By using two commands I was successfully build and run the docker file.
docker build --tag exapt/azurefunctionsimage:v1.0.0 .
anddocker run -p 8080:80 exapt/azurefunctionsimage:v1.0.0
Output in Local:
Output in Docker:
For v4 try using :