I have an application that uses Azure Log Analytics REST API to query logs data from Azure log analytics workspace. I want to implement a public health check endpoint for that application. That health check ideally should assess the connection to the Log Analytics REST API and confirm the status of it. So is there a public health check endpoint available for Azure Log Analytics REST API? If not how can I achieve the above requirement?
If you want to check the status of the REST API, just take use of this api with any program language. For example, there is always a table named AzureActivity, you can use this api to query this table, if the response is returned with 200 status code, then it means this api or Log Analytics workspace is available.
Note: Please replace the DEMO_WORKSPACE and DEMO_KEY with the real one.
Here is the screenshot about how to use this api, you can use it with any program language:
Related
can anyone suggest how to create the logic app for failed connections in azure to send mail automatically, diagnostics setting in logs log analytics enabled, for failed connection need how many failed connections with username and ip address.
AzureDiagnostics
| where event_class_s == "connection_log"
and event_subclass_s == "DISCONNECT"
also need to automate through logic app for slow running queries any suggestions.
need to run from Azure log analytics and send mail through logic app.
Yes , You can enable Log Analytics when you create your logic app or install the Logic Apps Management solution in your Log Analytics workspace for existing logic apps to enable logging for your logic app. This solution gathers data for your logic app runs and offers particular details like status, execution time, resubmission status, and correlation IDs. Then, to enable logging and query creation for this data.
for complete setup please refer this Microsoft Documentation|Set up Azure Monitor logs and collect diagnostics data for Azure Logic Apps
To get the all failure status of logic app you can use the below query as well
AzureMetrics | where Resource contains "MY RESOURCE GROUPNAME" and MetricName contains "RunsFailed" and Total >= 1 and ResourceProvider contains "MICROSOFT.LOGIC"
Source|SO THREAD
I am using API management services to expose my APIs, i am using consumption based instance for API management.
I have published 4-5 APIs and products in that. I want to analytics the behavior of my APIs exposed by viewing the http responses and if possible request and response.
What is the best way to do this as in consumption based, i cannot see api analytics in left nav of api management services
There are number of options one can perdue with Consumption tier:
Use diagnostic settings to store gateway logs in Log Analytics and use it's capabilities to analyze the data: https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-use-azure-monitor#resource-logs
Use APIMs Application Insights integration https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-app-insights
Build custom pipeline sending data from policy using log-to-eventhub or even send-request policies https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-log-event-hubs
As per this Microsoft Document, Built-in API Analytics are not supported for the consumption tier if you want to use analytics you need to increase your plan.
I have an application installed on a VM that publishes a page via OData.
I need to be able to trigger a high urgency alert based on one specific value published by the page.
I am little aware of Application Insights to monitor applications in Azure. But I am not sure if there is a way to read the data from the API and trigger an alert.
What options do I have to accomplish this in Azure?
Pls allow me to share my idea here.
creating app insights alert
enable app insights for azure vm
First, adding app insights to your application can made AI to capture your requests, dependencies, logs and some other messages, including calling API.
In my thoughts, I can log the response message of the API and set alert for some specific keywords. I created an azure function, and it will call MS graph API when triggered, and log the response. This function has integrated AI, so I created an alert by kql:
traces
| where timestamp > ago(30m) and message contains "xxx"
and set alert rule based on number of results greater than 0. When the alert was triggered, it will send email to my mailbox to mention me.
This means any time my API returned the response contains specific words, I will receive an email about it.
Folks, I could not find from going through the Azure Monitor documentation whether it is possible for Azure Monitor to make an REST API call to an external API such that the alerts themselves(Not Notifications) captured by Azure Monitor can be broadcasted to external API's.
I do find that Azure Monitor exposes REST API's which are more of a pull scenario. But i am looking for a push scenario where Azure Monitor can push alerts (not notifications)
any pointers should be helpful. Thanks!
You can create alerts with action groups and specify the action type as Webhook and then provide the URI to your API endpoint.
We've logs(W3CIISLogs) on Log analytics workspace for websites hosted on VMs. Similarly we have app insights enabled for websites hosted on App service. Now we want to access telemetry data of both type of websites thru single interface, either via app insights or via Log analytics. Just wondering if it's possible and what's the best way.
With Azure Monitor you can now query not only across multiple Log Analytics workspaces, but also data from a specific Application Insights app in the same resource group, another resource group, or another subscription. This provides you with a system-wide view of your data. You can only perform these types of queries in Log Analytics.
Querying across Log Analytics workspaces and from Application Insights - reference another workspace in your query, use the workspace identifier and for an app from Application Insights, use the app identifier.
Cross-resource query limits:
The number of Application Insights resources that you can include in
a single query is limited to 100.
Cross-resource query is not supported in View Designer. You can Author a query in Log
Analytics and pin it to Azure dashboard and visualize a log search.
Cross-resource query in log alerts is supported in the new
scheduledQueryRules API. By default, Azure Monitor uses the legacy
Log Analytics Alert API for creating new log alert rules from Azure
portal, unless you switch from legacy Log Alerts API. After the
switch, the new API becomes the default for new alert rules in Azure
portal and it lets you create cross-resource query log alerts rules.
You can create cross-resource query log alert rules without making
the switch by using the ARM template for scheduledQueryRules API –
but this alert rule is manageable though scheduledQueryRules API and
not from Azure portal.
Documentation Reference - Cross-Resource Log queries in Azure Monitor
Hope the above information helps.