Git Product home page Git Product logo

terraform-provider-azuredevops's Introduction

Terraform Provider for Azure DevOps (Devops Resource Manager)

Gitter Go Report Card

The AzureRM Provider supports Terraform 0.12.x and later.

Usage Example

# Make sure to set the following environment variables:
#   AZDO_PERSONAL_ACCESS_TOKEN
#   AZDO_ORG_SERVICE_URL
terraform {
  required_providers {
    azuredevops = {
      source = "microsoft/azuredevops"
      version = ">=0.1.0"
    }
  }
}

resource "azuredevops_project" "project" {
  name = "My Awesome Project"
  description  = "All of my awesomee things"
}

resource "azuredevops_git_repository" "repository" {
  project_id = azuredevops_project.project.id
  name       = "My Awesome Repo"
  initialization {
    init_type = "Clean"
  }
}

resource "azuredevops_build_definition" "build_definition" {
  project_id = azuredevops_project.project.id
  name       = "My Awesome Build Pipeline"
  path       = "\\"

  repository {
    repo_type   = "TfsGit"
    repo_id     = azuredevops_git_repository.repository.id
    branch_name = azuredevops_git_repository.repository.default_branch
    yml_path    = "azure-pipelines.yml"
  }
}

Developer Requirements

  • Terraform version 0.13.x +
  • Go version 1.16.x (to build the provider plugin)

If you're on Windows you'll also need:

If you what to use the makefile build strategy on Windows it's required to install

For GNU32 Make, make sure its bin path is added to PATH environment variable.*

For Git Bash for Windows, at the step of "Adjusting your PATH environment", please choose "Use Git and optional Unix tools from Windows Command Prompt".*

As described below we provide some PowerShell scripts to build the provider on Windows, without the requiremet to install any Unix based tools aside Go.

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.16+ is required). You'll also need to correctly setup a GOPATH, as well as adding $GOPATH/bin to your $PATH.

Using the GOPATH model

First clone the repository to: $GOPATH/src/github.com/microsoft/terraform-provider-azuredevops

$ mkdir -p $GOPATH/src/github.com/terraform-providers && cd "$_"
$ git clone [email protected]:microsoft/terraform-provider-azuredevops.git
$ cd terraform-provider-azuredevops

Once you've cloned, run the ./scripts/build.sh and ./scripts/local-install.sh, as recommended here. These commands will sideload the plugin for Terraform.

Using a directory separate from GOPATH

The infrastructure supports building and testing the provider outside GOPATH in an arbitrary directory. In this scenario all required packages of the provider during build will be managed via the pkg in $GOPATH. As with the GOPATH Model, you can redefine the GOPATH environment variable to prevent existing packages in the current GOPATH directory from being changed.

Build using make

Once inside the provider directory, you can run make tools to install the dependent tooling required to compile the provider.

At this point you can compile the provider by running make build, which will build the provider and put the provider binary in the $GOPATH/bin directory.

$ make build
...
$ $GOPATH/bin/terraform-provider-azuredevops
...

You can also cross-compile if necessary:

GOOS=windows GOARCH=amd64 make build

Unit tests

In order to run the Unit Tests for the provider, you can run:

$ make test

With VSCode Golang extension you can also run and debug the tests using run test, debug test run package tests, run file tests buttons.

Acceptance tests

The majority of tests in the provider are acceptance tests - which provisions real resources in Azure Devops and Azure. To run any acceptance tests you need to set AZDO_ORG_SERVICE_URL, AZDO_PERSONAL_ACCESS_TOKEN environment variables, some test have additional environment variables required to run. You can find out the required environment variables by running the test. Most of these variables can be set to dummy values.

The several options to run the tests are:

  • Run the entire acceptance test suite

    make testacc
  • Run a subset using a prefix

    make testacc TESTARGS='-run=TestAccBuildDefinitionBitbucket_Create' TESTTAGS='resource_build_definition'
  • With VSCode Golang extension you can also run the tests using run test, run package tests, run file tests buttons above the test

Scaffolding the Website Documentation

You can scaffold the documentation for a Data Source by running:

$ make scaffold-website BRAND_NAME="Agent Pool" RESOURCE_NAME="azuredevops_agent_pool" RESOURCE_TYPE="data"

You can scaffold the documentation for a Resource by running:

$ make scaffold-website BRAND_NAME="Agent Pool" RESOURCE_NAME="azuredevops_agent_pool" RESOURCE_TYPE="resource" RESOURCE_ID="00000000-0000-0000-0000-000000000000"

BRAND_NAME is the human readable name of the object that is handled by a Terraform resource or datasource, like Agent Pool, User Entitlement or Kubernetes Service Endpoint

Build using PowerShell scripts

If you like to develop on Windows, we provide a set of PowerShell scripts to build and test the provider. They don't offer the luxury of a Makefile environment but are quite sufficient to develop on Windows.

scripts\build.ps1

The build.ps1is used to build the provider. Aside this the script runs (if not skipped) the defined unit tests and is able to install the compiled provider locally.

Parameter Description
-SkipTests Skip running unit tests during build
-Install Install the provider locally, after a successful build
-DebugBuild Build the provider with extra debugging information
-GoMod Control the -mod build parameter: Valid values: '' (Empty string), 'vendor', 'readonly'

scripts\unittest.ps1

The script is used to execute unit tests. The script is also executed by build.ps1 if the -SkipTest are not specified.

Parameter Description
-TestFilter A GO regular expression which filters the test functions to be executed
-Tag Tests in the provider project are organized with GO build tags. The parameter accepts a list of tag names which should be tested.
-GoMod Control the -mod build parameter: Valid values: '' (Empty string), 'vendor', 'readonly'

scripts\acctest.ps1

The script is used to execute unit tests.

Parameter Description
-TestFilter A GO regular expression which filters the test functions to be executed
-Tag Tests in the provider project are organized with GO build tags. The parameter accepts a list of tag names which should be tested.
-GoMod Control the -mod build parameter: Valid values: '' (Empty string), 'vendor', 'readonly'

scripts\gofmtcheck.ps1

To validate if all .go files adhere to the required formatting rules, execute gofmtcheck.ps1

Parameter Description
-Fix Fix any formatting rule deviations automatically. If the parameter is not set, the script runs in report mode.

scripts\lint-check-go.ps1

Like with gofmtcheck.ps1 the script validate if all .go files adhere to the required formatting rules and if any style mistakes exist. In difference to gofmtcheck.ps1 the script uses Golint instead of Gofmt.

Environment variables for acceptance tests

The following Environment Variables must be set in your shell prior to running acceptance tests:

  • AZDO_ORG_SERVICE_URL
  • AZDO_PERSONAL_ACCESS_TOKEN
  • AZDO_DOCKERREGISTRY_SERVICE_CONNECTION_EMAIL
  • AZDO_DOCKERREGISTRY_SERVICE_CONNECTION_PASSWORD
  • AZDO_DOCKERREGISTRY_SERVICE_CONNECTION_USERNAME
  • AZDO_GITHUB_SERVICE_CONNECTION_PAT
  • AZDO_TEST_AAD_USER_EMAIL
  • AZDO_TEST_AAD_GROUP_ID

Note: Acceptance tests create real resources in Azure DevOps which often cost money to run.

terraform-provider-azuredevops's People

Contributors

a30004053 avatar bartvdbraak avatar billbirchatcoles avatar bobmhong avatar chathuru avatar chienfuchen32 avatar cyb3rdudu avatar davidcorrigan714 avatar dependabot[bot] avatar eliises avatar favoretti avatar fruchtiii avatar hbuckle avatar ironmania avatar ivi-vink avatar jaredfholgate avatar jaroslav-svoboda avatar josh-barker avatar josh-barker-coles avatar konturn avatar leasley199 avatar mikaelkrief avatar rdalbuquerque avatar setsudanhana avatar tiwood avatar tmeckel avatar uanid avatar wetwicky avatar xuzhang3 avatar zhmurko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

terraform-provider-azuredevops's Issues

Failure Creating Repo + CI

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.26
+ provider.azuredevops v0.0.1

Affected Resource(s)

  • azuredevops_build_definition`

Terraform Configuration Files

provider "azuredevops" {
  version = ">= 0.0.1"
}

resource "azuredevops_git_repository" "repo" {
  project_id = "some-guid"
  name       = "some-name"
}

resource "azuredevops_build_definition" "build" {
  project_id = "some-guid"
  name       = "some-name - CI"
 
  repository {
    repo_type   = "TfsGit"
    repo_id   = azuredevops_git_repository.repo.id
    branch_name = azuredevops_git_repository.repo.default_branch
    yml_path    = "azure-pipelines.yml"
  }
}

Debug Output

https://gist.github.com/lfmundim/8083ce0abadb4567545e33ace29ba4bf

Panic Output

https://gist.github.com/lfmundim/7658419c40c4607ae88ff459da79f6c0

Expected Behavior

New repo and CI should have been created

Actual Behavior

New repo was created

Steps to Reproduce

  1. terraform init
  2. terraform apply

Important Factoids

Following (partly) the article that marked the release of v0.0.1 of the AZDO provider, along with the official reference. The .tf works fine without the azuredevops_build_definition section

azuredevops provider causes error="exit status 2" when run in pipeline

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

Affected Resource(s)

  • azuredevops_serviceendpoint_azurerm

Debug Output

2020-07-02T09:53:27.2589997Z 2020/07/02 09:53:27 [TRACE] GRPCProvider: ReadResource
2020-07-02T09:53:27.2590805Z azuread_group_member.service_principal_tf_access["numanagement"]: Refreshing state... [id=2200fae0-70c8-41ca-90dd-dbd2aefe1b75/member/30c2715a-9afa-4fd3-a439-a98265219c96]
2020-07-02T09:53:27.2592201Z 2020-07-02T09:53:27.254Z [DEBUG] plugin.terraform-provider-azuread_v0.10.0_x4: User-Agent: Go/go1.14.2 (amd64-linux) go-autorest/v14.0.0 Azure-SDK-For-Go/v42.1.0 graphrbac/1.6 HashiCorp Terraform/0.12.28 (+https://www.terraform.io) Terraform Plugin SDK/1.6.0 terraform-provider-azuread/0.10.0 VSTS_f9ed5db8-47f3-4826-8a51-a7e7064eb962_Release__45_83_2
2020-07-02T09:53:27.2593347Z 2020-07-02T09:53:27.254Z [DEBUG] plugin.terraform-provider-azuread_v0.10.0_x4: Accept-Encoding: gzip
2020-07-02T09:53:27.2593974Z 2020-07-02T09:53:27.254Z [DEBUG] plugin.terraform-provider-azuread_v0.10.0_x4: 
2020-07-02T09:53:27.2594577Z 2020-07-02T09:53:27.254Z [DEBUG] plugin.terraform-provider-azuread_v0.10.0_x4: 
2020-07-02T09:53:27.2595283Z 2020-07-02T09:53:27.254Z [DEBUG] plugin.terraform-provider-azuread_v0.10.0_x4: 2020/07/02 09:53:27 [DEBUG] AzureAD Request: 
2020-07-02T09:53:27.2596462Z 2020-07-02T09:53:27.254Z [DEBUG] plugin.terraform-provider-azuread_v0.10.0_x4: GET /***/groups/2200fae0-70c8-41ca-90dd-dbd2aefe1b75/members?api-version=1.6 HTTP/1.1
2020-07-02T09:53:27.2597449Z 2020-07-02T09:53:27.254Z [DEBUG] plugin.terraform-provider-azuread_v0.10.0_x4: Host: graph.windows.net
2020-07-02T09:53:27.2598733Z 2020-07-02T09:53:27.254Z [DEBUG] plugin.terraform-provider-azuread_v0.10.0_x4: User-Agent: Go/go1.14.2 (amd64-linux) go-autorest/v14.0.0 Azure-SDK-For-Go/v42.1.0 graphrbac/1.6 HashiCorp Terraform/0.12.28 (+https://www.terraform.io) Terraform Plugin SDK/1.6.0 terraform-provider-azuread/0.10.0 VSTS_f9ed5db8-47f3-4826-8a51-a7e7064eb962_Release__45_83_2
2020-07-02T09:53:27.2599806Z 2020-07-02T09:53:27.254Z [DEBUG] plugin.terraform-provider-azuread_v0.10.0_x4: Accept-Encoding: gzip
2020-07-02T09:53:27.2600446Z 2020-07-02T09:53:27.254Z [DEBUG] plugin.terraform-provider-azuread_v0.10.0_x4: 
2020-07-02T09:53:27.2601032Z 2020-07-02T09:53:27.254Z [DEBUG] plugin.terraform-provider-azuread_v0.10.0_x4: 
2020-07-02T09:53:27.2835364Z 2020-07-02T09:53:27.280Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: azuread_group_member.service_principal_tf_access["leistungsmeldung"]: Refreshing state... [id=db5c0559-eaf7-4ef3-99d5-495bd26ae84e/member/a22f874c-ad08-47ad-a907-e23202ed71bc]
2020-07-02T09:53:27.3010318Z azuread_group_member.service_principal_contributor["leistungsmeldung"]: Refreshing state... [id=628d9e69-ae5f-4add-ada7-c822434d5060/member/a22f874c-ad08-47ad-a907-e23202ed71bc]
2020-07-02T09:53:27.3093957Z azuread_group_member.service_principal_contributor["mobilelv"]: Refreshing state... [id=ca46878e-d0bb-44e5-8cd2-e69a15a26773/member/b283e5f8-13e8-4058-b9df-ec57aa43a7be]
2020-07-02T09:53:27.3411143Z azuread_group_member.service_principal_contributor["numanagement"]: Refreshing state... [id=96775237-7946-42ce-b214-b47fbc49a4ad/member/30c2715a-9afa-4fd3-a439-a98265219c96]
2020-07-02T09:53:27.3496538Z azuread_group_member.service_principal_contributor["bidderoffer"]: Refreshing state... [id=d4b46ea4-f1f0-4136-b162-d7f83094c067/member/e75073c6-7641-4a8c-a7ea-f346fe9fd571]
2020-07-02T09:53:27.3563653Z azuread_group_member.service_principal_contributor["businessintelligence"]: Refreshing state... [id=a394c0cf-97d1-40d3-8b1a-209bb1935fc1/member/1b7cef24-175c-4a06-a11c-e2c3b2bc3fcd]
2020-07-02T09:53:27.7013331Z panic: runtime error: invalid memory address or nil pointer dereference
2020-07-02T09:53:27.7014718Z 2020-07-02T09:53:27.280Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xe4e6a9]
2020-07-02T09:53:27.7015595Z 2020-07-02T09:53:27.280Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: 
2020-07-02T09:53:27.7016375Z 2020-07-02T09:53:27.280Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: goroutine 55 [running]:
2020-07-02T09:53:27.7017595Z 2020-07-02T09:53:27.280Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: github.com/terraform-providers/terraform-provider-azuredevops/azuredevops/internal/service/serviceendpoint.doBaseFlattening(0xc0001a6930, 0xc0004f1c80, 0xc00056d0b0)
2020-07-02T09:53:27.7019057Z 2020-07-02T09:53:27.280Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azuredevops/azuredevops/internal/service/serviceendpoint/commons.go:88 +0x179
2020-07-02T09:53:27.7020521Z 2020-07-02T09:53:27.280Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: github.com/terraform-providers/terraform-provider-azuredevops/azuredevops/internal/service/serviceendpoint.flattenServiceEndpointAzureRM(0xc0001a6930, 0xc0004f1c80, 0xc00056d0b0)
2020-07-02T09:53:27.7022346Z 2020-07-02T09:53:27.280Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azuredevops/azuredevops/internal/service/serviceendpoint/resource_serviceendpoint_azurerm.go:127 +0x5a
2020-07-02T09:53:27.7023939Z 2020-07-02T09:53:27.280Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: github.com/terraform-providers/terraform-provider-azuredevops/azuredevops/internal/service/serviceendpoint.genServiceEndpointReadFunc.func1(0xc0001a6930, 0xee91e0, 0xc000296240, 0xc0001a6930, 0x0)
2020-07-02T09:53:27.7025458Z 2020-07-02T09:53:27.280Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azuredevops/azuredevops/internal/service/serviceendpoint/commons.go:209 +0x4af
2020-07-02T09:53:27.7026931Z 2020-07-02T09:53:27.280Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc000109800, 0xc0004c9450, 0xee91e0, 0xc000296240, 0xc00000e848, 0x0, 0x0)
2020-07-02T09:53:27.7028680Z 2020-07-02T09:53:27.280Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azuredevops/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/resource.go:455 +0x119
2020-07-02T09:53:27.7030238Z 2020-07-02T09:53:27.280Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ReadResource(0xc0000a6b38, 0x137d860, 0xc000581350, 0xc0004c9270, 0xc0000a6b38, 0xc000581350, 0xc0001dba48)
2020-07-02T09:53:27.7031949Z 2020-07-02T09:53:27.280Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azuredevops/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin/grpc_provider.go:525 +0x3d8
2020-07-02T09:53:27.7033582Z 2020-07-02T09:53:27.280Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ReadResource_Handler(0x10c2d20, 0xc0000a6b38, 0x137d860, 0xc000581350, 0xc000540960, 0x0, 0x137d860, 0xc000581350, 0xc00033af00, 0x26d)
2020-07-02T09:53:27.7035155Z 2020-07-02T09:53:27.280Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azuredevops/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5/tfplugin5.pb.go:3153 +0x217
2020-07-02T09:53:27.7036599Z 2020-07-02T09:53:27.280Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: google.golang.org/grpc.(*Server).processUnaryRPC(0xc0000d6000, 0x138ab80, 0xc0000abe00, 0xc00032f400, 0xc000122120, 0x1af81d0, 0x0, 0x0, 0x0)
2020-07-02T09:53:27.7037965Z 2020-07-02T09:53:27.280Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azuredevops/vendor/google.golang.org/grpc/server.go:995 +0x460
2020-07-02T09:53:27.7039198Z 2020-07-02T09:53:27.281Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: google.golang.org/grpc.(*Server).handleStream(0xc0000d6000, 0x138ab80, 0xc0000abe00, 0xc00032f400, 0x0)
2020-07-02T09:53:27.7040500Z 2020-07-02T09:53:27.281Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azuredevops/vendor/google.golang.org/grpc/server.go:1275 +0xd3d
2020-07-02T09:53:27.7041802Z 2020-07-02T09:53:27.281Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc000428010, 0xc0000d6000, 0x138ab80, 0xc0000abe00, 0xc00032f400)
2020-07-02T09:53:27.7043195Z 2020-07-02T09:53:27.281Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azuredevops/vendor/google.golang.org/grpc/server.go:710 +0xa1
2020-07-02T09:53:27.7044322Z 2020-07-02T09:53:27.281Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: created by google.golang.org/grpc.(*Server).serveStreams.func1
2020-07-02T09:53:27.7045534Z 2020-07-02T09:53:27.281Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azuredevops/vendor/google.golang.org/grpc/server.go:708 +0xa1
2020-07-02T09:53:27.7046838Z 2020-07-02T09:53:27.281Z [DEBUG] plugin: plugin process exited: path=/home/vsts/work/r1/a/IaC/TerraformBundle/.terraform/plugins/linux_amd64/terraform-provider-azuredevops_v0.0.1_x4 pid=3024 error="exit status 2"
2020-07-02T09:53:27.7047623Z 2020/07/02 09:53:27 [ERROR] <root>: eval: *terraform.EvalRefresh, err: rpc error: code = Unavailable desc = transport is closing
2020-07-02T09:53:27.7048280Z 2020/07/02 09:53:27 [ERROR] <root>: eval: *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing
2020-07-02T09:53:27.7048923Z 2020/07/02 09:53:27 [TRACE] [walkRefresh] Exiting eval tree: azuredevops_serviceendpoint_azurerm.service_principals["businessintelligence"]
2020-07-02T09:53:27.7049617Z 2020/07/02 09:53:27 [TRACE] vertex "azuredevops_serviceendpoint_azurerm.service_principals[\"businessintelligence\"]": visit complete
2020-07-02T09:53:27.7050172Z 2020/07/02 09:53:27 [TRACE] <root>: eval: *terraform.EvalSequence
2020-07-02T09:53:27.7050564Z 2020/07/02 09:53:27 [TRACE] <root>: eval: *terraform.EvalGetProvider
2020-07-02T09:53:27.7050971Z 2020/07/02 09:53:27 [TRACE] <root>: eval: *terraform.EvalReadState
2020-07-02T09:53:27.7051526Z 2020/07/02 09:53:27 [TRACE] EvalReadState: reading state for azuread_group_member.service_principal_tf_access["leistungsmeldung"]
2020-07-02T09:53:27.7052675Z 2020/07/02 09:53:27 [TRACE] UpgradeResourceState: schema version of azuread_group_member.service_principal_tf_access["leistungsmeldung"] is still 0; calling provider "registry.terraform.io/-/azuread" for any other minor fixups
2020-07-02T09:53:27.7053338Z 2020/07/02 09:53:27 [TRACE] GRPCProvider: UpgradeResourceState
2020-07-02T09:53:27.7053751Z 2020/07/02 09:53:27 [TRACE] <root>: eval: *terraform.EvalRefreshDependencies
2020-07-02T09:53:27.7054154Z 2020/07/02 09:53:27 [TRACE] <root>: eval: *terraform.EvalRefresh
2020-07-02T09:53:27.7054532Z 2020/07/02 09:53:27 [TRACE] GRPCProvider: ReadResource

Expected Behavior

terraform apply should work in pipeline aswell.

Actual Behavior

terraform fails when run in pipeline

Steps to Reproduce

  • Create a Azure DevOps Pipeline that "Builds" terraform:
terraform init -backend=false -input=false
terraform validate
  • Pack the Build into an Artefact in Azure DevOps
  • Create a realease pipeline that "Deploys" the Artefact:
cd ./IaC/TerraformBundle
chmod +x ./.terraform/plugins/*/*
terraform init -get-plugins=false -get=false -no-color
terraform workspace select testing -no-color
terraform apply -auto-approve -input=false -no-color

The Release Pipeline fails when running terraform apply.

Important Factoids

I did not immediately see the panic: runtime error and created a SO question here. It also contains some more context.

Configure extensions during project deployment


Migrated from #197
Originally created by @gfmatthews on Thu, 07 Nov 2019 18:35:02 GMT


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

Description

We would like to be able to configure and/or install AzDo extensions through the Terraform provider.

New or Affected Resource(s)

AzDo Extensions

Potential Terraform Configuration

I leave the exact implementation of this idea to the project team.

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

References

  • #0000

Investigate a more scalable way to share terraform stanzas used for acceptance testing


Migrated from #122
Originally created by @nmiodice on Thu, 17 Oct 2019 21:41:34 GMT


When writing acceptance tests today it is necessary to write snippets of HCL describing the resources you want to provision in order to run your tests.

This leads to either (1) repetitive code, or (2) sharing resources across tests that should really be isolated to a single test. For example, the code here references an implementation from another test file, here. As the project grows, this will become gnarly!

it would be great if there were a better way to compose fragments of terraform that made writing acceptance tests less painful and repetitive.

Some ideas include:

  • pulling and configuring terraform stanzas from a ./testdata or similar folder. The files could live in the repo and be read from disk at test tiem
  • pulling and configuring terraform stanzas from a go file that exports functions for configuring each resource type.

Acceptance criteria

  • Thought is put behind how to structure the test terraform stanzas so that they are compo-sable and we don't have a nest of shared testing code that is spread out and difficult to understand.
  • implementation story(ies) are written to implement the solution

Implement Terrafrom resource azuredevops_project_permissions


Migrated from #104
Originally created by @tmeckel on Mon, 14 Oct 2019 15:31:03 GMT


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

Description

As a developer, I want the ability to manage the permissions of a project in
Azure DevOps. Thus a new Terraform resource shall be provided.

New or Affected Resource(s)

  • azuredevops_project_permissions

Potential Terraform Configuration

data "azuredevops_project" "project" {
   # Exports: id
   project_name = "Test Project"
}

data "azuredevops_user" "lookup-user" {
   principalname_name  = "[email protected]"
}

resource "azuredevops_group" "project-group" {
    project_id = azuredevops_project.project.id
    name       = "Test Group"
}

resource "azuredevops_project_permissions" "perm-project-group" {
    # Security Namespace: 52d39943-cb85-4d7f-8fa8-c6baac873819

    # Build ACL token from project id (GUID) as follows
    # $PROJECT:vstfs:///Classification/TeamProject/<ProjectGUID>
    project_id = data.azuredevops_project.project.id

    principals = [
        data.azuredevops_user.lookup-user.id_descriptor
        azuredevops_group.project-group.id_descriptor
    ]

    permissions = {
        "Enumerate"            = "Allow"
        "Delete"               = "Deny"
        "Publish_test_results" = "NotSet"
    }
}

Acceptance Criteria

[] Include Unit tests for the new operation

[] Acceptance (integration) test to validate repo creation/modification,
following the patterns from the azuredevops_build_definition resource

References

Implement Terrafrom resource azuredevops_git_permissions


Migrated from #153
Originally created by @tmeckel on Fri, 25 Oct 2019 12:17:24 GMT


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

Description

As a developer, I want the ability to manage the permissions of all Git
repositories inside a project, a single Git Repository and a single branch
inside a Git repository in Azure DevOps. Thus a new Terraform resource shall be
provided.

The resource shall provide three attributes to define the scope on which the
permissions should be applied:

  • project_id (required)
  • repository_id (optional)
  • branch_id (optional)

Logic:

  1. to apply permissions to all Git repositories inside a project set project_id
  2. to apply permissions to a specific Git repository inside a project set project_id and repository_id
  3. to apply permissions to a branch inside a Git repository of a project set project_id, repository_id and branch_id

The resource shall issue an error if:

  1. the project_id is not set
  2. the branch_id is set without having set repository_id

New or Affected Resource(s)

  • azuredevops_git_permissions

Potential Terraform Configuration

data "azuredevops_project" "project" {
   # Exports: id
   project_name = "Test Project"
}

resource "azuredevops_group" "project-group" {
    # Exports: id, descriptor (Security Descriptor)
    project_id = data.azuredevops_project.project.id
    name       = "Test Group"
}

data "azuredevops_git_repository" "repo" {
    name = "RepoV2"
}

data "azuredevops_git_branch" "branch_foobar" {
    name          = "Foobar"
    repository_id = data.azuredevops_git_repository.repo.id
    # Id            = /refs/heads/6d0061007300740065007200
}

resource "azuredevops_git_permissions" "perm" {
    # Security Namespace: 2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87

    // Build ACL token from project id (GUID) as follows
    // repoV2/<projectGUID>/<repoGUID>/<branchGUID>
    project_id    = data.azuredevops_project.project.id
    repository_id = data.azuredevops_git_repository.repo.id
    branch_id     = data.azuredevops_git_branch.branch_foobar.id

    principals = [
        data.azuredevops_project_user.lookup-project-user.id_descriptor
        azuredevops_user.project-user.id_descriptor
        # id_descriptor returns the decoded descriptor value (identity descriptor)
        # id => aad.YmZhYmE4ZDUtZWMzZC03ZjIzLWE4NDktMDM3ZjEwMTEwNDZh
        # id_descriptor => Microsoft.IdentityModel.Claims.ClaimsIdentity;2eb07b91-f9f8-437b-a89e-59f55e565c11\\[email protected]
        azuredevops_group.project-group.id_descriptor
    ]

    permissions = {
        "Administer"   = "Allow"
        "ForcePush"    = "Deny"
        "CreateBranch" = "NotSet"
    }

}

Acceptance Criteria

[] Include Unit tests for the new operation

[] Acceptance (integration) test to validate repo creation/modification,
following the patterns from the azuredevops_build_definition resource

References

  • #0000

GitHub actions do not reflect the correct CI steps. Investigation needed

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

Issue

The GH Actions CI is not updated to use the make commands. But also, we are not seeing any CI reported through any other CI process. This makes it difficult to validate any changes

Automatically include code reviewers in a git repo


Migrated from #364
Originally created by @ferrandinand on Fri, 05 Jun 2020 10:43:24 GMT


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

Description

We would like to add the possibility to configure code reviewers for a repository created in Azure Devops as it is explained in the official documentation (references bellow)

New or Affected Resource(s)

  • azuredevops_code_reviewers

Potential Terraform Configuration

resource "azuredevops_code_reviewers" "p" {
    required-reviewer-ids = ...  // list | required | ForceNew := false
    blocking = ..  // bool | optional | ForceNew := false | OneOf: true, false (default true)

    # can be defined 0 or many times
    scope {
        repository_id = ...  // string | required | ForceNew := false
        repository_ref = ... // string | required | ForceNew := false
        match_type = ...     // string | optional | ForceNew := false | OneOf: "Exact" (default), "Prefix"
    }
    submitter_can_approve = ... // bool | optional | ForceNew := false | OneOf: true, false (default)
}

References

https://docs.microsoft.com/en-us/azure/devops/repos/git/branch-policies?view=azure-devops#automatically-include-code-reviewers

https://docs.microsoft.com/en-us/cli/azure/ext/azure-devops/repos/policy/required-reviewer?view=azure-cli-latest

Add "Path filter" support for repository build policy

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

Description

Add missing filenamePatterns arguments block
https://docs.microsoft.com/en-us/rest/api/azure/devops/policy/configurations/create?view=azure-devops-rest-5.1

New or Affected Resource(s)

  • azuredevops_branch_policy_build_validation

Potential Terraform Configuration

resource "azuredevops_branch_policy_build_validation" "p" {
  project_id = azuredevops_project.p.id

  settings {
    display_name        = "Don't break the build!"
    build_definition_id = azuredevops_build_definition.b.id

    scope {
      repository_id  = azuredevops_git_repository.r.id
      repository_ref = azuredevops_git_repository.r.default_branch
      match_type     = "Exact"
    }

    filename_patterns [
      "/WebApp/*",
      "!/WebApp/Tests/*",
      "*.cs",
    ]
  }
}

References

Authorize service connection use by pipeline via Terraform


Migrated from #142
Originally created by @nmiodice on Tue, 22 Oct 2019 23:15:33 GMT


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

Description

As a developer provisioning new resources in AzDO, i don't want to have to manually grant access to a service endpoint to a build definition. Instead, I want to do this via Terraform.

Acceptance criteria

  • Investigate how to grant a build definition access to a service connection via the AzDO APIs
  • Design an implementation. The implementation should cover the following items, and should be put into the body of this issue and reviewed by the core contributors on the project
    • What will the schema for the resource look like, including computed items?
    • What APIs need to be invoked?
    • What is the implementation strategy?
    • What is the testing strategy?
  • Break down the implementation into stories after the design is done

Terraform crash if initialization not set for git repo

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

Description

Crashes with invalid terraform instead of returning an error.

Valid git_repo:

resource "azuredevops_git_repository" "repo" {
  project_id = azuredevops_project.test.id
  name       = "test-repo"
  initialization {
    init_type = "Clean"
  }
}

Invalid git_repo:

resource "azuredevops_git_repository" "repo" {
  project_id = azuredevops_project.test.id
  name       = "test-repo"
}

Terraform (and Azure DevOps Provider) Version

10:55 # terraform -v
Terraform v0.12.28
+ provider.azuredevops v0.0.1

Affected Resource(s)

  • azuredevops_git_repository

Terraform Configuration Files

provider "azuredevops" {
  version = ">= 0.0.1"
}

resource "azuredevops_project" "test" {
  project_name = "Test Project"
}

resource "azuredevops_git_repository" "repo" {
  project_id = azuredevops_project.test.id
  name       = "test-repo"
}

resource "azuredevops_git_repository" "fork-repo" {
  project_id           = azuredevops_project.test.id
  name                 = "forkk-test-repo"
  parent_repository_id = azuredevops_git_repository.repo.id
}

Panic Output

10:55 # tf apply

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # azuredevops_git_repository.fork-repo will be created
  + resource "azuredevops_git_repository" "fork-repo" {
      + default_branch       = (known after apply)
      + id                   = (known after apply)
      + is_fork              = (known after apply)
      + name                 = "forkk-test-repo"
      + parent_repository_id = (known after apply)
      + project_id           = (known after apply)
      + remote_url           = (known after apply)
      + size                 = (known after apply)
      + ssh_url              = (known after apply)
      + url                  = (known after apply)
      + web_url              = (known after apply)
    }

  # azuredevops_git_repository.repo will be created
  + resource "azuredevops_git_repository" "repo" {
      + default_branch = (known after apply)
      + id             = (known after apply)
      + is_fork        = (known after apply)
      + name           = "test-repo"
      + project_id     = (known after apply)
      + remote_url     = (known after apply)
      + size           = (known after apply)
      + ssh_url        = (known after apply)
      + url            = (known after apply)
      + web_url        = (known after apply)
    }

  # azuredevops_project.test will be created
  + resource "azuredevops_project" "test" {
      + id                  = (known after apply)
      + process_template_id = (known after apply)
      + project_name        = "Test Project"
      + version_control     = "git"
      + visibility          = "private"
      + work_item_template  = "Agile"
    }

Plan: 3 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

azuredevops_project.test: Creating...
azuredevops_project.test: Creation complete after 9s [id=4d72f0bf-5fdf-4b32-b674-7bf7b30a2ab3]
azuredevops_git_repository.repo: Creating...

Error: rpc error: code = Unavailable desc = transport is closing


panic: runtime error: invalid memory address or nil pointer dereference
2020-07-17T10:55:27.300Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xdf6554]
2020-07-17T10:55:27.300Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: 
2020-07-17T10:55:27.300Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: goroutine 56 [running]:
2020-07-17T10:55:27.300Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: github.com/terraform-providers/terraform-provider-azuredevops/azuredevops/internal/service/git.resourceGitRepositoryCreate(0xc0001c4d90, 0xee91e0, 0xc000312240, 0x2, 0x1b328a0)
2020-07-17T10:55:27.300Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4:       /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azuredevops/azuredevops/internal/service/git/resource_git_repository.go:173 +0x444
2020-07-17T10:55:27.300Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Apply(0xc00018dd00, 0xc000512d70, 0xc000421720, 0xee91e0, 0xc000312240, 0xf90f01, 0xc0000a1608, 0xc0005bc600)
2020-07-17T10:55:27.301Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4:       /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azuredevops/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/resource.go:305 +0x365
2020-07-17T10:55:27.301Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Apply(0xc0004f6780, 0xc0002678e0, 0xc000512d70, 0xc000421720, 0xc0001322c8, 0xc00000e850, 0xf92fa0)
2020-07-17T10:55:27.301Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4:       /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azuredevops/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/provider.go:294 +0x99
2020-07-17T10:55:27.301Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc00000e5d0, 0x137d860, 0xc0006710e0, 0xc000672660, 0xc00000e5d0, 0xc0006710e0, 0xc000296a48)
2020-07-17T10:55:27.301Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4:       /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azuredevops/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin/grpc_provider.go:885 +0x8b4
2020-07-17T10:55:27.301Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x10c2d20, 0xc00000e5d0, 0x137d860, 0xc0006710e0, 0xc000672600, 0x0, 0x137d860, 0xc0006710e0, 0xc000744380, 0x1af)
2020-07-17T10:55:27.301Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4:       /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azuredevops/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5/tfplugin5.pb.go:3189 +0x217
2020-07-17T10:55:27.301Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: google.golang.org/grpc.(*Server).processUnaryRPC(0xc0003e6000, 0x138ab80, 0xc0004d6780, 0xc00018e500, 0xc0001810e0, 0x1af8200, 0x0, 0x0, 0x0)
2020-07-17T10:55:27.301Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4:       /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azuredevops/vendor/google.golang.org/grpc/server.go:995 +0x460
2020-07-17T10:55:27.301Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: google.golang.org/grpc.(*Server).handleStream(0xc0003e6000, 0x138ab80, 0xc0004d6780, 0xc00018e500, 0x0)
2020-07-17T10:55:27.302Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4:       /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azuredevops/vendor/google.golang.org/grpc/server.go:1275 +0xd3d
2020-07-17T10:55:27.302Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc00003a1d0, 0xc0003e6000, 0x138ab80, 0xc0004d6780, 0xc00018e500)
2020-07-17T10:55:27.302Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4:       /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azuredevops/vendor/google.golang.org/grpc/server.go:710 +0xa1
2020-07-17T10:55:27.302Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: created by google.golang.org/grpc.(*Server).serveStreams.func1
2020-07-17T10:55:27.302Z [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4:       /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azuredevops/vendor/google.golang.org/grpc/server.go:708 +0xa1
2020/07/17 10:55:27 [DEBUG] azuredevops_git_repository.repo: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing
2020/07/17 10:55:27 [TRACE] <root>: eval: *terraform.EvalMaybeTainted
2020/07/17 10:55:27 [TRACE] EvalMaybeTainted: azuredevops_git_repository.repo encountered an error during creation, so it is now marked as tainted
2020/07/17 10:55:27 [TRACE] <root>: eval: *terraform.EvalWriteState
2020/07/17 10:55:27 [TRACE] EvalWriteState: removing state object for azuredevops_git_repository.repo
2020/07/17 10:55:27 [TRACE] <root>: eval: *terraform.EvalApplyProvisioners
2020/07/17 10:55:27 [TRACE] EvalApplyProvisioners: azuredevops_git_repository.repo has no state, so skipping provisioners
2020/07/17 10:55:27 [TRACE] <root>: eval: *terraform.EvalMaybeTainted
2020/07/17 10:55:27 [TRACE] EvalMaybeTainted: azuredevops_git_repository.repo encountered an error during creation, so it is now marked as tainted
2020/07/17 10:55:27 [TRACE] <root>: eval: *terraform.EvalWriteState
2020/07/17 10:55:27 [TRACE] EvalWriteState: removing state object for azuredevops_git_repository.repo
2020/07/17 10:55:27 [TRACE] <root>: eval: *terraform.EvalIf
2020/07/17 10:55:27 [TRACE] <root>: eval: *terraform.EvalIf
2020/07/17 10:55:27 [TRACE] <root>: eval: *terraform.EvalWriteDiff
2020/07/17 10:55:27 [TRACE] <root>: eval: *terraform.EvalApplyPost
2020/07/17 10:55:27 [ERROR] <root>: eval: *terraform.EvalApplyPost, err: rpc error: code = Unavailable desc = transport is closing
2020/07/17 10:55:27 [ERROR] <root>: eval: *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing
2020/07/17 10:55:27 [TRACE] [walkApply] Exiting eval tree: azuredevops_git_repository.repo
2020/07/17 10:55:27 [TRACE] vertex "azuredevops_git_repository.repo": visit complete
2020/07/17 10:55:27 [TRACE] dag/walk: upstream of "azuredevops_git_repository.fork-repo" errored, so skipping
2020/07/17 10:55:27 [TRACE] dag/walk: upstream of "meta.count-boundary (EachMode fixup)" errored, so skipping
2020/07/17 10:55:27 [TRACE] dag/walk: upstream of "provider.azuredevops (close)" errored, so skipping
2020/07/17 10:55:27 [TRACE] dag/walk: upstream of "root" errored, so skipping
2020/07/17 10:55:27 [TRACE] statemgr.Filesystem: reading latest snapshot from terraform.tfstate
2020-07-17T10:55:27.306Z [DEBUG] plugin: plugin process exited: path=/workspaces/terraform-provider-azuredevops/.terraform/plugins/linux_amd64/terraform-provider-azuredevops_v0.0.1_x4 pid=2761 error="exit status 2"
2020/07/17 10:55:27 [TRACE] statemgr.Filesystem: read snapshot with lineage "89db5adf-9c99-f180-9264-a7e3223f79de" serial 1
2020/07/17 10:55:27 [TRACE] statemgr.Filesystem: no original state snapshot to back up
2020/07/17 10:55:27 [TRACE] statemgr.Filesystem: state has changed since last snapshot, so incrementing serial to 2
2020/07/17 10:55:27 [TRACE] statemgr.Filesystem: writing snapshot at terraform.tfstate
2020/07/17 10:55:27 [TRACE] statemgr.Filesystem: removing lock metadata file .terraform.tfstate.lock.info
2020/07/17 10:55:27 [TRACE] statemgr.Filesystem: unlocking terraform.tfstate using fcntl flock
2020-07-17T10:55:27.331Z [DEBUG] plugin: plugin exited



!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Terraform crashed! This is always indicative of a bug within Terraform.
A crash log has been placed at "crash.log" relative to your current
working directory. It would be immensely helpful if you could please
report the crash with Terraform[1] so that we can fix this.

When reporting bugs, please include your terraform version. That
information is available on the first line of crash.log. You can also
get it by running 'terraform --version' on the command line.

SECURITY WARNING: the "crash.log" file that was created may contain 
sensitive information that must be redacted before it is safe to share 
on the issue tracker.

[1]: https://github.com/hashicorp/terraform/issues

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Expected Behavior

Error on missing setup

Actual Behavior

crash

Steps to Reproduce

  1. terraform apply

Investigate org memberships APIs and spike on implementation strategy


Migrated from #124
Originally created by @nmiodice on Fri, 18 Oct 2019 15:27:08 GMT


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

Description

As a developer, I want the ability to query for org-level groups via Terraform so that I can add members to those groups. In order to do this, we need to better understand the APIs for querying org groups to ensure that the implementation in the provider is correct.

New or Affected Resource(s)

  • We should try to re-use the azuredevops_group data source, if at all possible. it is designed in #74

Potential Terraform Configuration

N/A - we should know by the end of the spike

Acceptance Criteria

  • Deep dive on the AzDO APIs for querying org-level groups
  • Develop and document (in this story) a strategy for un-ambiguously identifying a group within an org. The challenging use case is to be able to distinguish between group foo in org bar AND group foo in project bar that exists in org bar
  • Identify if we can re-use azuredevops_group data source for this operation
  • Write story(ies) for implementation

Implement new resource "AWS Service Endpoint"


Migrated from #370
Originally created by @simongottschlag on Tue, 09 Jun 2020 21:02:33 GMT


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

Description

Implement AWS Service Endpoint.

New or Affected Resource(s)

  • azuredevops_serviceendpoint_aws

References

https://github.com/aws/aws-toolkit-azure-devops

https://aws.amazon.com/vsts/

  • #0000

`azuredevops_build_definition` does not report build status to Bitbucket by default

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 0.12.28
azuredevops 0.0.1

Affected Resource(s)

  • azuredevops_build_definition

Terraform Configuration Files

resource "azuredevops_build_definition" "example" {
  project_id      = azuredevops_project.module.id
  name            = "${var.pipeline_name}"
  path            = "\\"
  agent_pool_name = var.agent_pool_name

  ci_trigger {
    use_yaml = true
  }

  pull_request_trigger {
    use_yaml = true

    forks {
      enabled       = false
      share_secrets = false
    }
  }

  repository {
    repo_id               = "${bitbucket_repository.module.owner}/${bitbucket_repository.module.name}"
    repo_type             = "Bitbucket"
    branch_name           = "master"
    service_connection_id = azuredevops_serviceendpoint_bitbucket.bitbucket.id
    yml_path              = "/azure-pipeline.yml"
  }
}

Debug Output

N/A

Panic Output

N/A

Expected Behavior

The pipeline should be created with "Report build status" enabled, this is the behavior if pipeline is created on the web frontend.

Actual Behavior

Pipeline is created, however, "Report build status" is not enabled.
image

Steps to Reproduce

  1. terraform apply

Important Factoids

N/A

References

  • #0000

Using outdated Go version 1.12.10 in GitHub Pipeline

Why is the GitHub pipeline, used to validate Pull Requests, utilizing an outdated Go version 1.12.10, although the build pipeline at the former repository at Microsoft is using at least Go 1.13.1.

The pipeline is now failing on my PR #18 because I'm using the %w formatting statement to wrap an inner error.

https://blog.golang.org/go1.13-errors

# github.com/terraform-providers/terraform-provider-azuredevops/azuredevops/internal/service/core
##[error]azuredevops/internal/service/core/data_project.go:39:10: Errorf format %w has unknown verb w
##[error]azuredevops/internal/service/core/resource_project.go:150:10: Errorf format %w has unknown verb w
FAIL	github.com/terraform-providers/terraform-provider-azuredevops/azuredevops/internal/service/core [build failed]
# github.com/terraform-providers/terraform-provider-azuredevops/azuredevops/internal/service/git
##[error]azuredevops/internal/service/git/data_git_repository.go:87:10: Errorf format %w has unknown verb w
##[error]azuredevops/internal/service/git/resource_git_repository.go:283:10: Errorf format %w has unknown verb w
FAIL	github.com/terraform-providers/terraform-provider-azuredevops/azuredevops/internal/service/git [build failed]

Support GitHub enterprise as a build definition repository type


Migrated from #218
Originally created by @cwebbtw on Fri, 06 Dec 2019 17:16:37 GMT


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

Description

The currently supported repository types for the azuredevops_build_definition are GitHub and TfsGit.

As a user of github enterprise, I would like to be able to build a pipeline definition using infrastructure as code so that I can repeatedly build in the same way for multiple teams.

New or Affected Resource(s)

resource: azuredevops_build_definition

Potential Terraform Configuration

resource "azuredevops_build_definition" "build" {
  project_id = azuredevops_project.project.id
  name       = "Sample Build Definition"
  path       = "\\ExampleFolder"

  repository {
    repo_type   = "GitHubEnterprise"
    personal_access_token = "..."
    repo_name   = azuredevops_azure_git_repository.repository.name
    branch_name = azuredevops_azure_git_repository.repository.default_branch
    yml_path    = "azure-pipelines.yml"
  }
}
  • #0000

Transient failure for group membership acceptance tests due to AzDO server side behavior


Migrated from #174
Originally created by @nmiodice on Thu, 31 Oct 2019 15:00:01 GMT


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

Affected Resource(s)

  • azuredevops_group_membership

Terraform Configuration Files

// THESE ARE FROM THE ACCEPTANCE TESTS!
//    https://github.com/microsoft/terraform-provider-azuredevops/blob/0575967a20c6c37badd80c3bcdfd5295521bc93c/azuredevops/resource_group_membership_test.go#L161-L196

resource "azuredevops_project" "project" {
	project_name = "%s"
}
data "azuredevops_group" "group" {
	project_id = azuredevops_project.project.id
	name       = "%s"
}
resource "azuredevops_user_entitlement" "user" {
	principal_name       = "%s"
	account_license_type = "express"
}
resource "azuredevops_group_membership" "membership" {
	group = data.azuredevops_group.group.descriptor
	members = [azuredevops_user_entitlement.user.descriptor]
}

output "group_descriptor" {
	value = data.azuredevops_group.group.descriptor
}
output "user_descriptor" {
	value = azuredevops_user_entitlement.user.descriptor
}

Debug Output

Failed builds:

Panic Output

N/A

Expected Behavior

Acceptance tests for the group membership resource pass.

Actual Behavior

Due to the delay on the server side, the acceptance tests are inconsistent and can fail transiently

Steps to Reproduce

  1. run acceptance tests with the code commentated for the azdo group membership acceptance test. If you run it 5-6 times you will probably see a failure.

Important Factoids

Seems to be a server side issue that is present in the UI as well, leading me to believe that this is a server side issue

References

  • #0000

Resource Authorization Missing Navigation

Documentation issue

The resource azuredevops_resource_authorization documentation page has broken navigation.

Terraform (and Azure DevOps Provider) Version

n/a

Affected Resource(s)

  • azuredevops_resource_authorization

References

image

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

Create Fork with azuredevops_git_repository parent_id not working


Migrated from #377
Originally created by @jakobyte1024 on Thu, 25 Jun 2020 15:12:12 GMT


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

  • provider.azuredevops: version = "~> 0.0"
  • provider.azurerm: version = "~> 2.15"
    Terraform v0.12.27

Affected Resource(s)

  • azuredevops_git_repository

Terraform Configuration Files

data "azuredevops_project" "jakobyte1024AdoProject" {
  project_name = "jakobyte1024"
}

data "azuredevops_git_repositories" "jakobyte1024SkeletonRepo" {
  project_id = data.azuredevops_project.jakobyte1024AdoProject.id
  name       = "RepoSkeleton"
}

resource "azuredevops_git_repository" "SkeletonFork" {
  project_id = azuredevops_project.tenantAdoProject.id
  name       = "SkeletonFork"
  parent_id  = azuredevops_git_repositories.jakobyte1024SkeletonRepo.id
}

Debug Output

https://gist.github.com/jakobyte1024/5c295583599a0b976bab65a2d7500ca7

Expected Behavior

Dear AzureDevOps Provider Team,
I may run into an issue. While creating a fork repo, parent_id seems not to be supported.
But the documentation tells me that I should use it like in above's snippet.
Am I doing something wrong or impossible ?
Or did I find a bug ?
In any case - thank you for any help.

The parent repo in another project is being looked up.
And a new repo in a new project has been created

Actual Behavior

Instead of, project_id seems not to be supported.
Also tested with azuredevops_git_repository instead of data azuredevops_git_repositories

Steps to Reproduce

  1. terraform apply
  • #0000

Add support for TF Resources to add/config/manage Service and Application Integrations


Migrated from #274
Originally created by @ausfestivus on Mon, 20 Apr 2020 02:58:48 GMT


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

Description

I would like to use the Terraform Provider for Azure DevOps to add/config/manage the Service and Application Integrations in my Azure DevOps tenancy.

I have a third-party application that I need to onboard many tenants into. Each of those tenants configs needs to be connected to our AzDO Organization and have read access to a single Project and Repo in our Tenancy. To connect the third-party app to our AzDO I must configure a new Service and Application Integration in our AzDO Organization, one for each Tenant.

I am currently using Terraform to configure the tenancy in the third-party app. I can use TF to configure the oauth2 config of the third-party app. I cannot do the necessary config in AzDO because the Terraform Provider for Azure DevOps does not yet have the necessary Resource(s) for me to use Terraform to create the AzDO config necessary.

I hope ive explained our use case in sufficient detail to make sense. Let me know if not.

New or Affected Resource(s)

I am not an oauth expert so may not have this properly described. It should not be considered as gospel for what should be added to this provider.

  • azuredevops_oauth_integration

Potential Terraform Configuration

The new resource would need to support some (or all) of the config items required on this page. https://aex.dev.azure.com/app/register

References

nil

  • #0000

Project example syntax cleanup

Documentation issue

The resource azuredevops_project documentation example undesired argument declaration.

Terraform (and Azure DevOps Provider) Version

n/a

Affected Resource(s)

  • azuredevops_project

References

The example shows a feature block as:

  features = {
      "testplans" = "disabled"
      "artifacts" = "disabled"
  }

This should be updated to the following to be more consistent with HCL preferred syntax:

  features = {
      testplans = "disabled"
      artifacts = "disabled"
  }

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

Bad request "InvalidApiVersionParameter" after service endpoint creation

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.azuread v0.10.0
  • provider.azuredevops v0.0.1
  • provider.azurerm v2.16.0
  • provider.kubernetes v1.11.3
  • provider.random v2.2.1

Affected Resource(s)

  • azuredevops_serviceendpoint_kubernetes

Terraform Configuration Files

resource "azuredevops_serviceendpoint_kubernetes" "example" {
  project_id            = data.azuredevops_project.project.id
  service_endpoint_name = "${data.azurerm_kubernetes_cluster.aks-cluster.name}-${module.k8s-namespace.k8s-namespace-name}"
  apiserver_url         = "https://${data.azurerm_kubernetes_cluster.aks-cluster.fqdn}"
  description           = "test"
  authorization_type    = "AzureSubscription"

  azure_subscription {
    subscription_id   = "c6dXXX"
    subscription_name = "SUB"
    tenant_id         = "698XXX"
    resourcegroup_id  = data.azurerm_resource_group.aks-cluster.id
    namespace         = module.k8s-namespace.k8s-namespace-name
    cluster_name      = data.azurerm_kubernetes_cluster.aks-cluster.name
  }
}

Debug Output

Panic Output

Expected Behavior

Create service endpoint which can be consumed by release

Actual Behavior

Created service endpoint which can't be consumed by release. Attempting to edit the connection in the portal UI returns

An error occured while fetching the AKS cluster. Internal error: Failed to query service connection API: 'https://management.azure.com/subscriptions/c6dXXX/resourcegroups/subscriptions/c6dXXX/resourceGroups/aks-cluster/providers/Microsoft.ContainerService/managedClusters/aks-cluster?api-version=2018-03-31'. Status Code: 'BadRequest', Response from server: '{"error":{"code":"InvalidApiVersionParameter","message":"The api-version '2018-03-31' is invalid. The supported versions are '2020-06-01,2020-05-01,2020-01-01,2019-11-01,2019-10-01,2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'."}}'

Steps to Reproduce

  1. terraform apply

Important Factoids

  • Same issue creating service connections to aks clusters is uksouth and in ukwest.
  • The "Cluster" field in the UI is created as "aks-cluster ()" where it shows as "aks-cluster (aks-cluster)" when manually created
  • The connection can't associate with the cluster and therefore can't be consumed by the release
  • The created connection resource doesn't show up in the list of connection when using az devops service-endpoints list

References

  • #0000

Error when trying to import existing git repo

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 0.0.1

Affected Resource(s)

  • azuredevops_git_repository

Terraform Configuration Files

provider "azuredevops" {
  version = ">= 0.0.1"
}

data "azuredevops_project" "test" {
  project_name = "ADO Migration Test"
}

data "azuredevops_git_repositories" "repo" {
  project_id = data.azuredevops_project.test.id
  name       = "test-repo"
}

resource "azuredevops_git_repository" "repo-tf" {
  project_id = data.azuredevops_project.test.id
  name       = "test-repo-tf"
  initialization {
    init_type = "Import"
    source_url = data.azuredevops_git_repositories.repo.repositories[0].remote_url
  }
}

Debug Output

2020/07/03 14:45:33 [DEBUG] azuredevops_git_repository.repo-tf: applying the planned Create change
2020-07-03T14:45:33.246+0300 [DEBUG] plugin.terraform-provider-azuredevops_v0.0.1_x4: 2020/07/03 14:45:33 [DEBUG] expandGitRepository: ID is empty (not set)
2020/07/03 14:45:33 [DEBUG] azuredevops_git_repository.repo-tf: apply errored, but we're indicating that via the Error pointer rather than returning it: Error expanding repository resource data: Initialization strategy not implemented: Import
2020/07/03 14:45:33 [ERROR] <root>: eval: *terraform.EvalApplyPost, err: Error expanding repository resource data: Initialization strategy not implemented: Import
2020/07/03 14:45:33 [ERROR] <root>: eval: *terraform.EvalSequence, err: Error expanding repository resource data: Initialization strategy not implemented: Import

Error: Error expanding repository resource data: Initialization strategy not implemented: Import

  on main.tf line 14, in resource "azuredevops_git_repository" "repo-tf":
  14: resource "azuredevops_git_repository" "repo-tf" {

Panic Output

Expected Behavior

Creating new repo from an existing source repo

Actual Behavior

Error

Steps to Reproduce

  1. terraform apply

Important Factoids

References

[New Functionality] Allow build definition authorization to repository

Description

Currently the resource azuredevops_resource_authorization only supports service endpoints.

Feature request for adding build definition authorization to a repository.

If you are extending a build pipeline from one repository to another, ADO will prompt you to permit access the first time it is run

New or Affected Resource(s)

  • azuredevops_resource_authorization

Potential Terraform Configuration

azuredevops_resource_authorization

resource "azuredevops_resource_authorization" "pipeline_auth" {
  project_id  = azuredevops_project.project.id
  resource_id = azuredevops_build_definition.plan.id
  authorized  = true
}

References

image

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 Apply for non-project resources fails if project removed

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

Affected Resource(s)

  • azuredevops_build_definition
  • azuredevops_git_repository

Probably all resources, created inside the project

Terraform Configuration Files

resource "azuredevops_project" "this" {
  project_name = "test"
  description  = "description"
}

resource "azuredevops_git_repository" "this" {
  project_id = azuredevops_project.this.id
  name       = "Pipelines"
  initialization {
    init_type = "Clean"
  }
}

Debug Output

Panic Output

Expected Behavior

  • Run terraform apply and wait for it to succeed
  • Remove created devops project via the UI
  • Run terraform apply

Expected: detect both resources were destroyed & recreate them.

Actual Behavior

Error: VS800075: The project with id '6f6ee8e2-96ba-488e-95aa-79e17ee3ee28' does not exist, or you do not have permission to access it.

Steps to Reproduce

  • Run terraform apply and wait for it to succeed
  • Remove created devops project via the UI
  • Run terraform apply

Important Factoids

References

  • #0000

Project Creation - Ability to NOT create the default repository.

Description

When creating a new Azure DevOps project, a default git repository is created with the same name.

It would be ideal if the azuredevops_project exposed an option to either not created this repository, or delete it automatically in the backend.

New or Affected Resource(s)

  • azuredevops_project

Potential Terraform Configuration

azuredevops_project

resource "azuredevops_project" "project" {
  project_name       = "Test Project"
  ...

  create_default_repository = false

}

References

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

Can not create fork repository

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 0.0.1

Affected Resource(s)

  • azuredevops_git_repository

Terraform Configuration Files

provider "azuredevops" {
  version = ">= 0.0.1"
}

data "azuredevops_project" "test" {
  project_name = "Test Project"
}

resource "azuredevops_git_repository" "repo" {
  project_id = data.azuredevops_project.test.id
  name       = "test-repo"
  initialization {
    init_type = "Clean"
  }
}

resource "azuredevops_git_repository" "fork-repo" {
  project_id = data.azuredevops_project.test.id
  name       = "fork-test-repo"
  parent_id  = azuredevops_git_repository.repo.id
}

Debug Output

https://gist.github.com/patr00n/f2f7e1057d90d70b411c02148d12ef03

Panic Output

Expected Behavior

New repo was created

Actual Behavior

Error

Steps to Reproduce

  1. terraform plan

Important Factoids

References

Support for "required template check"

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

Description

We have a use case to run code analysis as part of AzDO pipeline builds for applications that will run on Azure Kubernetes Services(AKS). It appears that the method to achieve this is through using extends templates and required template check.

According to the above referenced documentations, required template is part of "approvals and checks", which "can be configured on environments, service connections and agent pools".

Appreciate it might involve a considerable amount of effort as I struggled to find in the REST API documentation relevant information about approvals and checks.

New or Affected Resource(s)

  • azuredevops_checks

Potential Terraform Configuration

There are a few types in checks so I've just picked 2 for examples

resource "azuredevops_checks" "example_required_template" {
  type                  = "required_template" #required input
  display_name          = "Extends a required template" #optional input
  # target_resource_id/scope
  target_resource_id = <environment_id>/<service_endpoint_id>/<agent_pool_id> #required input
  # one or more template blocks
  template {
    repo_id    = <repo_id> #required input
    ref        = "refs/heads/master" #required input
    yml_path   = "template.yml" #required input
  }
}

resource "azuredevops_checks" "example_approvals" {
  type                  = "approvals"
  display_name          = "Extends a required template" 
  # target_resource_id/scope
  target_resource_id = <environment_id>/<service_endpoint_id>/<agent_pool_id>
  # one approval block
  approval {
    approvers              = [<user_email_1>, <user_email_2>] #required input
    instruction            = "approve before deployment" #optional input
    allow_approve_own_runs = true #optional input, default to false
    timeout                = "24h" #required input
  }
}

References

  • #0000

Support for Git files

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

Description

Would be great to be able to control files in Git repositories from Terraform.

Similar to github provider: https://www.terraform.io/docs/providers/github/r/repository_file.html

New or Affected Resource(s)

azuredevops_repository_file

Potential Terraform Configuration

resource "azuredevops_repository_file" "gitignore" {
  repository_id = "example"
  file       = ".gitignore"
  content    = "**/*.tfstate"
}

References

  • #0000

Terraform 0.13 - Add registry sourced provider support


Migrated from #363
Originally created by @arnaudlh on Fri, 05 Jun 2020 01:41:28 GMT


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

Description

Terraform 0.13 currently in beta adds support for registry sourced provider as per this link.
As a user of the terraform-provider-azuredevops, we'd love TF0.13 day 0 support for this feature, so that we can dynamically pull your provider.

New or Affected Resource(s)

  • none

Potential Terraform Configuration

terraform {
  required_providers {
    terraform-provider-azuredevops = {
        source = "registry.terraform.io/microsoft/terraform-provider-azuredevops"
        version = "x.y.0"
    }
  }
}

References

  • #0000

[Documentation Update] Variable Groups Sourced from Azure Key Vault

Description

Update documentation to highlight this feature.

Currently the resource azuredevops_variable_group only supports ADO hosted variables.

Feature request for adding the ability to connect the variable group to Azure Key Vault.

Affected Resource(s)

  • azuredevops_variable_group

Sample Terraform Configuration

azuredevops_variable_group

resource "azuredevops_variable_group" "this" {
  project_id   = azuredevops_project.this.id
  name         = "configuration"
  description  = "configuration"
  allow_access = true

  key_vault {
    name                = azurerm_key_vault.this.name
    service_endpoint_id = azuredevops_serviceendpoint_azurerm.this.id
  }

  variable {
    name = "kv-secret"
  }
}

References

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

Service Connection for Azure China and ablity to select management group


Migrated from #379
Originally created by @anikm1987 on Tue, 30 Jun 2020 11:21:13 GMT


Hi,
Currently I am not able to find any option to set azurm_enviornment while creating service connection which is kind of restricting me to use it for Azure China cloud.

Also in service azuredevops_serviceendpoint_azurerm, there is no option to provide management group as an option.

Is this planned for future release?

Thanks
Aniket

Implement new resource "ACR Service Endpoint"


Migrated from #162
Originally created by @ThePhen on Tue, 29 Oct 2019 20:12:43 GMT


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

Description

New or Affected Resource(s)

  • azuredevops_XXXXX

Potential Terraform Configuration

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

References

  • #0000

[New Resource] Release Definition Resource

Description

Currently the ability to create .yml based build pipelines exists, however there is no resource to create release pipelines.

New or Affected Resource(s)

  • azuredevops_release_definition

Potential Terraform Configuration

azuredevops_release_definition

resource "azuredevops_release_definition" "release" {
  project_id = azuredevops_project.project.id
  name       = "Sample Release Definition"

  ci_trigger {
    use_yaml = true
  }

  repository {
    repo_type   = "TfsGit"
    repo_id     = azuredevops_git_repository.repository.id
    branch_name = azuredevops_git_repository.repository.default_branch
    yml_path    = "azure-pipelines.yml"
  }
  ...
}

References

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

Implement new resource "Service Fabric Service Endpoint"


Migrated from #167
Originally created by @hbuckle on Wed, 30 Oct 2019 10:42:43 GMT


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

Description

New or Affected Resource(s)

  • azuredevops_XXXXX

Potential Terraform Configuration

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

References

  • #0000

"401 Unauthorized" when creating variable group

Hi guys,

When creating azuredevops variable group using "azuredevops_variable_group", we are experiencing below error. The azuredevops pat we are using has variable groups: Read, Create, & Manage permission. We found when add "Tokens" scope to our pat, there will be no error. May i ask why we need "Tokens" scope in the pat?


random_string.rs: Creating...
random_string.rs: Creation complete after 0s [id=fP7Mk-y1NU9kp#H9]
azuredevops_variable_group.variablegroup: Creating...

Error: Error creating definitionResourceReference Azure DevOps object: Request returned status: 401 Unauthorized

on main.tf line 16, in resource "azuredevops_variable_group" "variablegroup":
16: resource "azuredevops_variable_group" "variablegroup" {

Project Feature missing from navigation

Documentation issue

The resource azuredevops_project_features is missing in the left navigation bar.

Terraform (and Azure DevOps Provider) Version

n/a

Affected Resource(s)

  • azuredevops_project_features

References

image

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

Support Importing Git Repository Resources -- azuredevops_git_repository


Migrated from #373
Originally created by @mxrss2 on Thu, 11 Jun 2020 22:50:38 GMT


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

Description

It would be nice to support importing git repos. I am dealing with a config that has been built manually and trying to get it under control with terraform. I do not want to have to blow out repos to readd to get them to work with terraform.

New or Affected Resource(s)

azuredevops_git_repository

Potential Terraform Configuration

terragrunt import azuredevops_git_repository.repo "azdo-config"

When running import you get the error message

azuredevops_git_repository.repo: Creating...

Error: Error creating repository in Azure DevOps: TF400948: A Git repository with the name azdo-config already exists.

  on main.tf line 1, in resource "azuredevops_git_repository" "repo":
   1: resource "azuredevops_git_repository" "repo" {


[terragrunt] 2020/06/11 22:42:09 Hit multiple errors:
exit status 1

References

Add support for forked git repos to Git Repository resource


Migrated from #99
Originally created by @KeithJRome on Fri, 11 Oct 2019 22:45:25 GMT


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

Description

Add support for forking an existing git repository during creation time for git_repository resources.

New or Affected Resource(s)

  • azuredevops_git_repository resource

Potential Terraform Configuration

resource "azuredevops_project" "main_project" {
  project_name       = "Test Project"
  description        = "Test Project Description"
  visibility         = "private"
  enable_tfvc        = False
  work_item_template = "Agile"
}

resource "azuredevops_git_repository" "main" {
  project        = azuredevops_project.main_project.id
  name           = "main-repo"
  default_branch = "master"
  initialization = {
    type         = "Fork"
    source       = "[clone url...]"
  }
}

Acceptance Criteria

  • When initialization.type = "Fork", the newly created repository is initialized to a viable state using a Fork Sync Request (https://github.com/microsoft/azure-devops-go-api/blob/dev/azuredevops/git/client.go#L535)
  • Include Unit tests for the new operation
  • Acceptance (integration) test to validate repo creation/modification, following the patterns from the azuredevops_build_definition resource
  • Documentation added to client-facing documentation for this resource

References

  • Story spawned from design task #73

Build Definition does not create

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

Add support for imported git repos to Git Repository resource


Migrated from #98
Originally created by @KeithJRome on Fri, 11 Oct 2019 22:43:20 GMT


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

Description

Add support for importing an existing git or tfvc repository during creation time for git_repository resources.

New or Affected Resource(s)

  • azuredevops_git_repository resource

Potential Terraform Configuration

resource "azuredevops_project" "main_project" {
  project_name       = "Test Project"
  description        = "Test Project Description"
  visibility         = "private"
  enable_tfvc        = False
  work_item_template = "Agile"
}

resource "azuredevops_git_repository" "main" {
  project        = azuredevops_project.main_project.id
  name           = "main-repo"
  default_branch = "master"
  initialization = {
    type         = "Import"
    type         = "GitHub"
    source       = "[repo url...]"
  }
}

Acceptance Criteria

References

  • Story spawned from design task #73

HashiCorp Terraform Provider Partner Program - Initial Review


Migrated from #241
Originally created by @cgriggs01 on Thu, 05 Mar 2020 02:36:46 GMT


Iโ€™ve taken a look at the provider here and would like to say great work so far! I do have feedback outlined below that Iโ€™d like to see addressed before we move on to the next steps. Iโ€™m opening this issues as a sort of checklist for tracking items and discussion. If it works better for you, this changes can be added to a separate branch if any changes conflict with your current build process. The review was done on the develop branch at git commit a6c79b51

  • One of our Terraform Ecosystem engineers built a linter to help align coding best practices for providers. You should use it along with your development. https://github.com/bflad/tfproviderlint There are a number of items to address when you run the linter.

  • A makefile should be added with the GNUmakefile which is standard across all Terraform providers, feel free to copy the GitHub provider makefile and will just have to update the variable on line 4 to PKG_NAME=azuredevops

  • There are three bash scripts kept in a scripts/ directory that are used in different processes of testing and release, these can all be copied from the GitHub provider

  • If a resource cannot be found(404) in the READ function, we should do a d.SetId("") to remove it from the statefile. You also wouldn't need to return an error then. Terraform will just treat it as a resource that never existed and try and create it.

  • The tests that you have built into each corresponding Go test file must be prefixed with TestAcc so that they can be run together as the entire make testacc suite.

  • The website docs need some additional formatting. The file structure should match any of the official providers structure. Iโ€™ll reference Github docs again for example. Within the website director should be a docs directory and the azuredevops.erb file which provides a ruby lay file for the side bar of the docs. In the docs/ directory should be your index.html.markdown and the directories r/, d/, and guides/
    -With the new makefile you should be able to run make website to test the website docs locally.

  • All official Terraform provider use a Mozilla Public License 2.0 within each repo, can you add this LICENSE file to this repository.

  • You are already using Go Modules to manage the providers dependancies which is great, but in addition to that, we ask that you checkin all the required dependancies into a vendor/ directory. This is so that our nightly testing environment does ping GitHub for ever dependancies in all 100+ TF providers.

  • Each Terraform provider must have a CHANGELOG that is updated during reach release. Since the changeling is updated by a bot during the release it must be in a certain format. With the AWS provider changelog as an example, the version of the next release should be tagged as โ€œ1.0.0 (Unreleased)โ€ and will then be updated with a date by the release-bot.

Let me know if you have any questions.
Best,
Chris

Manage SSH keys in a repo


Migrated from #372
Originally created by @ams0 on Wed, 10 Jun 2020 12:03:36 GMT


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

Description

I want to be able to manage SSH keys for a user account (similar to deploy key for Github).

New or Affected Resource(s)

  • azuredevops_ssh_key

Potential Terraform Configuration

resource "tls_private_key" "ssh-key" {
  algorithm = "RSA"
  rsa_bits  = 4096
}

resource "azuredevops_ssh_key" "ssh-key" {
    name = "ssh-key"
    content = tls_private_key.ssh-key.public_key_openssh
}

References

This feature can come very handy when for example I want to add an SSH key generated for use by Flux controller when I use a repo in Azure DevOps for GitOps. See this example how I do it with Github provider.

  • #0000

Looks like the API is undocumented.

How to use a predefined yaml

Hello guys,

Is there any way to populate the linked .yml?

My situation, i'm using this:


resource "azuredevops_git_repository" "r" {
  project_id = azuredevops_project.project.id
  name       = "provision-automation-do-not-delete"
  initialization {
    init_type = "Clean"
  }

}

resource "azuredevops_build_definition" "b2" {
  project_id = azuredevops_project.project.id
  name       = "Criar um novo projeto"

  repository {
    repo_type = "TfsGit"
    repo_id   = azuredevops_git_repository.r.id
    yml_path  = "create-new-project.yml"
  }
}

but the create-new-project.yml is not created in the repository and there is no way to provide the content of it, what im trying to do now is to output the repository info

resource "local_file" "foo" {
    content     = tostring(jsonencode(azuredevops_git_repository.r))
    filename = "${path.module}/repository.json"
}

and trying to setup the repository, git clone, git push etc... is there any other way to do that?

Documentation for import of service endpoints is missing

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

Description

The documentation for how to import the following service endpoints are missing, but the code to do the import is working and tested:

New or Affected Resource(s)

  • azuredevops_serviceendpoint_azurerm
  • azuredevops_serviceendpoint_dockerregistry
  • azuredevops_serviceendpoint_kubernetes

Potential Terraform Configuration

N/A

References

N/A

Import groups and members from AAD directly to newly created azure devops project

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

Description

Recreated the issue here as requested by @xuzhang3

Currently, we can easily create user entitlements and assign them to newly created local groups within Azure DevOps. However, it would be very effective if we could have something similar for groups too.

Use case -

Create ADO Project => Create ADO group => import existing AAD group members ( or group itself) as "members" for created group.

Simply put => importing group from AAD directly into given project. Tried lot of ways already but did not help.

New or Affected Resource(s)

group and members resource as part of given provider

azuredevops_group
azuredevops_group_membership
azuredevops_user_entitlement

  • azuredevops_XXXXX

Potential Terraform Configuration

resource "azuredevops_group" "ado_gp" {
scope = azuredevops_project.ado_prj.id
display_name = "ado-gp-dev"
description = "ADO Group for dev"

members = [
"aXXXXXXXXX" <= existing group from aad not individual member/s
]
}

References

https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/manage-azure-active-directory-groups?view=azure-devops&tabs=preview-page

  • #0000

Implement new Resource Release Definition


Migrated from #281
Originally created by @gertjvr on Sun, 26 Apr 2020 05:50:24 GMT


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

Description

New or Affected Resource(s)

  • azuredevops_XXXXX

Potential Terraform Configuration

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

References

  • #0000

Lost data during resource force replacement when ADO api gets an error

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

Affected Resource(s)

  • azuredevops_branch_policy_build_validation

Terraform Configuration Files

resource "azuredevops_branch_policy_build_validation" "bp" {
    blocking   = true
    enabled    = true
    project_id = "5713a29b-a24c-4358-bfb5-51781344f423"

    settings {
        build_definition_id         = 1161
        display_name                = "tf_test_policy"
        manual_queue_only           = false
        queue_on_source_update_only = true
        valid_duration              = 720

        scope {
            match_type     = "Exact"
            repository_id  = "105bb7b9-1d25-48ff-ae9f-d6062e306200"
            repository_ref = "refs/heads/master"
        }
    }
}

Debug Output

Terraform will perform the following actions:

  # azuredevops_branch_policy_build_validation.bp must be replaced
-/+ resource "azuredevops_branch_policy_build_validation" "bp" {
        blocking   = true
        enabled    = true
      ~ id         = "1473" -> (known after apply)
      ~ project_id = "5713a29b-a24c-4358-bfb5-51781344f423" -> "c8ace00e-03cf-46f5-9d24-5e448f352df8" # forces replacement

      ~ settings {
            build_definition_id         = 1161
            display_name                = "tf_test_policy"
            manual_queue_only           = false
            queue_on_source_update_only = true
            valid_duration              = 720

          ~ scope {
                match_type     = "Exact"
              ~ repository_id  = "105bb7b9-1d25-48ff-ae9f-d6062e306200" -> "0a14d67f-03b0-4045-9609-f2f79e0447d5"
                repository_ref = "refs/heads/master"
            }
        }
    }

Plan: 1 to add, 0 to change, 1 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

azuredevops_branch_policy_build_validation.bp: Destroying... [id=1473]
azuredevops_branch_policy_build_validation.bp: Destruction complete after 0s
azuredevops_branch_policy_build_validation.bp: Creating...

Error: Error creating policy in Azure DevOps: TF402457: The settings for this policy are not correctly formatted. Error: The build pipeline 1161 was not found.

  on main.tf line 68, in resource "azuredevops_branch_policy_build_validation" "uv-devops":
  68: resource "azuredevops_branch_policy_build_validation" "uv-devops" {

Panic Output

Expected Behavior

Original branch policy steel available

Actual Behavior

Original branch policy has been deleted, but the new policy didn't create. And we lost the data

Steps to Reproduce

  1. Import or create a resource
  2. Change repository_id and project_id
  3. terraform apply

Important Factoids

References

  • #0000

Github service connection for Github enterprise


Migrated from #378
Originally created by @anikm1987 on Tue, 30 Jun 2020 11:17:10 GMT


Hi,
I was trying to create service connection for GITHUB enterprise but unable to find any option to provide server url.
Is this feature planned?
Is there any other way I can do that.
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.