我正在运行VS 2013更新3,并安装了带有App的云服务。这一切都很好。但是,我有三种不同的订阅(dev、暂存和生产),并且希望我的dev云服务实例向dev订阅报告app洞察力数据,而我的暂存云服务实例将应用洞察力数据报告给我的暂存订阅。我如何配置这个单一云应用程序来向不同的订阅和/或应用洞察应用程序名称报告数据?
发布于 2014-10-21 19:43:07
最后我带着下面的内容走了下去:
public class ConfigSettings
{
internal class AppInsights
{
internal static bool IsEnabled
{
get
{
return CloudConfigurationManager.GetSetting("AppInsights.IsEnabled").Cast<bool>();
}
}
internal static string InstrumentationKey
{
get
{
return CloudConfigurationManager.GetSetting("AppInsights.InstrumentationKey");
}
}
}
}
public class AppInsightsHelper
{
public static void Initialize()
{
if(ConfigSettings.AppInsights.IsEnabled)
TelemetryConfiguration.Active.InstrumentationKey = ConfigSettings.AppInsights.InstrumentationKey;
}
}
// In global.asax.cs
AppInsightsHelper.Initialize();
https://stackoverflow.com/questions/26206673
复制相似问题