azure-pipelines-tasks-terraform icon indicating copy to clipboard operation
azure-pipelines-tasks-terraform copied to clipboard

Error shows in log when TF Installer has to create Azure storage account for remote state file

Open andymcadam opened this issue 4 years ago • 0 comments

Describe the bug

When using a new resourcegroup to store teh remote state file, the TerraformCLI command will create the resource group in Azure, then generate an error stating the required storage account does not exist, before then creating the account. This doesn't fail the pipeline but does show as an error, which it shouldn't.

To Reproduce Steps to reproduce the behavior:

  • task: TerraformCLI@0 inputs: command: 'init' workingDirectory: '$(System.DefaultWorkingDirectory)/src/pipelines/scripts/connectManualTestVMs' backendType: 'azurerm' backendServiceArm: 'DevTest Testing' ensureBackend: true backendAzureRmResourceGroupName: '${{ variables.resourceGroup }}' backendAzureRmResourceGroupLocation: '${{ variables.location }}' backendAzureRmStorageAccountName: '${{ variables.saName }}' backendAzureRmStorageAccountSku: 'Standard_LRS' backendAzureRmContainerName: '${{ variables.containerName }}' backendAzureRmKey: 'terraform.tfstate' allowTelemetryCollection: true
  1. Execute pipeline
  2. See error in log when storage account required creating, even though ensureBackend is set to true.

Expected behavior Storage account should be created as the next command after the creation of the resource group, instead it tries to find the storage account, generating the error.

Screenshots image

Agent Configuration

  • OS: Windows -latest
  • Hosted
  • Terraform version used:1.0.0

Additional context Add any other context about the problem here.

andymcadam avatar Oct 05 '21 21:10 andymcadam