microsoft / terraform-provider-azuredevops

Terraform Azure DevOps provider
https://www.terraform.io/docs/providers/azuredevops/
MIT License
385 stars 276 forks source link

provider "azuredevops". Error: The resource cannot be found. #581

Closed ghost closed 2 weeks ago

ghost commented 2 years ago

Affected Resource(s)

providers.tf file

 terraform {
  required_providers {
    azuread = {
      source = "hashicorp/azuread"
      version = "2.19.1"
    }
    azuredevops = {
      source = "microsoft/azuredevops"
      version = "0.2.1"
    }
    azurerm = {
      source = "hashicorp/azurerm"
      version = "3.0.2"
    }    
  }
}

provider "azuread" {
    # Configuation here
}

provider "azuredevops" {
   org_service_url = "<AZDO_ORG_SERVICE_URL>"
   personal_access_token = "<AZDO_PERSONAL_ACCESS_TOKEN>"
}

provider "azurerm" {
    # Configuation here
}

Error Output

│ Error: The resource cannot be found.
│ 
│   with provider["registry.terraform.io/microsoft/azuredevops"],
│   on providers.tf line 18, in provider "azuredevops":
│   18: provider "azuredevops" {

Output of terraform providers

Providers required by configuration:
.
├── provider[registry.terraform.io/microsoft/azuredevops] 0.2.1
├── provider[registry.terraform.io/hashicorp/azurerm] 3.0.2
└── provider[registry.terraform.io/hashicorp/azuread] 2.19.1

Expected Behavior

terraform plan should run successfully as it was previously running fine a few hours ago.

Actual Behavior

It was okay a few hours ago. Then suddenly the resource cannot be found for some reason. No changes were made to the code

Steps to Reproduce

  1. terraform apply
xuzhang3 commented 2 years ago

@devsecops-titan can you re-init and try again? azuredevops is set to v0.2.1 in the TF script but output is v0.1.8

ghost commented 2 years ago

sorry. that was an old terraform provider output. the output is 0.2.1. I've tried terraform init followed by a terraform plan several times and the error still occurs. i upgraded from azuredevops v0.8.1 and ran terraform init upgrade followed by terraform plan. Same error. Init runs fine, but plan and apply fail with that error.

xuzhang3 commented 2 years ago

@devsecops-titan I cannot reproduce this error, can you turn on the logging and provide the error log? ENV config:

export TF_LOG=TRACE
export TF_LOG_PATH=<LOG_PATH>