layout | page_title | description |
---|---|---|
azuredevops |
AzureDevops: azuredevops_serviceendpoint_azurerm |
Manages a AzureRM service endpoint within Azure DevOps organization. |
Manages Manual or Automatic AzureRM service endpoint within Azure DevOps.
Before to create a service end point in Azure DevOps, you need to create a Service Principal in your Azure subscription.
For detailed steps to create a service principal with Azure cli see the documentation
resource "azuredevops_project" "project" {
project_name = "Sample Project"
visibility = "private"
version_control = "Git"
work_item_template = "Agile"
}
resource "azuredevops_serviceendpoint_azurerm" "endpointazure" {
project_id = azuredevops_project.project.id
service_endpoint_name = "TestServiceRM"
credentials {
serviceprincipalid = "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx"
serviceprincipalkey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
azurerm_spn_tenantid = "xxxxxxx-xxxx-xxx-xxxxx-xxxxxxxx"
azurerm_subscription_id = "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx"
azurerm_subscription_name = "Sample Subscription"
}
resource "azuredevops_project" "project" {
project_name = "Sample Project"
visibility = "private"
version_control = "Git"
work_item_template = "Agile"
}
resource "azuredevops_serviceendpoint_azurerm" "endpointazure" {
project_id = azuredevops_project.project.id
service_endpoint_name = "TestServiceRM"
azurerm_spn_tenantid = "xxxxxxx-xxxx-xxx-xxxxx-xxxxxxxx"
azurerm_subscription_id = "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx"
azurerm_subscription_name = "Microsoft Azure DEMO"
}
The following arguments are supported:
project_id
- (Required) The project ID or project name.service_endpoint_name
- (Required) The Service Endpoint name.azurerm_spn_tenantid
- (Required) The tenant id if the service principal.azurerm_subscription_id
- (Required) The subscription Id of the Azure targets.azurerm_subscription_name
- (Required) The subscription Name of the targets.credentials
- (Optional) Acredentials
block.resource_group
- (Optional) The resource group used for scope of automatic service endpoint.
A credentials
block supports the following:
serviceprincipalid
- (Required) The service principal application Idserviceprincipalkey
- (Required) The service principal secret.
The following attributes are exported:
id
- The ID of the service endpoint.project_id
- The project ID or project name.service_endpoint_name
- The Service Endpoint name.