From ed094679ae9c60bf7d6f8d3078459b430d47d95a Mon Sep 17 00:00:00 2001 From: "Niraj Chaudhari (Persistent Systems Inc)" Date: Mon, 22 Sep 2025 16:00:39 +0530 Subject: [PATCH 1/6] Remove Createdby Parameter from deploy.yml and change logic in bicep --- .github/workflows/deploy.yml | 1 - infra/main.bicep | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 11f4dd947..82f0941b1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -137,7 +137,6 @@ jobs: imageTag="${IMAGE_TAG}" \ azureAiServiceLocation='${{ env.AZURE_LOCATION }}' \ gptModelCapacity=150 \ - createdBy="Pipeline" \ --output json - name: Extract Web App and API App URLs diff --git a/infra/main.bicep b/infra/main.bicep index dd7a907aa..08065582a 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -170,8 +170,8 @@ var allTags = union( }, tags ) -@description('Optional created by user name') -param createdBy string = empty(deployer().userPrincipalName) ? '' : split(deployer().userPrincipalName, '@')[0] +param createdBy string = contains(deployer(), 'userPrincipalName')? split(deployer().userPrincipalName, '@')[0]: deployer().objectId + resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = { name: 'default' From c6962b515b434433fe960fad2177c63df8f87e8c Mon Sep 17 00:00:00 2001 From: NirajC-Microsoft Date: Mon, 22 Sep 2025 22:22:50 +0530 Subject: [PATCH 2/6] Update deploy.yml to include createdBy parameter --- .github/workflows/deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 82f0941b1..11f4dd947 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -137,6 +137,7 @@ jobs: imageTag="${IMAGE_TAG}" \ azureAiServiceLocation='${{ env.AZURE_LOCATION }}' \ gptModelCapacity=150 \ + createdBy="Pipeline" \ --output json - name: Extract Web App and API App URLs From 83a661e9cea181f01139593ce662af7a14ed72a2 Mon Sep 17 00:00:00 2001 From: VishalS-Microsoft Date: Tue, 23 Sep 2025 12:19:42 +0530 Subject: [PATCH 3/6] CI Pipeline Validate Deployment - MACAE --- .github/workflows/deploy-waf.yml | 5 +++++ .github/workflows/deploy.yml | 5 +++++ infra/main.bicep | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-waf.yml b/.github/workflows/deploy-waf.yml index e2786216e..442925aee 100644 --- a/.github/workflows/deploy-waf.yml +++ b/.github/workflows/deploy-waf.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - CI-Pipeline-macae schedule: - cron: "0 11,23 * * *" # Runs at 11:00 AM and 11:00 PM GMT @@ -105,6 +106,9 @@ jobs: id: deploy run: | set -e + # Generate current timestamp in desired format: YYYY-MM-DDTHH:MM:SS.SSSSSSSZ + current_date=$(date -u +"%Y-%m-%dT%H:%M:%S.%7NZ") + az deployment group create \ --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ --template-file infra/main.bicep \ @@ -118,6 +122,7 @@ jobs: enablePrivateNetworking=true \ enableScalability=true \ createdBy="Pipeline" \ + tags="{'SecurityControl':'Ignore','Purpose':'Deploying and Cleaning Up Resources for Validation','CreatedDate':'$current_date'}" - name: Send Notification on Failure diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 11f4dd947..a44f2b5cc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,6 +9,7 @@ on: - main - hotfix - dev + - CI-Pipeline-macae schedule: - cron: "0 11,23 * * *" # Runs at 11:00 AM and 11:00 PM GMT workflow_dispatch: #Allow manual triggering @@ -125,6 +126,9 @@ jobs: IMAGE_TAG="latest" fi + # Generate current timestamp in desired format: YYYY-MM-DDTHH:MM:SS.SSSSSSSZ + current_date=$(date -u +"%Y-%m-%dT%H:%M:%S.%7NZ") + az deployment group create \ --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ --template-file infra/main.bicep \ @@ -138,6 +142,7 @@ jobs: azureAiServiceLocation='${{ env.AZURE_LOCATION }}' \ gptModelCapacity=150 \ createdBy="Pipeline" \ + tags="{'SecurityControl':'Ignore','Purpose':'Deploying and Cleaning Up Resources for Validation','CreatedDate':'$current_date'}" \ --output json - name: Extract Web App and API App URLs diff --git a/infra/main.bicep b/infra/main.bicep index dd7a907aa..8c265c2e5 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -178,7 +178,7 @@ resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = { properties: { tags: { ...allTags - TemplateName: 'MACAE' + TemplateName: enablePrivateNetworking ? 'MACAE - WAF' : 'MACAE' CreatedBy: createdBy } } From fd0ca46f2a9922bfc48eac76893826804368a3f1 Mon Sep 17 00:00:00 2001 From: VishalS-Microsoft Date: Tue, 23 Sep 2025 12:40:05 +0530 Subject: [PATCH 4/6] removed my feature branch --- .github/workflows/deploy-waf.yml | 1 - .github/workflows/deploy.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/deploy-waf.yml b/.github/workflows/deploy-waf.yml index 442925aee..2b85b5c56 100644 --- a/.github/workflows/deploy-waf.yml +++ b/.github/workflows/deploy-waf.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - CI-Pipeline-macae schedule: - cron: "0 11,23 * * *" # Runs at 11:00 AM and 11:00 PM GMT diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a44f2b5cc..3afff0d53 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,7 +9,6 @@ on: - main - hotfix - dev - - CI-Pipeline-macae schedule: - cron: "0 11,23 * * *" # Runs at 11:00 AM and 11:00 PM GMT workflow_dispatch: #Allow manual triggering From 28a6e0bb77e9c0d53c449c5442d7fb43ee1606d5 Mon Sep 17 00:00:00 2001 From: NirajC-Microsoft Date: Tue, 23 Sep 2025 15:44:21 +0530 Subject: [PATCH 5/6] Add createdBy parameter with description --- infra/main.bicep | 1 + 1 file changed, 1 insertion(+) diff --git a/infra/main.bicep b/infra/main.bicep index 08065582a..3322c1699 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -170,6 +170,7 @@ var allTags = union( }, tags ) +@description('Tag, Created by user name') param createdBy string = contains(deployer(), 'userPrincipalName')? split(deployer().userPrincipalName, '@')[0]: deployer().objectId From f602851f23f0a1231daadfaf5b8324a6d4f0ea5c Mon Sep 17 00:00:00 2001 From: VishalS-Microsoft Date: Tue, 23 Sep 2025 15:55:21 +0530 Subject: [PATCH 6/6] added new 'type' tag --- infra/main.bicep | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/infra/main.bicep b/infra/main.bicep index 8c265c2e5..608acbdee 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -178,7 +178,8 @@ resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = { properties: { tags: { ...allTags - TemplateName: enablePrivateNetworking ? 'MACAE - WAF' : 'MACAE' + TemplateName: 'MACAE' + Type: enablePrivateNetworking ? 'WAF' : 'Non-WAF' CreatedBy: createdBy } }