The purpose of this article is to explain the necessary steps to troubleshoot Azure functions, in case they don't work after being published.
Below are some tips to troubleshoot Azure Functions.
Access the Azure portal and select your function.
Click on the Monitor option on the left hand side:
There you can see all the invocations (successful or not) of the function.
And check the invocation details (if any error is thrown, it will be shown in this panel).
The logging information can be seen using the Logs tab in the Monitor panel.
Consider that the host.json file can be modified to control the logging behavior. See the Azure documentation to know how to set the host.json file.
There are also Diagnostic tools like the "Diagnose and solve problems" menu option of the Function App.
There you can choose "Functions that are not triggering" for example, and get an explanation of the problem.
In the case of Windows platform you can easily access the logs in the storage of the Function App.
To check the logs generated under the Storage account of the function, you can go through the Function Resource Group properties to get the storage account link:
At the storage acount you can view the File Shares, and under a tree structure you have the LogFiles.
The Kudu Application can be very helpful also, it can be accesed in a URL like the following:
To get the generator trace from the storage (only Windows), you have to configure the Logging section of the generator. Note that the directory of the Azure function is read-only.
Also, you have to save the file in another directory of the structure, as shown in the following figure:
Check the Storage Account of the Azure Function under File Shares to see where to store the log file and to be able to download it.
Note that the Kudu Application can be helpful to know the path where to save the log file.
Azure App Services diagnostics overview
Tip: Execute Azure functions locally