Search code examples
azureazure-resource-managerazure-powershellazure-rm-templateazure-cli

Not able to to register namespace 'Microsoft.AlertsManagement' through ARM templates


I am trying to build my infrastructure and my infrastructure through ARM templates. But getting the following error.

{
"status": "Failed",
"error": {
    "code": "MissingSubscriptionRegistration",
    "message": "The subscription is not registered to use namespace 'Microsoft.AlertsManagement'. See https://aka.ms/rps-not-found for how to register subscriptions.",
    "details": [
        {
            "code": "MissingSubscriptionRegistration",
            "target": "Microsoft.AlertsManagement",
            "message": "The subscription is not registered to use namespace 'Microsoft.AlertsManagement'. See https://aka.ms/rps-not-found for how to register subscriptions."
        }
    ]
}

}

When I checked further it looks like my subscription is not registered to the resource provider 'Microsoft.AlertsManagement' (See picture below)

https://i.sstatic.net/wTxDD.jpg

I know how I can fix this by going through the Azure portal and registering my Azure Subscription. But I am not able to do the same through ARM templates. Anyone has seen a similar issue and how can I fix it.

I believe it has something to do with the API version of

    "applicationInsightsApiVersion": "2015-05-01",

I am not quite sure what could be the issue, I tried changing the version of the API but no help there.


Solution

  • Registering a resource provider is done at the subscription level. Looking at the supported resources to deploy ARM template at the subscription level, it is not possibe:

    Subscription deployments with ARM templates

    Your best option would be to use Az CLI or Az Powershell as describe here:

    Resolve errors for resource provider registration

    Az Powershell:

    Register-AzResourceProvider -ProviderNamespace Microsoft.AlertsManagement
    

    Az CLI:

    az provider register --namespace Microsoft.AlertsManagement