Got Azure free trial able to create resource using portal. but not able to create resource using terraform

raghavendra a 0 Reputation points
2023-05-01T21:18:53.92+00:00

Got Azure free trial able to create resource using portal. but not able to create resource using terraform.

installed terraform, az cli, configure environment variables

Using terraform could perform below activities

-able to install azure provider successfully

-able to login to azure usign az login

-able to retrieve azure account details using az account show

but not able to create resources using the terraform

Azure Role-based access control
Azure Role-based access control
An Azure service that provides fine-grained access management for Azure resources, enabling you to grant users only the rights they need to perform their jobs.
979 questions
Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

1 answer

Sort by: Most helpful
  1. Marilee Turscak-MSFT 37,206 Reputation points Microsoft Employee Moderator
    2023-05-02T23:16:55.26+00:00

    Hi @raghavendra a

    Could you verify which resource you are trying to create and share more details about your terraform configuration?

    You can try the following steps to troubleshoot the issue:

    1. Confirm that you have the latest Azure provider version and that it is compatible with Terraform. You can check the Terraform documentation to ensure that the Azure provider version is compatible with the version of Terraform you are using. I believe the latest one should be 3.53.0. For example:
    terraform {
          required_providers {
            azurerm = {
              source  = "hashicorp/azurerm"
              version =  "=3.53.0"
            }
          }
        }
        
        provider "azurerm" {
          features {}
        }
    
    1. Validate that your Terraform configuration is correct. You can use the "terraform plan" command to check if the plan is correct and if there are any errors or warnings. https://learn.microsoft.com/en-us/azure/developer/terraform/best-practices-integration-testing#3-validate-terraform-configuration

    Check if the Azure subscription is correct. You can use the "az account show" command to check if the correct Azure subscription is selected.

    1. Check if the resource group and location are correct. You can confirm if the resource group and location specified in the Terraform configuration are correct.

    Let me know if this helps and if you have further questions. If you share more details about which resources you are trying to create and your terraform configuration, I will be able to better assist.

    Additional guide for creating Azure applicatiosn: https://www.terraform.io/docs/providers/azuread/r/application.html

    If the information helped you, please Accept the answer. This will help us as well as others in the community who may be researching similar information.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.