From 0be6e76d9121365b3bb3710b7d85ea8ee3215dab Mon Sep 17 00:00:00 2001 From: KevinDMack Date: Thu, 31 Jul 2025 13:15:10 -0400 Subject: [PATCH 1/3] Updating for login changes --- .github/workflows/deploy.yml | 19 ------------------- README.md | 3 ++- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ae91cf7..ee839e2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -59,25 +59,6 @@ jobs: - name: Make deploy script executable run: chmod +x ./scripts/deploy-docker-app.sh - # Create terraform.tfvars for dev environment - - name: Create terraform.tfvars for dev environment - run: | - cd infra - cat > terraform.tfvars << EOF - location = "${{ secrets.AZURE_LOCATION }}" - environment = "dev" - EOF - - # Configure Terraform backend for remote state - - name: Configure Terraform Backend - run: | - cd infra - terraform init \ - -backend-config="resource_group_name=${{ secrets.TF_STATE_RESOURCE_GROUP }}" \ - -backend-config="storage_account_name=${{ secrets.TF_STATE_STORAGE_ACCOUNT }}" \ - -backend-config="container_name=${{ secrets.TF_STATE_CONTAINER_NAME }}" \ - -backend-config="key=dev/terraform.tfstate" - # Deploy infrastructure using the deploy script - name: Deploy Infrastructure to Dev run: ./scripts/deploy-docker-app.sh deploy dev diff --git a/README.md b/README.md index fc264ce..8fa0db4 100644 --- a/README.md +++ b/README.md @@ -139,7 +139,8 @@ You will get an output similar to this: "clientId": "your-service-principal-client-id", "clientSecret": "your-service-principal-client-secret", "subscriptionId": "your-azure-subscription-id", - "tenantId": "your-azure-tenant-id" + "tenantId": "your-azure-tenant-id", + "auth-type":"SERVICE_PRINCIPAL" } ``` From 1beab8b26a04087fa2e861ee1ed3c239f3deeba7 Mon Sep 17 00:00:00 2001 From: KevinDMack Date: Thu, 31 Jul 2025 13:18:50 -0400 Subject: [PATCH 2/3] Adding in tfvars --- .gitignore | 1 - infra/terraform-dev.tfvars | 19 ++++++++++++++++ infra/terraform-local.tfvars | 18 ++++++++++++++++ infra/terraform.tfvars | 42 ++++++++++++++++++++++++++++++++++++ 4 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 infra/terraform-dev.tfvars create mode 100644 infra/terraform-local.tfvars create mode 100644 infra/terraform.tfvars diff --git a/.gitignore b/.gitignore index 138a835..17ae460 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,6 @@ crash.log crash.*.log # Exclude all .tfvars files, which are likely to contain sensitive data -*.tfvars *.tfvars.json # But keep example files !*.tfvars.example diff --git a/infra/terraform-dev.tfvars b/infra/terraform-dev.tfvars new file mode 100644 index 0000000..9744417 --- /dev/null +++ b/infra/terraform-dev.tfvars @@ -0,0 +1,19 @@ +# Development environment variables +environment = "dev" +project_name = "terraform-ci-cd-sample" +resource_group_name = "rg-terraform-sample-dev" +location = "USGov Virginia" +container_registry_name = "acrtfsampledev" +container_registry_sku = "Standard" +app_service_plan_name = "asp-terraform-sample-dev" +app_service_plan_sku = "S1" +app_service_name = "app-terraform-sample-dev" +app_service_always_on = true +health_check_path = "/health" +docker_image_name = "my-app" +docker_image_tag = "latest" +websites_port = "80" +additional_app_settings = { + "ENVIRONMENT" = "dev" + "LOG_LEVEL" = "DEBUG" +} diff --git a/infra/terraform-local.tfvars b/infra/terraform-local.tfvars new file mode 100644 index 0000000..9c1be39 --- /dev/null +++ b/infra/terraform-local.tfvars @@ -0,0 +1,18 @@ +# Local development variables +environment = "local" +project_name = "terraform-ci-cd-sample" +resource_group_name = "rg-terraform-sample-local" +location = "USGov Virginia" +container_registry_name = "acrtfsamplelocal" +container_registry_sku = "Basic" +app_service_plan_name = "asp-terraform-sample-local" +app_service_plan_sku = "B1" +app_service_name = "app-terraform-sample-local" +app_service_always_on = false +health_check_path = "/health" +docker_image_name = "my-app" +docker_image_tag = "latest" +websites_port = "80" +additional_app_settings = { + "ENVIRONMENT" = "local" +} diff --git a/infra/terraform.tfvars b/infra/terraform.tfvars new file mode 100644 index 0000000..49e78a3 --- /dev/null +++ b/infra/terraform.tfvars @@ -0,0 +1,42 @@ +# General Configuration - Azure Government +location = "USGov Virginia" +environment = "dev" +project_name = "demo-app" +azure_environment = "usgovernment" + +# Resource Group Configuration +resource_group_name = "rg-demo-app-gov-dev" + +# Container Registry Configuration (must be globally unique) +# Note: Azure Government ACR uses .azurecr.us domain +container_registry_name = "acrdemoappgov001" +container_registry_sku = "Basic" + +# App Service Plan Configuration +app_service_plan_name = "asp-demo-app-gov-dev" +app_service_plan_sku = "B1" + +# App Service Configuration (must be globally unique) +# Note: Azure Government App Services use .azurewebsites.us domain +app_service_name = "app-demo-gov-demo-001" +app_service_always_on = true +health_check_path = "/" + +# Docker Configuration +docker_image_name = "my-app" +docker_image_tag = "latest" +websites_port = "80" + +# Additional App Settings (optional) +additional_app_settings = { + "NODE_ENV" = "production" + "PORT" = "80" + # Add any other environment variables your app needs +} + +# Managed Identity Configuration +# Set to true to use managed identity in addition to admin credentials +enable_managed_identity_acr_access = true + +# Custom Domain Configuration (optional) +# custom_domain = "your-domain.com" From ba972994e60c0950c3f58851325915ad85d76ff1 Mon Sep 17 00:00:00 2001 From: KevinDMack Date: Thu, 31 Jul 2025 13:27:52 -0400 Subject: [PATCH 3/3] Updating to match local version --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ee839e2..7725c79 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,7 +8,7 @@ on: workflow_dispatch: env: - TF_VERSION: '1.5.0' + TF_VERSION: '1.12.1' jobs: deploy-to-dev: