diff --git a/.github/workflows/deploy-waf.yml b/.github/workflows/deploy-waf.yml index e2786216e..2b85b5c56 100644 --- a/.github/workflows/deploy-waf.yml +++ b/.github/workflows/deploy-waf.yml @@ -105,6 +105,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 +121,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..3afff0d53 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -125,6 +125,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 +141,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..00dea3f86 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -170,8 +170,9 @@ var allTags = union( }, tags ) -@description('Optional created by user name') -param createdBy string = empty(deployer().userPrincipalName) ? '' : split(deployer().userPrincipalName, '@')[0] +@description('Tag, Created by user name') +param createdBy string = contains(deployer(), 'userPrincipalName')? split(deployer().userPrincipalName, '@')[0]: deployer().objectId + resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = { name: 'default' @@ -179,6 +180,7 @@ resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = { tags: { ...allTags TemplateName: 'MACAE' + Type: enablePrivateNetworking ? 'WAF' : 'Non-WAF' CreatedBy: createdBy } }