Microsoft.AVM provider stuck in "Registering" state

94 Views Asked by At

I'm using the terraform azurerm provider, and it get's stuck during initialisation. After some debugging I found that it's waiting for the Microsoft.AVM provider to get registered.

az provider list --query "[?registrationState=='Registering']" -o table shows

Namespace      RegistrationState    RegistrationPolicy
-------------  -------------------  --------------------
Microsoft.AVS  Registering          RegistrationRequired

I tried to az provider unregister --namespace Microsoft.AVS --wait but that also times out after a loooong time. it seems other people have a similar problem: https://github.com/Azure/azure-cli/issues/28349 -

1

There are 1 best solutions below

0
Jahnavi On

Need to check below:

Usually unregistering a provider like Microsoft.AVS with Azure CLI or PowerShell takes longer than expected as it will also delete the dependent resources also along with the given provider.

enter image description here

As you have given, the bug has already been raised on this specific issue in Github.

Temporarily, check below points to resolve the issue.

1.

By default, terraform will attempt to register any Resource Providers that it supports, even if they're not used in your configurations.

Refer skip_provider_registration argument available in terraform.

To disable registration of default providers, add below code in terraform code.

provider "azurerm" { 
skip_provider_registration = "true" 
features {} 
}
  1. If you're running in an environment with restricted permissions or wish to manage Resource Provider Registration outside of Terraform you may wish to disable this flag.

As mentioned above, you need to have a proper permission to register/unregister certain providers like AVS. Make sure that you have a contributor role assigned under your tenant.

  1. Time out issue might also happen if terraform has not been updated to the latest releases. Check azurerm provider latest versions here.

If still the issue persists, contact Azure support team for assistance.