Azure REST API信息 [英] Azure REST API information

查看:62
本文介绍了Azure REST API信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发带有关联的REST API的Azure SQL数据库.该API是通过使用.NET Core的Azure应用服务来实现的.我想在一段时间内以某种形式获取对API的每次调用的日志或输出,包括每次调用的以下各项:

We are developing an Azure SQL Database with an associated REST API. The API is implemented with an Azure App Service using .NET Core. I would like to get a log or output in some form of every call into the API for some time period, including the following items for each call:

  1. 整个URL和参数
  2. 响应时间

我认为该信息可以在某处获得.我已经阅读并观看了大量关于Azure和App Insights的教程材料,但没有找到它们,并且在我们的Azure门户中浏览了Dashboard和App Insights.我如何获得此信息?

I would think this information is available somewhere. I have read and watched a considerable volume of tutorial material about Azure and App Insights without finding it, as well as explored the Dashboard and App Insights in our Azure portal. How can I get this information?

推荐答案

此处是添加应用程序见解并从中获得好处的方法.此过程将ASP.NET Web应用程序配置为将遥测发送到Azure应用程序见解服务.它适用于在您自己的IIS服务器本地或云中托管的ASP.NET应用程序.您将获得图表和强大的查询语言,可帮助您了解应用程序的性能以及人们的使用方式,以及有关故障或性能问题的自动警报.

Here is how you can add the application insight and get the benefit out of it.This procedure configures your ASP.NET web app to send telemetry to the Azure Application Insights service. It works for ASP.NET apps that are hosted either in your own IIS server on-premises or in the Cloud. You get charts and a powerful query language that help you understand the performance of your app and how people are using it, plus automatic alerts on failures or performance issues.

先决条件

要将Application Insights添加到ASP.NET网站,您需要:

To add Application Insights to your ASP.NET website, you need to:

安装具有以下工作负载的Windows Visual Studio 2017:

Install Visual Studio 2017 for Windows with the following workloads:

ASP.NET和Web开发

ASP.NET and web development

天蓝色发展

1)添加应用程序见解sdk

1) Add the application insights sdk

在解决方案资源管理器中右键单击您的Web应用程序名称,然后选择配置应用程序见解"

Right-click your web app name in the Solution Explorer, and choose Configure Application Insights

Application Insights配置屏幕:

Application Insights Configuration screen:

选择免费开始.

如果要设置资源组或数据的存储位置,请单击配置设置".资源组用于控制对数据的访问.例如,如果有多个应用程序构成同一系统的一部分,则可以将其Application Insights数据放在同一资源组中.

If you want to set the resource group or the location where your data is stored, click Configure settings. Resource groups are used to control access to data. For example, if you have several apps that form part of the same system, you might put their Application Insights data in the same resource group.

选择寄存器

遥测将在调试期间和发布应用后发送到 Azure门户.

Telemetry will be sent to the Azure portal, both during debugging and after you have published your app.

2)运行您的应用

使用F5运行您的应用.打开不同的页面以生成一些遥测.

Run your app with F5. Open different pages to generate some telemetry.

在Visual Studio中,您将看到已记录的事件计数.

In Visual Studio, you will see a count of the events that have been logged.

3)查看遥测

您可以在Visual Studio或Application Insights Web门户中查看遥测.在Visual Studio中搜索遥测,以帮助您调试应用程序.当系统处于活动状态时,监视Web门户中的性能和使用情况.

You can see your telemetry either in Visual Studio or in the Application Insights web portal. Search telemetry in Visual Studio to help you debug your app. Monitor performance and usage in the web portal when your system is live.

Visual Studio中的遥测

Telemetry in visual studio

Azure门户中的遥测

Telemetry in Azure portal

您还可以在Application Insights Web门户中看到遥测(除非您选择仅安装SDK).与Visual Studio相比,该门户网站拥有更多的图表,分析工具和跨组件视图.该门户网站还提供警报.

You can also see telemetry in the Application Insights web portal (unless you chose to install only the SDK). The portal has more charts, analytic tools, and cross-component views than Visual Studio. The portal also provides alerts.

打开您的Application Insights资源.登录到Azure门户并在那里找到它,或者选择 Solution Explorer> Connected Services>右键单击Application Insights>打开Application Insights Portal ,然后将其带到那里.

Open your Application Insights resource. Either sign into the Azure portal and find it there, or select Solution Explorer > Connected Services > right-click Application Insights > Open Application Insights Portal and let it take you there.

该门户会在您的应用程序的遥测视图上打开.

The portal opens on a view of the telemetry from your app.

4)您终于可以发布您的应用了,您可以继续进行下去.

4) You can finally publish your app and your are good to proceed.

有关更多信息,请参阅

https://docs.microsoft .com/zh-CN/azure/azure-monitor/app/app-insights-dashboards

这篇关于Azure REST API信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆