如何将应用程序洞察力发布到REST API而不是ASP.NET Core应用程序中的Azure?
我有一个ASP.NET Core 5.0 MVC Web应用程序和应用程序Insights启用。我正在尝试将应用程序洞察力数据发布到REST API,我使用nodejs开发了API。
我的appSettings.json
详细信息如下。在这里,API得到触发,但我没有得到任何身体内容(Insight的数据)。
请引导我。提前致谢。
{
"Logging": {
"ApplicationInsights": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"ApplicationInsights": {
"InstrumentationKey": "123",
"TelemetryChannel": {
"EndpointAddress": "http://localhost:3000/v2/track"
}
}
}
I have an ASP.NET Core 5.0 MVC web application and app insights enabled. I am trying to post application insights data to REST API, which I developed using nodejs.
My appsettings.json
details are below. Here, API got trigger, but I'm not getting any body content (Insight's data).
Please guide me. Thanks in advance.
{
"Logging": {
"ApplicationInsights": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"ApplicationInsights": {
"InstrumentationKey": "123",
"TelemetryChannel": {
"EndpointAddress": "http://localhost:3000/v2/track"
}
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将无法直接通过应用程序获取数据
它不会直接将申请见解发送给您,但是
将以BLOB存储的形式将其保存在存储帐户中。
您可以做的是直接通过存储获取数据
帐户或您可以从应用程序见解中获取数据。
如果要从存储帐户中获取数据,则必须
使用
@azure/storage-blob
带有节点JS的NPM软件包。您可以从容器部分下的门户中获取
contain name
存储帐户的
另一种方法是在应用程序见解中运行查询。这可以通过提出HTTP请求来实现,并且必须通过Azure AD令牌或门户中的访问密钥来验证该请求。
。
参考:
从应用程序见解中导出遥测 Anton Fritz
=“ https://learn.microsoft.com/en-us/rest/rest/api/application-insights/query/get” rel =“ nofollow noreferrer”>使用查询数据导出数据
You won't be able to get the data directly through the application as
it will not send the application insights directly to you, but it
will save it in the storage account in form of blob storage.
What you can do is either get the data directly through the storage
account or you can get data from the application insights.
If you want to take data from the storage account, you will have to
use
@azure/storage-blob
npm package with node js .you can get
containername
from the portal under containers sectionof the storage account.
Another way would be to run a query in the application insights. This can be achieved by making http requests and the request has to be authenticated by either azure ad token or the access key which is in the portal.
Reference:
Export telemetry from Application Insights by Anton Fritz
Export data using Query