diff --git a/modules/ai_foundry_project/agent_capability_host_connections.role_assignments.tf b/modules/ai_foundry_project/agent_capability_host_connections.role_assignments.tf index 60249bfd..fdb41d62 100644 --- a/modules/ai_foundry_project/agent_capability_host_connections.role_assignments.tf +++ b/modules/ai_foundry_project/agent_capability_host_connections.role_assignments.tf @@ -77,47 +77,20 @@ locals { project_id_guid = "${substr(azapi_resource.ai_foundry_project.output.properties.internalId, 0, 8)}-${substr(azapi_resource.ai_foundry_project.output.properties.internalId, 8, 4)}-${substr(azapi_resource.ai_foundry_project.output.properties.internalId, 12, 4)}-${substr(azapi_resource.ai_foundry_project.output.properties.internalId, 16, 4)}-${substr(azapi_resource.ai_foundry_project.output.properties.internalId, 20, 12)}" } -resource "azurerm_cosmosdb_sql_role_assignment" "cosmosdb_db_sql_role_aifp_user_thread_message_store" { +resource "azurerm_cosmosdb_sql_role_assignment" "cosmosdb_db_sql_role" { count = var.agent_capability_host_connections != null ? 1 : 0 depends_on = [ azapi_resource.ai_foundry_project_capability_host ] - name = uuidv5("dns", "${azapi_resource.ai_foundry_project.name}${azapi_resource.ai_foundry_project.output.identity.principalId}userthreadmessage_dbsqlrole") + name = uuidv5("dns", "${azapi_resource.ai_foundry_project.name}${azapi_resource.ai_foundry_project.output.identity.principalId}enterprise_memory_data_contributor") resource_group_name = var.agent_capability_host_connections.cosmos_db.resource_group_name account_name = var.agent_capability_host_connections.cosmos_db.name - scope = "${var.agent_capability_host_connections.cosmos_db.resource_id}/dbs/enterprise_memory/colls/${local.project_id_guid}-thread-message-store" + scope = "${var.agent_capability_host_connections.cosmos_db.resource_id}/dbs/enterprise_memory" role_definition_id = "${var.agent_capability_host_connections.cosmos_db.resource_id}/sqlRoleDefinitions/00000000-0000-0000-0000-000000000002" principal_id = azapi_resource.ai_foundry_project.output.identity.principalId } -resource "azurerm_cosmosdb_sql_role_assignment" "cosmosdb_db_sql_role_aifp_system_thread_name" { - count = var.agent_capability_host_connections != null ? 1 : 0 - - depends_on = [ - azurerm_cosmosdb_sql_role_assignment.cosmosdb_db_sql_role_aifp_user_thread_message_store - ] - name = uuidv5("dns", "${azapi_resource.ai_foundry_project.name}${azapi_resource.ai_foundry_project.output.identity.principalId}systemthread_dbsqlrole") - resource_group_name = var.agent_capability_host_connections.cosmos_db.resource_group_name - account_name = var.agent_capability_host_connections.cosmos_db.name - scope = "${var.agent_capability_host_connections.cosmos_db.resource_id}/dbs/enterprise_memory/colls/${local.project_id_guid}-system-thread-message-store" - role_definition_id = "${var.agent_capability_host_connections.cosmos_db.resource_id}/sqlRoleDefinitions/00000000-0000-0000-0000-000000000002" - principal_id = azapi_resource.ai_foundry_project.output.identity.principalId -} - -resource "azurerm_cosmosdb_sql_role_assignment" "cosmosdb_db_sql_role_aifp_entity_store_name" { - count = var.agent_capability_host_connections != null ? 1 : 0 - - depends_on = [ - azurerm_cosmosdb_sql_role_assignment.cosmosdb_db_sql_role_aifp_system_thread_name - ] - name = uuidv5("dns", "${azapi_resource.ai_foundry_project.name}${azapi_resource.ai_foundry_project.output.identity.principalId}entitystore_dbsqlrole") - resource_group_name = var.agent_capability_host_connections.cosmos_db.resource_group_name - account_name = var.agent_capability_host_connections.cosmos_db.name - scope = "${var.agent_capability_host_connections.cosmos_db.resource_id}/dbs/enterprise_memory/colls/${local.project_id_guid}-agent-entity-store" - role_definition_id = "${var.agent_capability_host_connections.cosmos_db.resource_id}/sqlRoleDefinitions/00000000-0000-0000-0000-000000000002" - principal_id = azapi_resource.ai_foundry_project.output.identity.principalId -} ## Create the necessary data plane role assignments to the Azure Storage Account containers created by the AI Foundry Project ##