我在 VS 2017 v15.4.0 Preview 3 中有一个项目,不久前我将 Web 服务发布到启用了 Application Insights 的 Azure。我已从 Azure 门户中删除了 Web 服务及其关联的 AI 资源,但现在 Visual Studio 报告以下错误:
该帐户无权访问 Application Insights 资源“
我可以忽略它,但它仍然每天弹出一两次。我在哪里取消这个配置?
最佳答案
好的,它被隐藏在Application Insights 搜索页面中。以下是如何将其配置为指向正确的 AI 资源:
通过从 View > 工具栏 > Application Insights 中选择来显示 Application Insights 工具栏:
这凸显了这个问题。您需要从 .csproj 文件中删除以下两行(右键单击项目,编辑 .csproj):
<ApplicationInsightsResourceId>/subscriptions/[SUBSCRIPTION_ID]/resourcegroups/[RESOURCE_GROUP_NAME]/providers/microsoft.insights/components/[RESOURCE_NAME]</ApplicationInsightsResourceId>
<ApplicationInsightsAnnotationResourceId>/subscriptions/[SUBSCRIPTION_ID]/resourcegroups/[RESOURCE_GROUP_NAME]/providers/microsoft.insights/components/[RESOURCE_NAME]</ApplicationInsightsAnnotationResourceId>
保存文件并再次右键单击该项目,您应该再次看到配置 Application Insights...。单击此选项并重新配置新的(或现有的)AI 资源。
我还必须使用 AI 工具栏按钮来选择“配置应用程序洞察”:
然后配置资源设置:
或者,如果您想从项目中完全删除 Insights,请参阅 this answer .
关于visual-studio - VS2017 - 应用程序洞察 : The account does not have permission to access the AI resource,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46803058/