visual-studio - VS2017 - 应用程序洞察 : The account does not have permission to access the AI resource

标签 visual-studio azure visual-studio-2017 azure-application-insights

我在 VS 2017 v15.4.0 Preview 3 中有一个项目,不久前我将 Web 服务发布到启用了 Application Insights 的 Azure。我已从 Azure 门户中删除了 Web 服务及其关联的 AI 资源,但现在 Visual Studio 报告以下错误:

enter image description here

该帐户无权访问 Application Insights 资源“”。请选择有权访问资源的帐户:

我可以忽略它,但它仍然每天弹出一两次。我在哪里取消这个配置?

最佳答案

好的,它被隐藏在Application Insights 搜索页面中。以下是如何将其配置为指向正确的 AI 资源:

通过从 View > 工具栏 > Application Insights 中选择来显示 Application Insights 工具栏:

Application Insights Search

这凸显了这个问题。您需要从 .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 工具栏按钮来选择“配置应用程序洞察”:

enter image description here

然后配置资源设置:

enter image description here

或者,如果您想从项目中完全删除 Insights,请参阅 this answer .

关于visual-studio - VS2017 - 应用程序洞察 : The account does not have permission to access the AI resource,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46803058/

相关文章:

visual-studio - 在文件之间共享SASS变量,而不导入或引用变量文件?

c++ - Visual Studio,从命令行运行 cmakesettings.json

c# - Visual Studio 2010 卡在跟踪点上

azure - 我可以查询 Redis 缓存以通过键列表获取值吗?

node.js - 如何在 Azure 上部署现有的 Nodejs 应用程序?

Azure 数据工厂 - 调用 Azure VM 中的 EXE 文件

visual-studio-2017 - 我无法将 Windows SDK 版本更改为 10.0.17763.0 ,当我单击应用时它只会重置回 8.1

visual-studio - Azure功能单独调试和部署

c# - IE6 : window. onresize 在 IIS 上工作,在 asp.net 开发服务器上崩溃

visual-studio - 自动创建 Visual C++ 故障转储