@@ -57,9 +57,12 @@ var cosmosdbLogContainer = 'cmsalog'
5757var containerName = 'appstorage'
5858var storageSkuName = 'Standard_LRS'
5959var storageContainerName = replace (replace (replace (replace ('${ResourcePrefix }cast' , '-' , '' ), '_' , '' ), '.' , '' ),'/' , '' )
60- var azureAiServicesName = '${abbrs .ai .aiServices }${ResourcePrefix }'
6160
62- // param aiProjectName string
61+ var aiFoundryName = '${abbrs .ai .aiFoundry }${ResourcePrefix }'
62+ var aiProjectDescription = 'AI foundary project for CPS template'
63+ var aiProjectName = '${abbrs .ai .aiFoundryProject }${ResourcePrefix }'
64+ var aiProjectFriendlyName = aiProjectName
65+ var projectEndpointString =''
6366
6467
6568var aiModelDeployments = [
@@ -75,15 +78,39 @@ var aiModelDeployments = [
7578 }
7679]
7780
78- resource azureAiServices 'Microsoft.CognitiveServices/accounts@2024 -04-01-preview' = {
79- name : azureAiServicesName
81+ resource azureAiServices 'Microsoft.CognitiveServices/accounts@2025 -04-01-preview' = {
82+ name : aiFoundryName
8083 location : AzureAiServiceLocation
8184 sku : {
8285 name : 'S0'
8386 }
8487 kind : 'AIServices'
88+ identity : {
89+ type : 'SystemAssigned'
90+ }
91+ properties : {
92+ allowProjectManagement : true
93+ customSubDomainName : aiFoundryName
94+ networkAcls : {
95+ defaultAction : 'Allow'
96+ virtualNetworkRules : []
97+ ipRules : []
98+ }
99+ publicNetworkAccess : 'Enabled'
100+ disableLocalAuth : false
101+ }
102+ }
103+
104+ resource aiFoundryProject 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-preview' = {
105+ parent : azureAiServices
106+ name : aiProjectName
107+ location : AzureAiServiceLocation
108+ identity : {
109+ type : 'SystemAssigned'
110+ }
85111 properties : {
86- customSubDomainName : azureAiServicesName
112+ description : aiProjectDescription
113+ displayName : aiProjectFriendlyName
87114 }
88115}
89116
@@ -138,6 +165,7 @@ module azureAifoundry 'deploy_ai_foundry.bicep' = {
138165 params : {
139166 solutionName : ResourcePrefix
140167 solutionLocation : AzureAiServiceLocation
168+ aiFoundryName : aiFoundryName
141169 keyVaultName : kvault .outputs .keyvaultName
142170 gptModelName : llmModel
143171 gptModelVersion : gptModelVersion
@@ -324,7 +352,7 @@ resource containerAppBackend 'Microsoft.App/containerApps@2023-05-01' = {
324352 }
325353 {
326354 name : 'AZURE_OPENAI_ENDPOINT'
327- value : 'https://${azureAifoundry . outputs . aiFoundryName }.openai.azure.com/'
355+ value : 'https://${aiFoundryName }.openai.azure.com/'
328356 }
329357 {
330358 name : 'MIGRATOR_AGENT_MODEL_DEPLOY'
@@ -360,7 +388,7 @@ resource containerAppBackend 'Microsoft.App/containerApps@2023-05-01' = {
360388 }
361389 {
362390 name : 'AZURE_AI_AGENT_PROJECT_NAME'
363- value : azureAifoundry . outputs . aiProjectName
391+ value : aiProjectName
364392 }
365393 {
366394 name : 'AZURE_AI_AGENT_RESOURCE_GROUP_NAME'
@@ -371,8 +399,8 @@ resource containerAppBackend 'Microsoft.App/containerApps@2023-05-01' = {
371399 value : subscription ().subscriptionId
372400 }
373401 {
374- name : 'AZURE_AI_AGENT_PROJECT_CONNECTION_STRING '
375- value : azureAifoundry . outputs . projectConnectionString
402+ name : 'AI_PROJECT_ENDPOINT '
403+ value : projectEndpointString
376404 }
377405 ]
378406 resources : {
@@ -475,19 +503,6 @@ resource aiDeveloper 'Microsoft.Authorization/roleDefinitions@2022-04-01' existi
475503 name : '64702f94-c441-49e6-a78b-ef80e0188fee'
476504}
477505
478- // var aiServicesName string=azureAifoundry.outputs.aiFoundryName
479- // var aiProjectName string=azureAifoundry.outputs.aiProjectName
480-
481-
482- // resource aiServices 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' existing= {
483- // name: azureAifoundry.outputs.aiFoundryName
484- // }
485-
486- resource aiProject 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-preview' existing = {
487- name : azureAifoundry .outputs .aiProjectName
488- }
489-
490-
491506resource aiDeveloperAccessProj 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
492507 name : guid (containerAppBackend .name , aiDeveloper .id )
493508 scope : resourceGroup ()
@@ -512,7 +527,7 @@ resource aiUserAccessProj 'Microsoft.Authorization/roleAssignments@2022-04-01' =
512527}
513528
514529resource aiUserAccessFoundry 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
515- name : guid (containerAppBackend .name , aiProject .id )
530+ name : guid (containerAppBackend .name , aiFoundryProject .id )
516531 scope : resourceGroup ()
517532 properties : {
518533 roleDefinitionId : aiUser .id
@@ -544,4 +559,8 @@ module deploymentScriptCLI 'br/public:avm/res/resources/deployment-script:0.5.1'
544559 }
545560}
546561
547- output AZURE_AIFOUNDRY_NAME string = azureAiServices .name
562+ output AZURE_AIFOUNDRY_NAME string = azureAiServices .name
563+
564+ output aiFoundryName string = aiFoundryName
565+ output aiProjectName string = aiFoundryProject .name
566+ output projectEndpointString string = aiFoundryProject .properties .endpoints ['AI Foundry API' ]
0 commit comments