Skip to content

Commit

Permalink
Merge pull request #266 from brk3/feature/service-endpoint-aadapps
Browse files Browse the repository at this point in the history
Support aad_apps for AZDO service endpoints
  • Loading branch information
arnaudlh committed Nov 10, 2021
2 parents 65ab430 + a1188ad commit d74ae4c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions caf_solution/add-ons/azure_devops_v1/azdo_service_endpoint.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@ resource "azuredevops_serviceendpoint_azurerm" "azure" {
project_id = data.azuredevops_project.project[each.value.project_key].id
service_endpoint_name = each.value.endpoint_name
credentials {
serviceprincipalid = local.remote.azuread_applications[each.value.azuread_application.lz_key][each.value.azuread_application.key].application_id
serviceprincipalid = try(
local.remote.azuread_applications[each.value.azuread_application.lz_key][each.value.azuread_application.key].application_id,
local.remote.aad_apps[each.value.azuread_application.lz_key][each.value.azuread_application.key].azuread_application.application_id
)
serviceprincipalkey = data.external.client_secret[each.key].result.value
}
azurerm_spn_tenantid = local.remote.azuread_applications[each.value.azuread_application.lz_key][each.value.azuread_application.key].tenant_id
azurerm_spn_tenantid = try(
local.remote.azuread_applications[each.value.azuread_application.lz_key][each.value.azuread_application.key].tenant_id,
local.remote.aad_apps[each.value.azuread_application.lz_key][each.value.azuread_application.key].tenant_id
)
azurerm_subscription_id = each.value.subscription.id
azurerm_subscription_name = each.value.subscription.name
}
Expand All @@ -37,4 +43,4 @@ resource "azuredevops_resource_authorization" "endpoint" {
resource_id = azuredevops_serviceendpoint_azurerm.azure[each.key].id
type = "endpoint"
authorized = true
}
}

0 comments on commit d74ae4c

Please sign in to comment.