» azuredevops_serviceendpoint_github

Manages a GitHub service endpoint within Azure DevOps.

» Example Usage

resource "azuredevops_project" "project" {
  project_name       = "Sample Project"
  visibility         = "private"
  version_control    = "Git"
  work_item_template = "Agile"
}

resource "azuredevops_serviceendpoint_github" "serviceendpoint_gh_1" {
  project_id            = azuredevops_project.project.id
  service_endpoint_name = "Sample GithHub Personal Access Token"

  auth_personal {
    # Also can be set with AZDO_GITHUB_SERVICE_CONNECTION_PAT environment variable
    personal_access_token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  }
}
resource "azuredevops_serviceendpoint_github" "serviceendpoint_gh_2" {
  project_id            = azuredevops_project.project.id
  service_endpoint_name = "Sample GithHub Grant"

  auth_oauth {
    oauth_configuration_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
  }
}
resource "azuredevops_serviceendpoint_github" "serviceendpoint_gh_3" {
  project_id = azuredevops_project.project.id
  service_endpoint_name = "Sample GithHub Apps: Azure Pipelines"
  # Note Github Apps do not support a description and will always be empty string. Must be explicty set to override the default value.
  description = ""
}

» Argument Reference

The following arguments are supported:

  • project_id - (Required) The project ID or project name.
  • service_endpoint_name - (Required) The Service Endpoint name.
  • description - (Optional) The Service Endpoint description. Defaults to Managed by Terraform.
  • auth_personal - (Optional) An auth_personal block as documented below. Allows connecting using a personal access token.
  • auth_oauth - (Optional) An auth_oauth block as documented below. Allows connecting using an Oauth token.

NOTE: Github Apps can not be created or updated via terraform. You must install and configure the app on Github and then import it. You must also set the description to "" explicitly."

auth_personal block supports the following:

auth_oauth block supports the following:

  • oauth_configuration_id - (Required) NOTE: Github OAuth flow can not be performed via terraform. You must create this on Azure DevOps and then import it. The OAuth Configuration ID.

» Attributes Reference

The following attributes are exported:

» Import

Azure DevOps Service Endpoint GitHub can be imported using the serviceendpoint id, e.g.

 terraform import azuredevops_serviceendpoint_github.serviceendpoint d81afa1d-9ad2-4c7d-b016-9ebb90f435f5