Terraform.tfstate not getting created

Hi,

I am new to Terraform.

I have created a new code to create resource Group and vnet.
executed the following:

  1. az login
  2. terraform init
  3. terraform plan
  4. terraform apply

The resources where created in Azure.

I log off and shutdown my laptop.

I login back in.

I created a new code and try to perform terraform init but the terraform.tfstate file is not getting created.

Kindly advise what could be the reason.
I am using Visual Studio code as the console.

Regards,
Rolex

after this step can you check if the statefile is there?

Hi Ausmartway,

There was an issue with the Tenant ID in Azure.
I found out the notification from Azure after I login using Azure Portal.

I used another subscription id and the state file was created and I was able to deploy the resources in Azure.

Thanks for the feedback.

I am closing this incident.

Regards,
Rolex

1 Like