Skip to content

Commit

Permalink
Changed AZP token to secure variable (#12)
Browse files Browse the repository at this point in the history
Update module to pass the Azure PAT into secure variables of the ACI container.
  • Loading branch information
mozts2005 authored Jan 19, 2021
1 parent 56a3d8d commit 7f100c1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ resource "azurerm_container_group" "linux-container-group" {
environment_variables = {
AZP_URL = "https://dev.azure.com/${var.azure_devops_org_name}"
AZP_POOL = var.linux_agents_configuration.agent_pool_name
AZP_TOKEN = var.azure_devops_personal_access_token
AZP_AGENT_NAME = "${var.linux_agents_configuration.agent_name_prefix}-${count.index}"
}

secure_environment_variables = {
AZP_TOKEN = var.azure_devops_personal_access_token
}
}

# if an image registry server has been specified, then generate the image_registry_credential block.
Expand Down Expand Up @@ -119,9 +122,11 @@ resource "azurerm_container_group" "windows-container-group" {
environment_variables = {
AZP_URL = "https://dev.azure.com/${var.azure_devops_org_name}"
AZP_POOL = var.windows_agents_configuration.agent_pool_name
AZP_TOKEN = var.azure_devops_personal_access_token
AZP_AGENT_NAME = "${var.windows_agents_configuration.agent_name_prefix}-${count.index}"
}
secure_environment_variables = {
AZP_TOKEN = var.azure_devops_personal_access_token
}
}

# if an image registry server has been specified, then generate the image_registry_credential block.
Expand All @@ -133,4 +138,4 @@ resource "azurerm_container_group" "windows-container-group" {
server = var.image_registry_credential.server
}
}
}
}

0 comments on commit 7f100c1

Please sign in to comment.