Unable to access Azure playground via terraform

@Tej-Singh-Rana @rob_kodekloud pls help
I am unable to access azure playground via terraform. Tried logging out and login back in but still getting the same issue.

provider “azurerm” {
features {

}
}

data “azurerm_resource_group” “myrg” {
name = “kml_rg_main-90a88dbe89a24d0e”

}

resource “azurerm_virtual_network” “vnet” {
address_space = [“10.0.0.0/16”]
name = “vnet”
location = data.azurerm_resource_group.myrg.location
resource_group_name = data.azurerm_resource_group.myrg.name

}

Error:

authorization failed: registering resource provider “Microsoft.Devices”: unexpected status 403 (403 Forbidden) with error: AuthorizationFailed: The client ‘kk_lab_user_main-90a88dbe89a24d0e@azurekmlprodkodekloud.onmicrosoft.com’ with object id ‘d6dae599-5711-4b72-a036-f3277e0d5b15’ does not have authorization to perform action ‘Microsoft.Devices/register/action’ over scope ‘/subscriptions/a2b28c85-1948-4263-90ca-bade2bac4df4’ or the scope is invalid. If access was recently granted, please refresh your credentials.

│ with provider[“Terraform Registry”],
│ on main.tf line 1, in provider “azurerm”:
│ 1: provider “azurerm” {

Use the Azure Terraform playground .- scroll down the playground page to find it.

@al1 I have tried that lab as well but still i am facing the same problem

I have used terraform+azure lab. Still I am getting the below error message:

error:

authorization failed: registering resource provider “Microsoft.Cache”: unexpected status 403 (403 Forbidden) with error: AuthorizationFailed: The client ‘13820c6c-b760-42fa-bfd4-e873cd935371’ with object id ‘13820c6c-b760-42fa-bfd4-e873cd935371’ does not have authorization to perform action ‘Microsoft.Cache/register/action’ over scope ‘/subscriptions/a2b28c85-1948-4263-90ca-bade2bac4df4’ or the scope is invalid. If access was recently granted, please refresh your credentials.

│ with provider[“Terraform Registry”],
│ on main.tf line 1, in provider “azurerm”:
│ 1: provider “azurerm” {

code:

provider “azurerm” {
features {}
client_id = “1365fe5e-4358-40bb-9c8b-f55009ff3dab”
client_secret = “xzA8Q~~2Lyo9x6Um7Xte.Cu0Y5E3TV.fLy6m~daV”
tenant_id = “30fe8ff1-adc6-444d-ba94-1238894df42c”
subscription_id = “a2b28c85-1948-4263-90ca-bade2bac4df4”

}

data “azurerm_resource_group” “arg” {
name = “kml_rg_main-49e3440da8474e03”
}

You don’t have to put the credentials in manually they are already pre-configured. Try the playground sample first. Go into the directory and run:

terraform init
terraform apply

Hi Al1 pls look into my issue. In your lab i am getting that message which is mentioned below. Do you really think without proper access i will be able to provision the resources in Azure? Please look into this so that i can study further. If possible we can connect over the webex session also

authorization failed: registering resource provider “Microsoft.DataFactory”: unexpected status 403 (403 Forbidden) with error: AuthorizationFailed: The client ‘kk_lab_user_main-0458db90f0744ec9@azurekmlprodkodekloud.onmicrosoft.com’ with object id ‘35e22ad1-a0b4-42f1-a8f6-deb7683d0874’ does not have authorization to perform action ‘Microsoft.DataFactory/register/action’ over scope ‘/subscriptions/a2b28c85-1948-4263-90ca-bade2bac4df4’ or the scope is invalid. If access was recently granted, please refresh your credentials.

│ with provider[“Terraform Registry”],
│ on main.tf line 1, in provider “azurerm”:
│ 1: provider “azurerm” {

Try the sample first and confirm that is working. Then modify it to your needs.