microsoft / azure-pipelines-extensions

Collection of all RM and deployment extensions
http://www.visualstudio.com/explore/release-management-vs
MIT License
279 stars 422 forks source link

Terraform fails with to be managed via Terraform this resource needs to be imported into the State. Please see the resource documentation for "azurerm_resource_group" for more information #822

Open iamsoorya opened 4 years ago

iamsoorya commented 4 years ago

With AzureRM 2.x, we get the below error for any pipeline : 0Z Error: A resource with the ID "/subscriptions/4c1xxxxxxxxx1ee-8e0d-7acf7e9a55e8/resourceGroups/rg-imo-weu-lgr-qa-1" already exists - to be managed via Terraform this resource needs to be imported into the State. Please see the resource documentation for "azurerm_resource_group" for more information. 2020-05-26T18:49:47.0551294Z 2020-05-26T18:49:47.0558700Z  on 03ResourceGroup.tf line 2, in resource "azurerm_resource_group" "rg_resource_group": 2020-05-26T18:49:47.0570040Z 2: resource "azurerm_resource_group" "rg_resource_group" { 2020-05-26T18:49:47.0576465Z  2020-05-26T18:49:47.0579184Z 

First time the pipeline is successful, subsequent runs do not work.

Please help. I have not been able to use Azure RM 2.0 at all.. 1.44.0 works fine.

RS1989 commented 4 years ago

I had the same issue Had solved it using terrafom backend config with access key to blob

iamsoorya commented 4 years ago

We are repeated getting the state issue. We have stayed away from updating to AzureRM 2.0 Do we need to buy licensed version of Terraform to make this work?