Knowledge Base as a Service in Azure Logic Apps

The Logic Apps Agent Loop series published here between May and June 2026 documented the agentic capabilities of Azure Logic Apps in depth. Notably, one recurring limitation across that series was the complexity of knowledge retrieval: building a proper Retrieval-Augmented Generation pipeline required a separately configured Azure AI Search index, an indexer, a data source, and a significant setup overhead before the agent could answer a question from enterprise content.

Consequently, the Knowledge Base-as-a-Service (KBaaS) capability in Azure Logic Apps, announced at Integrate 2026 and now in preview, addresses this directly. This post, as a follow-up to the previous post on all the announcements, walks through what KBaaS is, how it works, and how to build a practical HR policy agent that answers employee questions from uploaded policy documents, with a complete sample available on GitHub.

What is Knowledge Base as a Service?

KBaaS is a Logic Apps-native RAG pipeline that sits in front of Azure Cosmos DB and Azure OpenAI. Instead of building and managing the ingestion and retrieval infrastructure yourself, you upload documents and KBaaS handles the rest.

Specifically, the service has two pipelines:

  • Ingestion pipeline — when you upload a document, KBaaS automatically parses, chunks, summarises, and vectorises the content using your Azure OpenAI embeddings model. The results are stored in four Cosmos DB containers that KBaaS creates and manages on your behalf.
  • Retrieval pipeline — when an agent loop queries the knowledge base, KBaaS rewrites the query if needed, generates a vector representation, performs a semantic search against Cosmos DB, and returns the most relevant chunks to the language model for response generation.
Structural diagram showing the two KBaaS pipelines. The ingestion pipeline flows left to right: document upload, parse, chunk, summarise, embed, then into Cosmos DB across four containers. A dashed arrow connects the stored vectors in Cosmos DB down to the retrieval pipeline. The retrieval pipeline flows left to right: agent loop query, rewrite, vector search against Cosmos DB, top ranked chunks, LLM response. The bottom row shows the Logic Apps agent loop wrapper: HTTP trigger, knowledge base tool, Response action.
Figure 1 — The two pipelines that power Knowledge Base as a Service in Azure Logic Apps. The ingestion pipeline (top) runs automatically when you upload a document: it parses and extracts text, chunks it into segments, summarises using Azure OpenAI, and embeds the content using an embeddings model before storing everything in four Cosmos DB containers. The retrieval pipeline (middle) runs when the agent loop queries the knowledge base: the query is rewritten if needed, vectorized, and matched against the stored embeddings in Cosmos DB via semantic search. The top-ranked chunks are passed to the LLM to generate a grounded answer. The agent loop wrapper (bottom) shows how these two pipelines sit inside a standard Logic Apps autonomous workflow.

In contrast, the key difference from a manually configured RAG pipeline is the abstraction layer. You do not configure chunking strategies, embedding dimensions, index schemas, or retrieval parameters. Instead, you upload documents and add the knowledge base as a tool. The agent loop does the rest.

Knowledge Base as a Service: Deploying the sample

The complete sample is available at steefjan1/logic-apps-kbaas-sample. It includes the workflow definition, Bicep infrastructure template, sample HR policy documents, and connection configuration.

Step 1: Provision infrastructure with azd

cd C:\Dev\logic-apps-kbaas-sample
azd auth login
azd init
azd env new <your-env-name>
azd provision

Naming note: avoid hyphens in your environment name. The Bicep template appends store to the prefix for the storage account name, and hyphens are not valid in storage account names. Use a short alphanumeric name such as kbaas rather than kbaas-preview.

Specifically, azd provision creates the resource group, a Logic App Standard, a Cosmos DB with vector search enabled, a storage account, an App Service Plan, and RBAC role assignments.

Step 2: Set app settings

$cosmosKey = az cosmosdb keys list `
--name <cosmos-name> `
--resource-group <resource-group> `
--query primaryMasterKey -o tsv
$storageKey = az storage account keys list `
--account-name <storage-name> `
--resource-group <resource-group> `
--query "[0].value" -o tsv
az logicapp config appsettings set `
--name <logic-app-name> `
--resource-group <resource-group> `
--settings `
AzureWebJobsStorage="DefaultEndpointsProtocol=https;AccountName=<storage-name>;AccountKey=$storageKey;EndpointSuffix=core.windows.net" `
FUNCTIONS_EXTENSION_VERSION="~4" `
FUNCTIONS_WORKER_RUNTIME="dotnet" `
APP_KIND="workflowapp" `
OPENAI__endpoint="https://<your-aoai-resource>.openai.azure.com/" `
OPENAI__key="<your-aoai-key>" `
agent_openAIKey="<your-aoai-key>" `
agent_openAIEndpoint="https://<your-aoai-resource>.openai.azure.com/" `
COSMOS__endpoint="https://<cosmos-name>.documents.azure.com:443/" `
COSMOS__key="$cosmosKey"

Step 3: Deploy the workflow

Compress-Archive `
-Path connections.json, host.json, hr-policy-agent `
-DestinationPath ..\kbaas-deploy.zip `
-Force
az logicapp deployment source config-zip `
--name <logic-app-name> `
--resource-group <resource-group> `
--subscription "<your-subscription>" `
--src ..\kbaas-deploy.zip
az logicapp restart `
--name <logic-app-name> `
--resource-group <resource-group>

Verify the workflow deployed cleanly go to the Logic App OverviewNotifications tab and confirm no WorkflowProcessingFailed errors appear before proceeding.

Step 4: Create the knowledge base connection

In the Azure portal, open your Logic App. Under Agents in the left sidebar, select Knowledge base then + Set up.

Basics tab:

  • Display name: hr-knowledge-base
  • Authentication type: Key-based
  • Database: select your Cosmos DB account — URL endpoint and key auto-populate
  • Click Next

Model tab:

  • Authentication type: URL and key-based authentication
  • Azure OpenAI resource: select your Azure OpenAI resource
  • Completions model: enter your GPT-4o deployment name exactly as it appears in Azure OpenAI
  • Embeddings model: text-embedding-3-small
  • Click Create

Preview limitation: The knowledge base connection does not persist across page refreshes in the current preview — this is a known portal UI bug. Do not refresh the page after clicking Create. Proceed immediately to adding files.

Note: Furthermore, after creating the connection, you can only edit display names. Authentication type, endpoint, and model deployment names cannot be changed. Get these right before clicking Create.

Step 5: Upload knowledge sources

Immediately after creating the connection, without refreshing, click New → Add files.

  • Group name: type hrpolicies
  • Upload hr-leave-policy.md from the sample’s docs/ folder
  • Artifact name: hr-leave-policy
  • Click Add

Once the status changes to Completed, then repeat for hr-expense-policy.md.

Preview limitation: The portal uploads one file at a time. Wait for each file to reach Completed before uploading the next.

Preview limitation: The Add button may remain greyed out if the artifact name field does not register keyboard input. If this happens, try dragging and dropping the file onto the upload area rather than using the file picker, then type the artifact name. If the button remains inactive, try a private/incognito browser window.

Azure portal Knowledge base page for the kbass-preview-la Standard logic app. The page shows the hrpolicies group containing two files: hr-leave-policy and hr-expense-policy, both showing Completed status after KBaaS ingestion processing.
Figure 2 — Both HR policy documents successfully ingested into the knowledge base. The KBaaS ingestion pipeline parsed, chunked, summarised, and vectorised each document automatically no manual configuration of Cosmos DB containers, indexers, or embedding pipelines required. The Completed status confirms the content is ready for semantic retrieval by the agent loop.

KBaaS creates the following Cosmos DB containers during ingestion:

ContainerPurpose
KnowledgeHubsKnowledge base metadata
KnowledgeArtifactsSource metadata and document references
KnowledgeArtifactChunksFull-text document chunks
KnowledgeArtifactChunkSummariesSummarised chunks with vector embeddings

Step 6: Add the knowledge base as a tool

Open the hr-policy-agent workflow in the Logic Apps designer. Select the HR Policy Agent action and scroll to the Knowledge base section in the parameters pane. Select Create and choose hr-knowledge-base from the list. Save the workflow.

Testing the agent

Get the trigger URL from hr-policy-agentOverviewRun trigger → copy the callback URL.

Test 1 — grounded answer from the leave policy:

In postman execute: https://kbass-preview-la.azurewebsites.net:443/api/hr-policy-agent/triggers/When_an_HTTP_request_is_received/invoke?api-version=2022-05-01&sp=%2Ftriggers%2FWhen_an_HTTP_request_is_received%2Frun&sv=1.0&sig=<sig>

With payload (application\json): {“question”: “How many days of annual leave am I entitled to?”}

Postman request showing a POST to the hr-policy-agent trigger URL with body containing question: How many days of annual leave am I entitled to? The response shows 200 OK with a JSON body containing the question and a grounded answer citing the annual leave policy document.
Figure 3 — The HR policy agent returns a grounded answer to a leave entitlement question. The agent queried the knowledge base, retrieved the relevant section from the annual leave policy document, and returned a cited response, all within a single autonomous agent loop run. The answer is grounded in the uploaded policy content rather than the model’s general training knowledge.

Test 2 — grounded answer from the expense policy:

In postman execute: https://kbass-preview-la.azurewebsites.net:443/api/hr-policy-agent/triggers/When_an_HTTP_request_is_received/invoke?api-version=2022-05-01&sp=%2Ftriggers%2FWhen_an_HTTP_request_is_received%2Frun&sv=1.0&sig=<sig>

With payload: (application\json):{“question”: “What is the maximum I can claim per night for hotel accommodation?”}

Test 3 — correct fallback when knowledge base has no answer:

In postman execute: https://kbass-preview-la.azurewebsites.net:443/api/hr-policy-agent/triggers/When_an_HTTP_request_is_received/invoke?api-version=2022-05-01&sp=%2Ftriggers%2FWhen_an_HTTP_request_is_received%2Frun&sv=1.0&sig=<sig>

With payload: {“question”: “What is the company policy on remote working?”}

As a result, the agent answers the first two questions from the uploaded documents and correctly declines the third exactly as the system prompt instructs.

Logic Apps run history for the hr-policy-agent workflow showing a successful run. The log panel shows the HTTP trigger, a user chat message, the agent action completing with tool invocations including the knowledge base retrieval tool, a sent chat message, and the Response action. The canvas shows the workflow steps with green success indicators.
Figure 4 — The run history of the HR policy agent showing the full agent loop execution. The knowledge base tool invocation is visible as a discrete step within the agent iterations: the agent reasoned over the question, decided to query the knowledge base, received the relevant policy chunks, and composed a grounded answer before returning the Response action result. This is the same Think → Act → Observe loop covered in the Logic Apps Agent Loop series, now with KBaaS providing the retrieval step automatically.

Knowledge Base as a Service:: Practitioner notes

Several things in the current preview are worth documenting for anyone following along:

Connection persistence bug — the knowledge base connection disappears on page refresh in the portal. The connection is correctly stored in connections.json on disk and the workflow runs correctly — but the portal UI does not display it after refresh. Work around this by not refreshing after creating the connection and uploading files in the same browser session.

knowledgeHubConnections format — the connections.json format for knowledge base connections is not publicly documented. If you include a knowledgeHubConnections block with incorrect structure in your deployed connections.json, the Logic App runtime will fail to start with The 'knowledgeHubConnections' property in connection.json has a value that cannot be parsed. The safest approach is to omit knowledgeHubConnections from your deployed connections.json entirely and let the portal write it after deployment.

Embeddings model region availabilitytext-embedding-3-small with Standard SKU is not available in all Azure regions. Use GlobalStandard SKU as shown in the prerequisites command above.

Managed Identity for agent connections — KBaaS supports Managed Identity authentication for the Cosmos DB connection. However, Managed Identity is not supported for the agent model connection when using the MicrosoftFoundry model type. If your workflows use Foundry Models, the agent connection must use Key authentication. Managed Identity remains the right choice for the Cosmos DB connection and all other backend services.

workflow.json schema — the Agent action requires a limit property at the action level (not inside inputs) and a modelConfigurations block with a referenceName pointing to the agent connection. The Microsoft Learn documentation does not show these as required, but the runtime rejects the workflow without them.

Preview limitations

  • Only uploaded files are supported as knowledge sources — live API connectors and SharePoint libraries are not yet available
  • Supported formats: DOC, DOCX, HTML, MD, PDF, PPT, PPTX, TXT, XLS, XLSX
  • Text-based content only — images within documents are not parsed
  • Default chunking only — custom chunk size and overlap configuration is not yet available
  • Azure portal only — VS Code is not yet supported for knowledge base configuration
  • One file upload at a time — wait for each file to reach Completed before uploading the next

GitHub sample

The complete sample workflow definition, Bicep infrastructure template, sample HR policy documents, and connection configuration are available on my GitHub.

What comes next

KBaaS is the most significant reduction in RAG pipeline complexity that Logic Apps has offered to date. For scenarios where uploaded documents are the primary knowledge source, it removes the Azure AI Search setup entirely and replaces it with a portal-native upload flow. The preview limitations, particularly the connection persistence bug and the lack of live source connectors, will be addressed in subsequent releases.

The natural next step is combining KBaaS with the multi-agent patterns from Part 5 of the Logic Apps Agent Loop series, an orchestrator agent that routes questions to specialist knowledge bases, each containing documents for a specific domain.

Leave a Reply