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
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.
And also try passing
--debug/--verbose
parameters along with theaz 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.I tried to register the
"Microsoft.Web"
namespace in myAzCLI
environment and was good to proceed without any conflicts.Check the registration status by using below
CLI
command which gives output as shown below.If still the issue persists with
CLI
, try usingPowerShell
command to register the provider.Note: If still the issue persists, raise a support request with the Azure CLI team as it might help to resolve the issue quickly.
It worked for me when completed via Azure Portal
Subscriptions -> resource provider-> search and register e.g. Microsoft.Web