.NET中如何在appsettings.json配置Application Insights连接字符串?
在appsettings.json中配置Application Insights连接字符串
你需要在appsettings.json中添加ApplicationInsights节点,并在其下设置ConnectionString元素来配置连接字符串,具体格式如下:
{ "Logging": { "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" } }, "ApplicationInsights": { "ConnectionString": "你的Application Insights连接字符串" }, "AllowedHosts": "*" }
- 核心JSON元素名称:
ApplicationInsights(父节点)、ConnectionString(子节点,用于存储连接字符串值) - 把示例中的
"你的Application Insights连接字符串"替换为你从Azure对应资源中获取的实际连接字符串即可。
内容的提问来源于stack exchange,提问作者si Hwang
相关产品推荐
相关产品推荐

