How I’d design an Azure RAG pipeline for 1,000+ PDFs, with hybrid search, document-level permissions and answers people can verify.
Asish Punnose ·
When I look at a RAG architecture for an organisation with more than 1,000 PDFs, my first question is usually about the documents themselves. Where do they live? Who can see them? And what happens when someone replaces a procedure that the application has already indexed?
Those questions tend to shape the architecture more than the choice of model. A system can give a fluent answer and still quote a superseded procedure, misread a table, or reveal information from a document the user has no permission to open.
I’ve drawn the architecture in two parts. The first is how a PDF becomes searchable. The second is what happens when someone asks a question. Splitting the two makes it easier to see where the work happens and where the security controls belong.
I’d keep the original PDFs in Azure Blob Storage and use Service Bus to queue the indexing work. An Azure Function would pick up each message and call Azure AI Document Intelligence to extract the content. That gives me a way to handle scanned pages, headings and tables before deciding how to split the text.
The split matters. Think of a policy where the rule is at the bottom of page 6 and the exception is at the top of page 7. If those two paragraphs get separated and the search retrieves only the first one, the answer can sound perfectly reasonable while leaving out the part that matters. I’d test chunking against documents like that before settling on a fixed size.
Each chunk needs enough information to find its way back to the original. I’d carry the document ID, version, page reference and access permissions alongside the text and the embedding. I’d also allow for documents to be replaced, deleted or restricted after indexing. If access changes on Monday morning, the old chunks shouldn’t still show up in an answer on Monday afternoon.
The search layer in the diagram is labelled Foundry IQ, which is Microsoft’s new name for Azure AI Search. In this design it’s where I store the searchable chunks and run hybrid retrieval, combining keyword and vector search. Microsoft Learn
The user signs in with Microsoft Entra ID, and the web app calls the API through Azure API Management. The application then uses the user’s identity and permissions to decide which documents can be included in the search results.
I’d use both keyword and vector search because people ask questions in different ways. Someone who knows the document might type a policy number or a form code. Someone new to the team might ask, “Who can approve this if my manager is away?” Both are reasonable ways to find the same procedure, and I’d test both.
The application sends the relevant, authorised excerpts to Azure OpenAI and returns an answer with links back to the source pages. I’d make the citations easy to open. If I’m using an answer to make a decision, I want to see the paragraph it came from. And when the retrieved documents don’t support an answer, I’d rather the application say it couldn’t find enough information.
I’d enforce document access during retrieval, before any excerpts reach the model. If two people ask the same question and one has access to a restricted document, their answers may legitimately differ. That’s a test I’d run explicitly, along with checking what happens when someone loses access and tries the question again. The original PDF link needs to enforce access as well.
Managed identities and private endpoints address other parts of the design. Managed identities let the application authenticate to supporting Azure services without keeping credentials in its configuration. Private endpoints control how those services are reached on the network. The document-level access check still has to answer a separate question every time someone searches. Which documents is this person entitled to see?
I’d start with questions that staff actually ask and have someone who knows the documents review the results. I’d include an exact policy number, a scanned table, a superseded document and a question the collection can’t answer. Then I’d run the same questions as users with different permissions. That tells me much more than a demo where everyone has access to everything.
I’d also measure retrieval and model latency separately, track how many tokens each answer uses, and monitor failed indexing jobs. When an answer is poor, I want to know whether the relevant page was missed during extraction, ranked too low in search, or included in the prompt and misunderstood by the model. Those failures need different fixes.
The test I’d use in the end is fairly simple. Can someone ask a question they’d normally take to a colleague, get an answer they can verify, and open the original page without having to search through a folder full of PDFs? If the system can do that consistently, while respecting the same document permissions the organisation already relies on, it’s doing something worth building.