@@ -20,10 +20,6 @@ param existingLogAnalyticsWorkspaceId string = ''
2020
2121param azureopenaiVersion string = '2025-01-01-preview'
2222
23- //Get the current deployer's information
24- var deployerInfo = deployer ()
25- var deployingUserPrincipalId = deployerInfo .objectId
26-
2723// Restricting deployment to only supported Azure OpenAI regions validated with GPT-4o model
2824@metadata ({
2925 azd : {
@@ -816,36 +812,6 @@ module cogServiceRoleAssignmentsExisting './modules/role.bicep' = if(useExisting
816812 scope : resourceGroup ( split (existingFoundryProjectResourceId , '/' )[2 ], split (existingFoundryProjectResourceId , '/' )[4 ])
817813}
818814
819- // User Role Assignment for Azure OpenAI - New Resources
820- module userOpenAiRoleAssignment './modules/role.bicep' = if (aiFoundryAIservicesEnabled && !useExistingResourceId ) {
821- name : take ('user-openai-${uniqueString (deployingUserPrincipalId , aiFoundryAiServicesResourceName )}' , 64 )
822- params : {
823- name : 'user-openai-${uniqueString (deployingUserPrincipalId , aiFoundryAiServicesResourceName )}'
824- principalId : deployingUserPrincipalId
825- aiServiceName : aiFoundryAiServices .outputs .name
826- principalType : 'User'
827- }
828- scope : resourceGroup (subscription ().subscriptionId , resourceGroup ().name )
829- dependsOn : [
830- aiFoundryAiServices
831- ]
832- }
833-
834- // User Role Assignment for Azure OpenAI - Existing Resources
835- module userOpenAiRoleAssignmentExisting './modules/role.bicep' = if (aiFoundryAIservicesEnabled && useExistingResourceId ) {
836- name : take ('user-openai-existing-${uniqueString (deployingUserPrincipalId , aiFoundryAiServicesResourceName )}' , 64 )
837- params : {
838- name : 'user-openai-existing-${uniqueString (deployingUserPrincipalId , aiFoundryAiServicesResourceName )}'
839- principalId : deployingUserPrincipalId
840- aiServiceName : aiFoundryAiServices .outputs .name
841- principalType : 'User'
842- }
843- scope : resourceGroup (split (existingFoundryProjectResourceId , '/' )[2 ], split (existingFoundryProjectResourceId , '/' )[4 ])
844- dependsOn : [
845- aiFoundryAiServices
846- ]
847- }
848-
849815// ========== Cosmos DB ========== //
850816// WAF best practices for Cosmos DB: https://learn.microsoft.com/en-us/azure/well-architected/service-guides/cosmos-db
851817module privateDnsZonesCosmosDb 'br/public:avm/res/network/private-dns-zone:0.7.0' = if (virtualNetworkEnabled ) {
@@ -920,11 +886,9 @@ module cosmosDb 'br/public:avm/res/document-db/database-account:0.12.0' = if (co
920886 capabilitiesToAdd : [
921887 'EnableServerless'
922888 ]
923-
924- sqlRoleAssignmentsPrincipalIds : concat (
925- [containerApp .outputs .?systemAssignedMIPrincipalId ],
926- [deployingUserPrincipalId ]
927- )
889+ sqlRoleAssignmentsPrincipalIds : [
890+ containerApp .outputs .?systemAssignedMIPrincipalId
891+ ]
928892 sqlRoleDefinitions : [
929893 {
930894 // Replace this with built-in role definition Cosmos DB Built-in Data Contributor: https://docs.azure.cn/en-us/cosmos-db/nosql/security/reference-data-plane-roles#cosmos-db-built-in-data-contributor
@@ -1775,3 +1739,5 @@ output AZURE_AI_MODEL_DEPLOYMENT_NAME string = aiFoundryAiServicesModelDeploymen
17751739output AZURE_AI_AGENT_MODEL_DEPLOYMENT_NAME string = aiFoundryAiServicesModelDeployment .name
17761740output AZURE_AI_AGENT_ENDPOINT string = aiFoundryAiServices .outputs .aiProjectInfo .apiEndpoint
17771741output APP_ENV string = 'Prod'
1742+ output AI_FOUNDRY_RESOURCE_ID string = aiFoundryAiServices .outputs .resourceId
1743+ output COSMOSDB_ACCOUNT_NAME string = cosmosDbResourceName
0 commit comments