C# 使用c将应用程序洞察中的自定义事件数据获取到阵列中#

C# 使用c将应用程序洞察中的自定义事件数据获取到阵列中#,c#,azure,azure-application-insights,C#,Azure,Azure Application Insights,我必须让大多数城市浏览我的应用程序。我使用appinsights获取这些数据。但是,我想将该数据存储到一个数组中,并使用SELENIUM c#将其传递给一个测试函数。我安装了app insights nuget软件包并连接到它 customevents | where timestamp >= ago(24h) | summarize count() by client_City | order by count_ desc C#代码: TelemetryClient teleme

我必须让大多数城市浏览我的应用程序。我使用appinsights获取这些数据。但是,我想将该数据存储到一个数组中,并使用SELENIUM c#将其传递给一个测试函数。我安装了app insights nuget软件包并连接到它

customevents
 | where timestamp >= ago(24h)
 | summarize count() by client_City
 | order by count_ desc
C#代码:

TelemetryClient telemetry = new TelemetryClient();
 telemetry.InstrumentationKey = "xxxx";
            telemetry.TrackEvent("eventname");

我想将来自analytics查询的数据存储到c#中的数组中。有没有办法做到这一点。

使用
遥测客户端
您只能写入数据,不能查询数据

您有以下选择:

  • 例如,将数据导出到Blob存储或Sql Server,并在其中创建一个可以使用.Net()读取的查询
  • 将问题查询中的数据导出到CSV文件,并在.Net中读取(这是一个手动操作)
  • 使用Application Insights REST Api直接在.Net中查询数据。看
  • 我认为选项3最适合你