diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 306c248..f913248 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -44,7 +44,18 @@ jobs: shell: bash run: | set -e - az login --identity --username $MSI_ID > /dev/null + MAX_RETRIES=10 + RETRY_COUNT=0 + until [ $RETRY_COUNT -ge $MAX_RETRIES ] + do + az login --identity --username $MSI_ID > /dev/null && break + RETRY_COUNT=$[$RETRY_COUNT+1] + sleep 10 + done + if [ $RETRY_COUNT -eq $MAX_RETRIES ]; then + echo "Failed to login after $MAX_RETRIES attempts." + exit 1 + fi export ARM_SUBSCRIPTION_ID=$(az login --identity --username $MSI_ID | jq -r '.[0] | .id') export ARM_TENANT_ID=$(az login --identity --username $MSI_ID | jq -r '.[0] | .tenantId') export ARM_CLIENT_ID=$(az identity list | jq -r --arg MSI_ID "$MSI_ID" '.[] | select(.principalId == $MSI_ID) | .clientId') diff --git a/main.telemetry.tf b/main.telemetry.tf index f15b62e..7986c83 100644 --- a/main.telemetry.tf +++ b/main.telemetry.tf @@ -12,5 +12,6 @@ resource "azurerm_resource_group_template_deployment" "telemetry" { deployment_mode = "Incremental" name = local.telem_arm_deployment_name resource_group_name = var.resource_group_name + tags = var.resource_group_template_deployment_tags template_content = local.telem_arm_template_content } diff --git a/variables.tf b/variables.tf index f5b519c..0761b39 100644 --- a/variables.tf +++ b/variables.tf @@ -168,6 +168,12 @@ A map of private endpoints to create on this resource. The map key is deliberate DESCRIPTION } +variable "resource_group_template_deployment_tags" { + type = map(string) + default = null + description = "(Optional) A mapping of tags which should be assigned to the Resource Group Template Deployment." +} + variable "role_assignments" { type = map(object({ role_definition_id_or_name = string