Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Consume Azure Monitor Rest API from .Net Application

I am pretty new to Azure. Following is the task I am trying to achieve:

I wanted to consume Azure Monitor Rest API from .Net application using C# code and wanted to display few metrics(any couple of metrics) on the web page(I am using ASP.Net).

For this, I created Azure AD, got the subscription ID, Tenant ID, Client Secret and Client ID from Azure portal. All that I have to do is from .Net end, which is balance and I couldn't find proper resources to achieve this task.

Can someone help me out in this?

like image 608
user2083386 Avatar asked Jan 18 '26 03:01

user2083386


1 Answers

  1. If you need to extract metric definitions (structure of azure monitor metrics) then you need to use MetricDefinitions web point. Detailed documentation is here.
  2. If you need to get monitoring metric values you need to use Metrics endpoint. Documentation link is here.

For both cases you need to use MonitorClient object from Microsoft.Azure.Management.Monitor nuget package.

You can review good examples how to extract metrics here(extract one-dimension metrics) and here(extract multi-dimension metrics).

Also follow up to couple helpful links:

  • Monitoring Concept
  • Supported Metrics
like image 193
Alexander I. Avatar answered Jan 20 '26 17:01

Alexander I.