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
43 changes: 43 additions & 0 deletions infra/core/ai/existing-ai-project.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ param existingApplicationInsightsConnectionString string = ''
@description('Existing Application Insights resource ID (already set in the environment)')
param existingApplicationInsightsResourceId string = ''

@description('Model deployments to create on the existing AI Services account')
param deployments deploymentsType

@description('List of connections to provision on the existing project')
param connections array = []

Expand All @@ -35,6 +38,20 @@ resource aiAccount 'Microsoft.CognitiveServices/accounts@2025-06-01' existing =
}
}

// Create model deployments on the existing AI Services account.
// Uses @batchSize(1) to avoid concurrent deployment conflicts (same as ai-project.bicep).
@batchSize(1)
resource seqDeployments 'Microsoft.CognitiveServices/accounts/deployments@2025-06-01' = [
for dep in (deployments ?? []): {
parent: aiAccount
name: dep.name
properties: {
model: dep.model
}
sku: dep.sku
}
]

// Create additional connections from ai.yaml / agent manifest configuration on
// the existing project. Mirrors the loop in ai-project.bicep so manifest-declared
// connections are provisioned regardless of whether the project itself is new or
Expand Down Expand Up @@ -94,3 +111,29 @@ output dependentResources object = {
connectionName: ''
}
}

type deploymentsType = {
@description('Specify the name of cognitive service account deployment.')
name: string

@description('Required. Properties of Cognitive Services account deployment model.')
model: {
@description('Required. The name of Cognitive Services account deployment model.')
name: string

@description('Required. The format of Cognitive Services account deployment model.')
format: string

@description('Required. The version of Cognitive Services account deployment model.')
version: string
}

@description('The resource model definition representing SKU.')
sku: {
@description('Required. The name of the resource model definition representing SKU.')
name: string

@description('The capacity of the resource model definition representing SKU.')
capacity: int
}
}[]?
1 change: 1 addition & 0 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ module existingAiProject 'core/ai/existing-ai-project.bicep' = if (useExistingAi
params: {
aiServicesAccountName: aiFoundryResourceName
aiFoundryProjectName: aiFoundryProjectName
deployments: aiProjectDeployments
existingAcrConnectionName: existingAcrConnectionName
existingContainerRegistryEndpoint: existingContainerRegistryEndpoint
existingApplicationInsightsConnectionString: existingApplicationInsightsConnectionString
Expand Down