Setting Terraform env variables correctly for Azure resources

The run is canceled because it is expecting input for var.client_id.

2020/11/05 13:49:03 [DEBUG] backend/local: will prompt for input of unset required variables [subscription_id client_id client_secret tenant_id]
2020/11/05 13:49:03 [DEBUG] command: asking for input: "var.client_id"
var.client_id
  The Azure Service Principal app ID.

Error: The operation was canceled.

You suggest it is included with terraform.tfvars, but there is not indication it is read in. A lot of default .gitignore files for terraform ignore terraform.tfvars.

Further you are mixing your authentication method with both variable input and environment variables. The practice I follow is to store the secrets in github and use the environment. It is a security risk and considered bad practice to commit your credentials.

To fix your issues you can probably delete these [subscription_id client_id client_secret tenant_id] variables.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top