You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there's an issue with imports (say you reference a file that isn't available during runtime) or really any error in the "global" space, there is no error to be found in the Azure Insights log traces. This makes it extremely hard to troubleshoot.
Repro steps
Throw an error outside the function handler.
const{ app }=require('@azure/functions');if(!process.env.MY_VAR){thrownewError('MY_VAR is not defined')}app.http('httpTrigger1',{methods: ['GET','POST'],authLevel: 'anonymous',handler: async(request,context)=>{context.log(`Http function processed request for url "${request.url}"`);constname=request.query.get('name')||awaitrequest.text()||'world';return{body: `Hello, ${name}!`};}});
Expected behavior
I get the following log when using the emulator:
Worker was unable to load entry point "src/functions/httpTrigger1.js": MY_VAR is not defined
Actual behavior
However, when deployed to Azure, the error is not logged. We have no idea what went wrong. The end-result is that 0 functions were discovered and the function app is essentially empty.
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 { "DynamicThrottlesEnabled": true, "EnableChunkedRequestBinding": false, "MaxConcurrentRequests": 100, "MaxOutstandingRequests": 200, "RoutePrefix": "api" }
Initializing function HTTP routes No HTTP routes mapped
Workaround
Update: Ok, I set the logLevel of Azure.Core to Trace and then finally the error / stack trace is logged. Can the log level be fixed so the error gets logs as error or at least warning?
The text was updated successfully, but these errors were encountered:
If there's an issue with imports (say you reference a file that isn't available during runtime) or really any error in the "global" space, there is no error to be found in the Azure Insights log traces. This makes it extremely hard to troubleshoot.
Repro steps
Throw an error outside the function handler.
Expected behavior
I get the following log when using the emulator:
Actual behavior
However, when deployed to Azure, the error is not logged. We have no idea what went wrong. The end-result is that 0 functions were discovered and the function app is essentially empty.
Workaround
Update: Ok, I set the
logLevel
ofAzure.Core
toTrace
and then finally the error / stack trace is logged. Can the log level be fixed so the error gets logs aserror
or at leastwarning
?The text was updated successfully, but these errors were encountered: