I am getting "Failed to query available provider packages"


I am working on Terraform Azure provider, when I run the terraform init command getting this error.
│ Error: Failed to query available provider packages

│ Could not retrieve the list of available versions for provider hashicorp/azure: provider registry registry.terraform.io does not have a provider named registry.terraform.io/hashicorp/azure

│ Did you intend to use terraform-providers/azure? If so, you must specify that source address in each module which requires that provider. To see which modules are currently depending on hashicorp/azure, run the following
│ command:
│ terraform providers

Things have been tried.

  1. Uninstall and re-install the terraform.
  2. Upgrade the version of the terraform.
    3 Hardcoded the latest version.

Still receiving the same error.

I tried a lot to find the answer but could not get the proper answer.