c# - 将 MVC 应用程序部署到 Azure 应用程序服务错误 - 未为资源类型注册订阅

标签 c# asp.net-mvc azure azure-web-app-service

我正在尝试直接从 Visual Studio 2015 将 MVC 应用程序公开到 azure。[右键单击项目 > 发布 > 到 Azure] 每次我尝试将 Web 应用程序发布到我的 Azure 帐户时,都会收到以下错误:

**The subscription is not registered for the resource type 'components' in the location 'Central US'. Please re-register for this provider in order to have access to this location.**

我尝试使用多个位置来托管应用程序,但错误仍然存​​在

问:如何注册该组件? (我没有在我的创建应用程序中包含应用程序见解)

以下是有关该错误的更多详细信息:

OPERATION IDC16287A675C4B7D3
TRACKING IDb0355f45-867b-4328-95cd-6d627751c619
STATUSConflict
PROVISIONING STATEFailed
TIMESTAMP12/3/2016, 3:12:24 PM
DURATIONPT0.8505384S
TYPEmicrosoft.insights/components
RESOURCE ID/subscriptions/a955ba0f-a5f6-4ba4-b7d4-a0dae7b87215/resourceGroups/DemoBEEApp1Resources/providers/microsoft.insights/components/DemoBEEApp2
STATUSMESSAGE{
  "error": {
    "code": "MissingRegistrationForLocation",
    "message": "The subscription is not registered for the resource type 'components' in the location 'Central US'. Please re-register for this provider in order to have access to this location."
  }
}
RESOURCEDemoBEEApp2

当我尝试使用 powershell 命令查找支持的区域时:

((Get-AzureRmResourceProvider -ProviderNamespace microsoft.insights).ResourceTypes | Where-Object ResourceTypeName -eq sites).Locations

结果返回空白。

See Screenshot

问:这个 microsoft.insights 是什么?为什么自动需要它但不可用?

我真的希望有人能帮助我

最佳答案

您可以使用 PowerShell 或 Azure CLI 来完成此操作,也可以使用门户一次部署 WebApp。

$providers = @(Get-AzureRmResourceProvider -ListAvailable)
foreach ($x in $providers) {

Register-AzureRmResourceProvider -ProviderNamespace $x.ProviderNamespace -Force
write-host $x.ProviderNamespace
}
Write-Host “Done!”

这是 Azure CLI commands 的链接.

关于c# - 将 MVC 应用程序部署到 Azure 应用程序服务错误 - 未为资源类型注册订阅,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40948341/

相关文章:

c# - 两个并行的 TransactionScope,每个都有自己的连接

asp.net-mvc - 从 Visual Studio 2015 Update 1 RC 还原 dnu

c# - 元素 'entityFramework' 具有无效的子元素 Entity Framework

c# - 备用网格行颜色?

c# - 如何使用 PLINQ 并行初始化大型数组?

c# - 提交 C# MapReduce 作业 Windows Azure HDInsight - 响应状态代码不表示成功 : 500 (Server Error)

c# - U-SQL 目录中本地的 SQLSpatial

azure - Terraform、Azure 和 AKS,我可以创建到对等互连 vnet 中的 NAT GW 的路由表吗?

c# - 数据库存储的简单加密/解密

asp.net-mvc - 本地化的脚本包解决方案