terraform-provider-azuredevops icon indicating copy to clipboard operation
terraform-provider-azuredevops copied to clipboard

Importing azuredevops_project does not find existing assets

Open avosepp opened this issue 3 years ago • 3 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and Azure DevOps Provider) Version

Terraform v1.1.9 on darwin_arm64

  • provider registry.terraform.io/microsoft/azuredevops v0.2.1

Affected Resource(s)

  • azuredevops_project

Terraform Configuration Files

Encrypted with public key https://keybase.io/hashicorp -----BEGIN PGP MESSAGE-----

hQIMA1RCL2EjebqaAQ/+J4alxIsCa9Ks0QIOh3I95D4wGUlwwa3aRt4noqDNJbxd P0pfeGykbV3FjTDLsVln3ro+pVEKxTxwSN65/Kz0Lt5cWO679aI52+n6A/CCK/nR 3eZKJUjo0x3JrauSxK0PoQLzB20I4GKJlWl05G5cw2zgF1T+GQ4krDt7V7+GcgoA 9uSaihGKUK2f00MpmTDWdN0+/gt+b2PtQK/z6e1/FE7HCS4BqiEMXVMoHJFCODh3 jT5P5MM2HkwJaYfGM/1vvJl7y6NBp0duPvg0gwZMlIdRyIdiEcv6XsqtjjiBq2wW M8Xd/8ysIxKPmuQgq4VPORW1v7vaOd0j21vzQr4teGCU9EWPYCp3FSfU3OzdfDKi H/ro2/S7JyEkS6x+VHVnbxJLrGtG+lkvXd3es7ZNxZHgn8XDXV91rjyNzxaOlkLt 7vGtjfYoNIZFceUIusOFlV/TKWN4Pv6+z3iiMBqeLNpUAOKtpxmuCchW1x4sfH+K Ej4vBi3bEOvfwa1Wk3xoRIvYQ3p1NgRuIxK3KckTpjVAhjQiFeAw5bC7ANAn8ALA Zjyo1QPj1+TQqDA2bNaahJbD3d4lRQBKtdoqxLURpl+/JAl5QtGTqe9NCNm2VJxl gLiyXTu50B/ZhzlvxLF154FC9YlzJPcRBLEn2jY1kG9Bl8DhUiwHWwmGI/Dhb03S wDYBOeQLdo+HzacFdfnjDl4JI4dckONxOPV+v7Q9G07XBvdIB81Bwc7GUUJD3uHH 9g7rbe92mQXBHFQwqhmspTsp2oJ39Nbe6jAcrAT1epTHPoxdkW2A8Ip7uIombgwB +RkfheTiZLbYqHzD/4TaA/I5KflpfgFAV942SSt6Qg2eEmj9KjoTZfDv9pfTubXb bT76dkOwtOK/SDJzxBsKN09wo0HPE5Iub8OOwWxRK3G4BykJ9JmcyQrXXyK9yGPp enm3YWVmYxIwllPZqy3ph0ThLN0EfW5aTxRSxU2jQyIsha8SWU71py9QmQJc95qr 2DnIvUvDplQ= =u6Fp -----END PGP MESSAGE-----

Debug Output

https://gist.github.com/avo-sepp/f101decedf31373bff80b81ca3123bea

Expected Behavior

Terraform should have imported the project into the state file.

Actual Behavior

Terraform could not find the project.

Steps to Reproduce

  1. terraform import azuredevops_project.<tf_name> 00000000-0000-0000-0000-000000000000
  2. azuredevoops_project.terraformmodules: Refreshing state... [id=00000000-0000-0000-0000-000000000000]
  3. Error: Error looking up project with ID 00000000-0000-0000-000000000000 and Name

Important Factoids

REST API command produces results using either the Project ID or Name. Azure Devops REST API successfully finds the project. Terraform is unable to find the project using either value. Terraform Plan will show it is trying to create the project even though the project does exist.

References

  • #0000

avosepp avatar May 12 '22 14:05 avosepp

@avo-sepp What permission does your PAT have?

xuzhang3 avatar May 13 '22 08:05 xuzhang3

@xuzhang3 I own the project, my PAT has full permissions.

avosepp avatar May 13 '22 11:05 avosepp

@avo-sepp Can you help decrypt the error logs? My keybase is installed on another device and I cannot get it.

xuzhang3 avatar May 16 '22 03:05 xuzhang3