首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >浅蓝型网络作业.Net Core2.0的应用思考

浅蓝型网络作业.Net Core2.0的应用思考
EN

Stack Overflow用户
提问于 2018-09-20 11:33:00
回答 2查看 1.6K关注 0票数 4

如何将应用洞察力遥测(应用洞察)添加到天青网络工作?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2018-09-22 13:24:13

使用最近发布的ConfigureLogging SDK3.0,您可以在WebJob方法中添加ApplicationInsights

代码语言:javascript
复制
public static async Task Main(string[] args)
{
     var builder = new HostBuilder()
        .ConfigureWebJobs(b =>
        {
            b.AddAzureStorageCoreServices().AddAzureStorage();
        })
        .ConfigureAppConfiguration(b =>
        {
            // Adding command line as a configuration source
            b.AddCommandLine(args);
        })
        .ConfigureLogging((context, b) =>
        {
            b.SetMinimumLevel(LogLevel.Debug);
            b.AddConsole();

            // If this key exists in any config, use it to enable App Insights
            string appInsightsKey = context.Configuration["ApplicationInsights:InstrumentationKey"];
            if (!string.IsNullOrEmpty(appInsightsKey))
            {
                b.AddApplicationInsights(o => o.InstrumentationKey = appInsightsKey);
            }
        });

     var host = builder.Build();
     using (host)
     {
         await host.RunAsync();
     }
}
票数 4
EN

Stack Overflow用户

发布于 2018-09-20 23:58:29

您可以在开发期间将AI添加到Web中,作为Nuget包。

AI .NET核心坚果是这里。包名有点误导(Microsoft.ApplicationInsights.AspNetCore),但它应该适用于所有.Net核心应用程序。

AI .NET核心GitHub页面是这里 (在Wiki中解释了一些定制选项)。

入门指南是论GitHublearn.microsoft.com。这是一个有点长的指南,所以我希望链接是好的(虽然没有完全按照这样的指导方针),我不需要张贴作为答复的一部分。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52424215

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档