Skip to content

Commit d7412e8

Browse files
fix: Added deployment tags and dev container fix and PrincipleId param fix (#124)
* fixes * removed mai.json
1 parent 3e95e89 commit d7412e8

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

infra/main.bicep

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ param location string = resourceGroup().location
2424
param cosmosLocation string = resourceGroup().location
2525

2626
@description('Principal ID for role assignments.')
27-
param principalId string
27+
param principalId string = deployer().objectId
2828

2929
@description('Principal type for role assignments.')
3030
@allowed([
@@ -205,6 +205,25 @@ param purviewAccountResourceId string = ''
205205
@description('Optional. Existing Purview collection name')
206206
param purviewCollectionName string = ''
207207

208+
@description('Optional. Created by user name.')
209+
param createdBy string = contains(deployer(), 'userPrincipalName')? split(deployer().userPrincipalName, '@')[0]: deployer().objectId
210+
211+
// ========== Resource Group Tag ========== //
212+
resource resourceGroupTags 'Microsoft.Resources/tags@2025-04-01' = {
213+
name: 'default'
214+
properties: {
215+
tags: union(
216+
deploymentTags,
217+
{
218+
TemplateName: 'Deploy Your AI Application in Prod'
219+
Type: networkIsolation ? 'WAF' : 'Non-WAF'
220+
CreatedBy: createdBy
221+
DeploymentName: deployment().name
222+
}
223+
)
224+
}
225+
}
226+
208227
// ========================================
209228
// PARAMETERS - POSTGRESQL FLEXIBLE SERVER
210229
// ========================================

infra/main.bicepparam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ param environmentName = readEnvironmentVariable('AZURE_ENV_NAME', '')
88
param location = readEnvironmentVariable('AZURE_LOCATION', '')
99
param cosmosLocation = readEnvironmentVariable('AZURE_COSMOS_LOCATION', '')
1010
// Entra object ID of the identity to grant RBAC (user, group, service principal, or UAI). Set this if Graph lookup is blocked.
11-
param principalId = ''
11+
param principalId = readEnvironmentVariable('AZURE_PRINCIPAL_ID', '')
1212
param principalType = 'User'
1313

1414
// ========================================

scripts/preprovision-integrated.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ param(
1111

1212
$ErrorActionPreference = 'Stop'
1313

14+
# Ensure $env:TEMP is set (not defined by default on Linux)
15+
if (-not $env:TEMP) { $env:TEMP = '/tmp' }
16+
1417
Write-Host ""
1518
Write-Host "================================================" -ForegroundColor Cyan
1619
Write-Host " AI Landing Zone - Integrated Preprovision" -ForegroundColor Cyan

0 commit comments

Comments
 (0)