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.

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-sampleazd auth loginazd initazd 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 tsvaz 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 ` -Forceaz logicapp deployment source config-zip ` --name <logic-app-name> ` --resource-group <resource-group> ` --subscription "<your-subscription>" ` --src ..\kbaas-deploy.zipaz logicapp restart ` --name <logic-app-name> ` --resource-group <resource-group>
Verify the workflow deployed cleanly go to the Logic App Overview → Notifications 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.mdfrom the sample’sdocs/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.

KBaaS creates the following Cosmos DB containers during ingestion:
| Container | Purpose |
|---|---|
KnowledgeHubs | Knowledge base metadata |
KnowledgeArtifacts | Source metadata and document references |
KnowledgeArtifactChunks | Full-text document chunks |
KnowledgeArtifactChunkSummaries | Summarised 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-agent → Overview → Run trigger → copy the callback URL.
Test 1 — grounded answer from the leave policy:
With payload (application\json): {“question”: “How many days of annual leave am I entitled to?”}

Test 2 — grounded answer from the expense policy:
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:
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.

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 availability — text-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.