How to call rest api from loganalytics workspace to query Usages - List By Vaults api

Siva 646 Reputation points
2025-08-27T19:48:49.77+00:00

Hi Friends,

Can any one guide me how to use below api from backup log analytics workspace to get the answer.

Also do we have option to send a mail from workspace? like alerts once configured.

Usages - List By Vaults

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/usages?api-version=2025-02-01

Azure Backup
Azure Backup
An Azure backup service that provides built-in management at scale.
{count} votes

1 answer

Sort by: Most helpful
  1. Divyesh Govaerdhanan 8,590 Reputation points
    2025-08-27T23:01:33.29+00:00

    Hello,

    Welcome to Microsoft Q&A,

    We can't call REST API from an Log Analytics KQL Query. KQL has no HTTP client. You need an external runner (Logic App / Function / Automation) to call the API, then (optionally) push the results into your workspace where you can query/alert on them.

    Option 1: Logic App - Call the ARM endpoint on a schedule, email the results, and/or write them to Log Analytics.

    https://docs.azure.cn/en-us/azure-monitor/logs/tutorial-logs-ingestion-api?tabs=dcr

    Option 2: Azure Function / Automation Runbook

    Acquire token with managed identity → GET the Usages endpoint → email or write to Log Analytics using the Logs Ingestion API. (Useful if you prefer code over a designer.)

    Please Upvote and accept the answer if it helps!!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.