Unable to create Azure resource lock via Terraform

We started receiving the below error while creating Azure resource lock via terraform. The issue started from Friday (03 Dec 2021), prior to this it was working fine. We upgraded the terraform version to the latest (1.0.11) but still same error:

azurerm_management_lock.rglock: Creating…

│ Error: parsing “resource-group-level”: parsing scope prefix: unable to find the scope prefix from the value “resource-group-level” with the regex “^((.){1,})/providers/Microsoft.Authorization/locks/(.){1,}”

Main.tf file:

data “azurerm_resource_group” “example” {

  • name = “testing-terraform-01”*

resource “azurerm_management_lock” “rglock” {

  • name = “resource-group-level”*
  • scope = data.azurerm_resource_group.example.id*
  • lock_level = “ReadOnly”*
  • notes = “This Resource Group is Read-Only”*

Error Screenshot:

This is happening while creating lock for any Azure resource. Strange thing is that I am not having any issue while creating lock via azure cli or portal.

Is this an issue with Terraform? Any suggestion as how to fix this issue?