microsoft / terraform-provider-azuredevops

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

datasource azuredevops_project - Error looking up template by ID #892

Open ncastrocosta opened 1 year ago

ncastrocosta commented 1 year ago

Community Note

Terraform (and Azure DevOps Provider) Version

Terraform v1.5.4 on linux_amd64

azuredevops provider version: 0.9.1

Affected Resource(s)

Terraform Configuration Files

data "azuredevops_project" "myproject" {
  name = "myproject"
}

Debug Output

Panic Output

Expected Behavior

On plan execution, it was expected the data source to be able to read the project details.

Actual Behavior

The following error message:

Error: Error flattening project: Error looking up template by ID: Request returned status: 401 Unauthorized

Although it has the "401 Unauthorized" message, I'm able to read the project using the azuredevops_projects data source.

Steps to Reproduce

  1. terraform plan

Important Factoids

References

xuzhang3 commented 1 year ago

@ncastrocosta The PAT need the permissions to work item template.

browol commented 10 months ago

Adding read permission to the PAT at the Work Items scope works for me.