RAG application document retrieval based on the user using azure AD details

Hemas Transformation 0 Reputation points
2025-01-22T06:24:54.2533333+00:00

Project Overview

We have developed a chatbot as an AI assistant for the company document repository. This chatbot is created using Azure Services, including Azure OpenAI and an Azure web application for the chat interface. The data source for the chatbot is SharePoint, we have currently morethan 4 SBUs and all the documents are stored in a sharepoint document repository in separate folders per SBU.
Azure App Services - chat bot is deployed using azure openai playgroud deployment as a web app option

Data Source - SharePoint

Azure AI Search is used to to search the documents (index, indexer), from the indexers we are extracting the meta data field as SBU which in each document we have defined.

Azure Openai gpt 4o used.

Requirement

When a user from a certain SBU asks a question from the chatbot, the bot should only retrieve the information/answers from that user’s registered SBU or from the Common (group-wide) documents.

please tell me how to achieve this in stepwise in detail (i am new the Azure)

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
3,577 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Manas Mohanty (Quadrant Resource LLC) 95 Reputation points Microsoft Vendor
    2025-01-22T10:03:53.61+00:00

    Hi Hemas Transformation,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I think prompt flow or python SDK will be suitable for your requirement as Chat playground can take only one AI search index or container at the moment.

    Through Prompt flow, you can leverage different type of tools like python/prompt /lookup tools to authenticate users and search in different AI search indexes.

    and

    with Python SDK, you will need to create flask routes for authentication, route user from different SBU user group and deploy through Azure webapp and show results.

    To achieve your requirement to

    1. You need route users to SBU1, SBU2, SBU3 document indexes based on their SBU for which you need to create multiple containers on the similar name convention of SBU prior
    2. You will need to fetch details of user when prompted for their SBU and route to their respective AI search indexes and show "access denied to other indexes, if access is not authenticated to respective SBU index"
    def getsbu():
       #fetch user group details
       return sbu
    
    def searchSBU(sbu):
       #based on user group details , use if-else condition to search in respective sbu index through OpenAI agent and show the results
    

    Given that:

    SBU n user will have access to only SBU n only prior from IAM access of containers.

    Kindly refer below documentation for reference.

    1. Promptflow tools
    2. Add you own data SDK.
    3. Azure Webapp from Python
    4. Authentication in webapp

    Hope it helps address your requirements.

    Thank you.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.