简体   繁体   中英

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?

  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:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM