skip to Main Content

From terraform I am trying to create Azure function app. It was working till last week. Now I am trying to deploy to a new Subscription. In that subscription none of the resource providers were registered. So terraform tries to register during "terraform apply". Fails with below step

│ Original Error: Cannot register providers: Microsoft.Web. Errors were: waiting for Subscription Provider (Subscription: "xxxxxx"
│ Provider Name: "Microsoft.Web") to be registered: context deadline exceeded
│ 
│   with provider["registry.terraform.io/hashicorp/azurerm"],
│   on providers.tf line 18, in provider "azurerm":
│   18: provider "azurerm" {
│ 
╵

I also tried to add ‘skip_provider_registration’ and manually tried with AZ cli command. It fails for ‘Microsoft.web’.

az provider register --namespace "Microsoft.Web"

In portal, it stays with ‘Registering’ status for couple of hours.

Is there any workaround?

2

Answers


  1. According to these Microsoft Q&A and github issue discussions, it is an ongoing issue which is happening frequently with the provider registrations when moving to another tenant or subscription. And it is a very transient issue which should go away after some time period.

    Need to check below:

    Before registering a provider check that you have necessary permissions.

    You must have permission to do the /register/action operation for the resource provider. The permission is included in the Contributor and Owner roles as detailed in the MSDoc.

    And also try passing --debug/--verbose parameters along with the az provider register command while registering to retrieve more detailed information on the error part if it fails continuously.

    As you mentioned, you can also go with the skip_provider_registration = true when you are facing this registration kind of errors. But make sure that the providers are to be registered before you are using below field in your code.

    provider "azurerm" { 
    skip_provider_registration = true 
    }
    

    I tried to register the "Microsoft.Web" namespace in my AzCLI environment and was good to proceed without any conflicts.

    az provider register --namespace "Microsoft.Web"
    

    enter image description here

    Check the registration status by using below CLI command which gives output as shown below.

     az provider show --namespace "Microsoft.Web"
    

    enter image description here

    If still the issue persists with CLI, try using PowerShell command to register the provider.

    Register-AzResourceProvider -ProviderNamespace "Microsoft.Web"
    

    Note: If still the issue persists, raise a support request with the Azure CLI team as it might help to resolve the issue quickly.

    Login or Signup to reply.
  2. It worked for me when completed via Azure Portal
    Subscriptions -> resource provider-> search and register e.g. Microsoft.Web

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search