How to find the logs which have generated - azure

What are the ways to find a log that we have generated using azure function or trigger in azure portal
Thanks in Advance, any help will be appreciated

One of the approach is using Kusto query, you can find a log which was generated by azure function in portal by following below steps:
Go to Azure Portal=> then Select your function app=> select logs from left side pane=> Then you write your kusto query
Example query:
traces
| where message contains "starting"
Output:

Related

Querying Azure Log Analytics from VM PowerShell

I would like to have my local device query and store data from the same Log Analytics platform that it reports to. All the documentation I have seen shows me how to access/query Log Analytics from the Azure UI & Azure PowerShell, but I have not seen anything on how to query the same data from the Virtual Machine's own PowerShell terminal. Any recommendations? Is this possible, or not?
I found the answer to my own question. To the benefit of anyone who is struggling with the same problem, refer to this:
https://igeorgiev.eu/azure/howto-query-log-analytics-workspace-from-azure-powershell-using-service-principal/
The Log Analytics Workspace context can be retrieved with
$workspace = Get-AzOperationalInsightsWorkspace
After you have retrieved the context and defined a KQL Query, you can query the Log Analytics platform with
$QueryResults = Invoke-AzOperationalInsightsQuery -Workspace $Workspace -Query $kqlQuery

Azure log analytics Azure Synapse integration

I am trying to bring in Azure Synapse logs into Loganalytics to create dashboards on usage level.
I have already setup in diagnostic settings to pass on the logs to my loganalytics workspace.
But while trying to execute queries from below documentation, I am getting error saying -
Query -
//Chart the most active resource classes
AzureDiagnostics | where Category contains "ExecRequests" | where
Status_s == "Completed" | summarize totalQueries = dcount(RequestId_s)
by ResourceClass_s | render barchart
Error:
'where' operator: Failed to resolve column or scalar expression named 'Status_s'...
Documentation link for queries : https://learn.microsoft.com/en-us/azure/synapse-analytics/sql-data-warehouse/sql-data-warehouse-monitor-workload-portal
Please let me know if there is something I am missing. I am directly logging to loganalytics workspace and running these queries inside a workbook...
Also i didnt find any proper documentation/blogs/links for connecting synapse to loganalytics, please let me know if anyone has that..
The documentation linked in your post appears to be out of date even though the last update date is recent.
See this link:
Azure services that use resource-specific mode store data in a table
specific to that service and do not use the AzureDiagnostics
table.
The link also lists a number of resource-specific tables for Synapse. "SynapseSqlPoolExecRequests" and "SynapseSqlPoolSqlRequests" are a few examples that might provide the info you're seeking.

How to know Azure Function is restarted?

I have noticed of my Azure Queue has triggered and after 8 minutes the same queue has started again with the same queue message as per my app insight logs.
Where I can find the Azure logs for queue triggered or function have restarted or function has failed? I have read one of those articles Azure dependencies where they have explains dependencies.
Thank you in advance.
If you have configured Diagnostic Settings for your function then you can query the Log analytics workspace ( usign Kusto query) for FunctionAppLogs like below. The field "Message" contains the reason why the fucntion was executed. For e.g if the function was executed via an API call then you would see something like "Reason=This function was programmatically called via the host APIs". You can search for specific words in the message. Also there is a Level field ( like Information, Warning,Error) on which you can filter. Here is the relevant docs from Azure.
FunctionAppLogs
| where Message contains "ServiceBus"

Is there any way to get logic app name from workflow_Id?

I have a logic app subscribed to event grid topic. I just want to indentify the logic app name from endpoint URL . Is there any way to identify ?
I tried to get it from logs analytics workspace using below query , but I am not getting any record in result. Any help appreciated. Thanks.
AzureDiagnostics
| where workflowId_s == "xxxxxxxxxxxxxxxxxxxxxxxx"
I think you can query like this, with Azure CLI you could use an Azure Resource Graph query.
az graph query -q "where type == 'microsoft.logic/workflows' and properties.accessEndpoint endswith 'xxxxxxxxxxxxxxxxxxxxxxxx'"

Azure Activity Log for all the users of the organization

We want to see activity logs initiated by all the users from the organization(like users#mycompamy.com). We don't want to see the activity initiated by platform(by azure policy, by backup management, etc).
On the Azure portal, there is only two option: Either select 'All' or type a single user's name. I tried '*#mycompany.com' but it didn't work. Is there any way to get this.
thanks
Updated:
In azure monitor -> Logs, you can write the query like below:
AzureActivity
| where Caller contains "#mycompamy.com"
Add a screenshot for this:
Original answer:
A simple way is that just type the #mycompany.com in the search box. The screenshot is as below:
Another more advanced method is that nav to azure monitor -> logs -> then use kusto query, then you can query what you like as per the condition like use this where clause EventInitiatedBy contains "#mycompany.com".

Resources