@@ -80,7 +80,7 @@ function PromptForParameters {
8080 [string ]$location ,
8181 [string ]$modelLocation ,
8282 [string ]$email
83- )
83+ )
8484
8585 Clear-Host
8686
@@ -169,8 +169,9 @@ function LoginAzure([string]$subscriptionID) {
169169 az login -- service- principal `
170170 -- username $env: AZURE_CLIENT_ID `
171171 -- password $env: AZURE_CLIENT_SECRET `
172- -- tenant $env: AZURE_TENANT_ID
172+ -- tenant $env: AZURE_TENANT_ID `
173173 Write-Host " CI deployment mode"
174+ $createdBy = ' pipeline'
174175 }
175176 else {
176177 az login -- tenant $tenantId
@@ -183,9 +184,10 @@ function LoginAzure([string]$subscriptionID) {
183184 Write-Host " Logged in to Azure with tenant ID '$tenantId ' successfully." - ForegroundColor Green
184185 }
185186 Write-Host " manual deployment mode"
187+ $createdBy = $email
186188 }
187189 az account set -- subscription $subscriptionID
188- Write-Host " Switched subscription to '$subscriptionID ' `r`n " - ForegroundColor Yellow
190+ Write-Host " Switched subscription to '$subscriptionID ' `r`n " - ForegroundColor Yellow
189191}
190192
191193function DeployAzureResources ([string ]$location , [string ]$modelLocation ) {
@@ -246,7 +248,7 @@ function DeployAzureResources([string]$location, [string]$modelLocation) {
246248
247249 # Perform a what-if deployment to preview changes
248250 Write-Host " Evaluating Deployment resource availabilities to preview changes..." - ForegroundColor Yellow
249- $whatIfResult = az deployment group what- if -- resource- group $resourceGroupName -- template- file " ./main.bicep" -- name $deploymentName -- parameters modeldatacenter= $modelLocation location= $location environmentName= $environmentName
251+ $whatIfResult = az deployment group what- if -- resource- group $resourceGroupName -- template- file " ./main.bicep" -- name $deploymentName -- parameters modeldatacenter= $modelLocation location= $location environmentName= $environmentName createdBy = $createdBy
250252
251253 if ($LASTEXITCODE -ne 0 ) {
252254 Write-Host " There might be something wrong with your deployment." - ForegroundColor Red
@@ -257,7 +259,7 @@ function DeployAzureResources([string]$location, [string]$modelLocation) {
257259 # Proceed with the actual deployment
258260 Write-Host " Proceeding with Deployment..." - ForegroundColor Yellow
259261 Write-Host " Resource Group Name: $resourceGroupName " - ForegroundColor Yellow
260- $deploymentResult = az deployment group create -- resource- group $resourceGroupName -- template- file " ./main.bicep" -- name $deploymentName -- parameters modeldatacenter= $modelLocation location= $location environmentName= $environmentName
262+ $deploymentResult = az deployment group create -- resource- group $resourceGroupName -- template- file " ./main.bicep" -- name $deploymentName -- parameters modeldatacenter= $modelLocation location= $location environmentName= $environmentName createdBy = $createdBy
261263 # Check if deploymentResult is valid
262264 ValidateVariableIsNullOrEmpty - variableValue $deploymentResult - variableName " Deployment Result"
263265 if ($LASTEXITCODE -ne 0 ) {
0 commit comments