Terraform-provider-azuredevops: Build Definition does not create

Created on 9 Jul 2020  ·  8Comments  ·  Source: microsoft/terraform-provider-azuredevops

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 v0.12.28

  • provider.azuredevops v0.0.1

Affected Resource(s)

  • azuredevops_build_definition

Terraform Configuration Files

terraform {
  required_version = "= 0.12.28"
}

data "azuredevops_project" "mycloud" {
  project_name = "mycloud"
}

resource "azuredevops_serviceendpoint_github" "myservice" {
  project_id            = data.azuredevops_project.mycloud.project_name
  service_endpoint_name = "myservice-pipelines"
  auth_personal {}
}

resource "azuredevops_build_definition" "myservice" {
  project_id      = data.azuredevops_project.myservice.id
  name            = "myservice-pipeline"
  path            = "\\pipelines\\myservice"
  agent_pool_name = "Azure Pipelines"

  ci_trigger {
    use_yaml = true
  }

  repository {
    repo_type             = "GitHub"
    branch_name           = "master"
    repo_id               = "GaborEH/myservice"
    yml_path              = "pipeline.yml"
    service_connection_id = azuredevops_serviceendpoint_github.myservice.id
  }
}

Debug Output

azuredevops_serviceendpoint_github.myservice: Creation complete after 0s [id=ebca5239-39ae-4661-a47d-91a9226ee542]
azuredevops_build_definition.myservice: Creating...
2020/07/09 16:23:29 [DEBUG] azuredevops_build_definition.myservice: applying the planned Create change
2020/07/09 16:23:31 [DEBUG] azuredevops_build_definition.myservice: apply errored, but we're indicating that via the Error pointer rather than returning it: error creating resource Build Definition: Invalid URI: The URI is empty.
2020/07/09 16:23:31 [ERROR] <root>: eval: *terraform.EvalApplyPost, err: error creating resource Build Definition: Invalid URI: The URI is empty.
2020/07/09 16:23:31 [ERROR] <root>: eval: *terraform.EvalSequence, err: error creating resource Build Definition: Invalid URI: The URI is empty.

Error: error creating resource Build Definition: Invalid URI: The URI is empty.

  on main.tf line 15, in resource "azuredevops_build_definition" "myservice":
   1: resource "azuredevops_build_definition" "myservice" {


2020-07-09T16:23:31.764+1000 [DEBUG] plugin: plugin process exited: path="/Users/.terraform/plugins/darwin_amd64/terraform-provider-azuredevops_v0.0.1_x4" pid=31808
2020-07-09T16:23:31.765+1000 [DEBUG] plugin: plugin exited

Expected Behavior

A new Azure Devops pipeline created.

Actual Behavior

terraform apply fails with the following error:

Error: error creating resource Build Definition: Invalid URI: The URI is empty.

Steps to Reproduce

  1. terraform apply

Important Factoids

If I switch from GitHub.com to the build in Azure git repository in the repository block, terraform apply succeeds.

References

N/A

  • #0000
bug

Most helpful comment

Hi @GaborEH This is a breaking change of API . We have located the problem and will fix this soon. Thanks for your feedback.

All 8 comments

Shouldn't this:

project_id      = data.azuredevops_project.CloudServices.id

be this:

project_id      = data.azuredevops_project.mycloud.id

Not sure if that's the root cause

Shouldn't this:

project_id      = data.azuredevops_project.CloudServices.id

be this:

project_id      = data.azuredevops_project.mycloud.id

Not sure if that's the root cause

@EliiseS: Good morning – My apologies but that was a copy-paste error and the actual code does have the correct and matching resource names. Anyways, I corrected the naming in my original bug report and I can confirm that it still does fail to run.

Hi @GaborEH This is a breaking change of API . We have located the problem and will fix this soon. Thanks for your feedback.

Hi @GaborEH This is a breaking change of API . We have located the problem and will fix this soon. Thanks for your feedback.

Thank you @xuzhang3

👍 Please kindly fix this bug.

Closing as this issue has been fixed in #105

Thank you @xuzhang3 and @EliiseS

I could not find a release where this change has been incorporated. currently, we are forking this repo and creating our own releases. please update releases after 0.0.1.

Was this page helpful?
0 / 5 - 0 ratings