0

I have questions on setting up data used Azure Log Analytics for Azure Functions.

I cannot see options related to setting up Log Analytics or see information about it within Azure Functions.

But I can open Log Analytics where I can enter query to return data.

I created a Log Analytics Workspace, but am not sure if it is useful for Azure Functions with Log Analytics.

Questions

1 What data is Log Analytics based on by default?

2 Do I need to specify or turn on the logging data Log Analytics is based on?

Put it simply, how to setup for Log Analytics with Azure Functions.

Pingpong
  • 7,681
  • 21
  • 83
  • 209
  • Not sure why you are using Log analytics for azure functions. Microsoft recommends Application Insights for monitoring functions. – Ivan Glasenberg Mar 18 '19 at 06:42
  • @IvanYang Do you mean Application Insights is recommended? Please provide link to back up your claim. But kamran suggests otherwise. We will use whatever is the recommended way. – Pingpong Mar 18 '19 at 11:40
  • @IvanYang Do you mean Log Analytics is NOT recommended? Please provide link to back up your claim. But kamran suggests otherwise. – Pingpong Mar 18 '19 at 11:55

1 Answers1

0

Microsoft recommends Application Insights for monitoring functions.

But if you persist using Log analytics, you can follow the steps below:

1.Nav to your log analytics workspace in azure portal.

2.in the left blade, select Workspace Data Sources -> Azure Resources, then click your azure function there.

enter image description here

3.In the new page, fill in the necessary field.

enter image description here

Ivan Glasenberg
  • 29,865
  • 2
  • 44
  • 60
  • Please note that using Application Insights for monitoring functions is deprecated approach. It is not recommended to start using this approach for new applications. – Kamran Mar 18 '19 at 11:17
  • @kamran, do you mean Application Insights is not recommended. If so, why is Application Insights link available on the Overview tab? Please provide link to back up your claim. – Pingpong Mar 18 '19 at 11:38
  • @Pingpong I was wrong. I confused myself and you. Sorry. https://learn.microsoft.com/en-us/azure/azure-functions/functions-monitoring – Kamran Mar 18 '19 at 12:27
  • @Pingpong, please take a look at this [article](https://learn.microsoft.com/en-us/azure/azure-functions/functions-monitoring#monitor-without-application-insights), the MS says: We recommend Application Insights for monitoring functions. It offers more data and better ways to analyze the data. – Ivan Glasenberg Mar 19 '19 at 00:47
  • @IvanYang I got an error when enabling FunctionExecutionLogs. I wonder if you have information on this https://stackoverflow.com/questions/55239531/error-setting-up-azure-function-within-azure-resource-under-log-analytics-worksp – Pingpong Mar 19 '19 at 11:08
  • @Pingpong, it was my mistake. And Today I tried it(select the FunctionExecutionLogs), it has the same problem at my side. I contact the MS team, and get the feedback: this is a scenario(FunctionExecutionLogs) we are not support from our Log Analytics team which has declared by our Production Group any more. And I will post an answer to your [new post](https://stackoverflow.com/questions/55239531/error-setting-up-azure-function-within-azure-resource-under-log-analytics-worksp) with more details. – Ivan Glasenberg Mar 20 '19 at 06:37
  • @Pingpong, the 'FunctionExecutionLogs' is not supported now(will be considered as bug or by design), can you please accept it as an answer? thanks. – Ivan Glasenberg Mar 21 '19 at 02:30