繁体   English   中英

将MVC应用程序部署到Azure App Services错误 - 未为资源类型注册预订

[英]Deploying MVC app to Azure App Services Error - subscription is not registered for the resource type

我试图直接从Visual Studio 2015公开MVC应用程序。 [右键单击项目>发布>到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执行此操作,也可以使用Portal部署WebApp一次。

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

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

以下是Azure CLI命令的链接。

我更新到Azure Tools的最新版本,并解决了位置问题。 尝试从visual studio创建新的Azure Web应用程序时发生新错误

截图

但是至少现在我可以使用Web部署发布到Azure

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM