Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"groups": ["GHCPUsers"],
"deploymentType": "resourcegroup-with-subscriptionowner",
"labsPerSubscription": 5,
"preferredLocation": "swedencentral, francecentral, eastus2, germanywestcentral",
"preferredLocation": "francecentral, germanywestcentral, eastus2, swedencentral",
"estimatedDailyCostsUsd": 8.0,
"estimatedSharedDeploymentDailyCostsUsd": 0.0
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var cognitiveServicesUserRoleId = subscriptionResourceId('Microsoft.Authorizatio
var searchServiceContributorRoleId = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7ca78c08-252a-4471-8644-bb5ff32d4ba0')
var searchIndexDataReaderRoleId = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '1407120a-92aa-4202-b7e9-c0e197c71c8f')
var monitoringReaderRoleId = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '43d0d8ad-25c7-4714-9337-8ba259a9fe05')
var logAnalyticsReaderRoleId = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '73c42c96-874c-492b-b04d-ab87d138a893')
var foundryUserRoleId = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '53ca6127-db72-4b80-b1b0-d745d6d5456d')
var openAiContributorRoleId = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'a001fd3d-188f-4b5d-821b-7da978bf7442')
var storageBlobDataContributorRoleId = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')
Expand Down Expand Up @@ -256,6 +257,24 @@ resource aiProject 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-pre
]
}

resource aiProjectAppInsightsConnection 'Microsoft.CognitiveServices/accounts/projects/connections@2025-04-01-preview' = {
parent: aiProject
name: applicationInsightsName
properties: {
authType: 'ApiKey'
category: 'AppInsights'
target: applicationInsights.id
isSharedToAll: true
credentials: {
key: applicationInsights.properties.ConnectionString
}
metadata: {
ApiType: 'Azure'
ResourceId: applicationInsights.id
}
}
}

resource gpt5_4MiniDeployment 'Microsoft.CognitiveServices/accounts/deployments@2025-04-01-preview' = {
parent: aiFoundry
name: 'gpt-5.4-mini'
Expand Down Expand Up @@ -360,6 +379,16 @@ resource appInsightsMonitoringReaderForProject 'Microsoft.Authorization/roleAssi
}
}

resource appInsightsLogAnalyticsReaderForProject 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
scope: applicationInsights
name: guid(applicationInsights.id, aiProject.id, logAnalyticsReaderRoleId)
properties: {
roleDefinitionId: logAnalyticsReaderRoleId
principalId: aiProject.identity.principalId
principalType: 'ServicePrincipal'
}
}

resource searchCognitiveServicesUserForFoundry 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
scope: aiFoundry
name: guid(searchService.id, aiFoundry.id, cognitiveServicesUserRoleId, 'search-to-cognitive')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ if (-not (Get-Command Invoke-MhhDeploymentWithRegionFallback -ErrorAction Silent
} else {
az group create --name $ResourceGroupName --location $chosenLocation --output none
}
if ($LASTEXITCODE -ne 0) {
throw "Could not create or update resource group '$ResourceGroupName' (Azure CLI exit code $LASTEXITCODE)."
}

# Build parameter arguments for az deployment
$paramArgs = @()
Expand All @@ -122,8 +125,16 @@ if (-not (Get-Command Invoke-MhhDeploymentWithRegionFallback -ErrorAction Silent
--parameters $paramArgs `
--query "{outputs: properties.outputs}" `
--output json


if ($LASTEXITCODE -ne 0) {
throw "Deployment '$deploymentName' failed in resource group '$ResourceGroupName' (Azure CLI exit code $LASTEXITCODE). Data seeding will not run. See the Azure CLI error above."
}

$parsed = $jsonResult | ConvertFrom-Json

if (-not $parsed.outputs) {
throw "Deployment '$deploymentName' returned no outputs. Data seeding will not run."
}

# Flatten outputs: { "name": { "value": "val" } } -> { "name": "val" }
$flatOutputs = @{}
Expand Down
Loading