简体   繁体   中英

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

I am trying to public an MVC application to azure from Visual Studio 2015 directly. [Right click project > Publish > To Azure] Every time i try to Publish my web application to my azure account i get the following error:

**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.**

I have tried to use multiple locations to host the application and the error still continues

Q: How does one register for this component? (i have not included application insights in my application on creation)

Below is more details around the error:

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

When i try find the areas supported using the powershell command:

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

The result comes back blank.

See Screenshot

Q: What is this microsoft.insights and why is it automatically required but not available?

I really hope somebody can assist me

you can do that with PowerShell or Azure CLI, or you could just deploy the WebApp once using the Portal.

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

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

Here's the link to the Azure CLI commands .

I updated to the latest version of Azure Tools and the location problem was resolved. A new error occurred when trying to create a new Azure web app from visual studio

截图

However at least now i can publish to Azure using web deploy

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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