我正在尝试直接从 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
结果返回空白。
问:这个 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/