The problem: answers people can trust, from a system security can sign off
- Engineers and staff needed fast answers from a large internal IT knowledge base.
- An AI assistant only helps if its answers are grounded in the real articles and cite the source, so people can check them.
- In a bank, it also has to pass security review: private networking, no API keys, least privilege, and no extra load on the system that owns the knowledge.
- The initial build didn't include AI Foundry, which left models and the agent outside the platform's controls. I rebuilt it with Foundry as the base.
The design
IT knowledge base (source of truth)
→ Scheduled Power Automate flow: new and changed articles + metadata (incl. source URL)
→ Blob Storage
→ AI Search indexer → index (semantic ranking, keyword, metadata filters)
→ Copilot Studio agent, grounded on the index
→ Answers with citations back to the original article
- The knowledge base stays the single source of truth. The AI pipeline only reads from it.
- The agent reads the index, not the source system, so there's no load on the source and retrieval stays controlled.
- Citations point to the original article, not the Blob copy, because the source URL is carried as metadata through the whole pipeline.
What I built
- AI Foundry as the control plane for models and agents: model choice and versions, evaluation, content safety and tracing, under the same RBAC, private networking and policy as the rest of the platform.
- The Power Platform environment and the scheduled sync flow that detects article changes, writes content and metadata to Blob, and triggers the indexer.
- Azure AI Search with an index tuned for semantic ranking and metadata filtering.
- The Azure Functions, code and infrastructure.
- All of the infrastructure in Terraform: modules for AI Foundry, AI Search, Storage, Function Apps, private endpoints and app registrations, with configuration validated against the live Azure APIs before promotion.
- Networking: fresh VNets for the build, VNet integration for the Functions, and private endpoints for the AI and data services.
- Identity: managed identities with Azure RBAC role assignments. Key auth is off.
Illustrative: the Foundry resource, private and keyless.
resource "azurerm_cognitive_account" "foundry" {
name = "aif-knowledge-agent"
location = var.location
resource_group_name = azurerm_resource_group.ai.name
kind = "AIServices"
sku_name = "S0"
custom_subdomain_name = "aif-knowledge-agent"
public_network_access_enabled = false
local_auth_enabled = false
identity {
type = "SystemAssigned"
}
}
resource "azurerm_private_endpoint" "foundry" {
name = "pe-aif-knowledge-agent"
location = var.location
resource_group_name = azurerm_resource_group.ai.name
subnet_id = var.private_endpoint_subnet_id
private_service_connection {
name = "foundry"
private_connection_resource_id = azurerm_cognitive_account.foundry.id
subresource_names = ["account"]
is_manual_connection = false
}
}
Things to watch
- Carry the source URL as metadata from the start. If it's dropped anywhere in the pipeline, citations end up pointing at storage blobs instead of the article people actually trust.
- The custom subdomain matters. An AIServices account needs one for Entra ID authentication and private endpoints. Set it at creation.
- Validate configuration against the live API. AI services change quickly. Values that pass
terraform validatecan still be rejected by the service, so check them against the real API before promoting. - "Private" needs proving from the caller's side. Test resolution and connectivity from the networks that actually call the services.
What it solves
- Grounded answers with citations back to the source article.
- No load on the source system, and a controlled retrieval path.
- One governed home for models and agents, instead of each agent managing its own model access and safety.
- A repeatable, keyless, private pattern in Terraform for the next agent.
What it doesn't solve (general guidance for any build like this)
- Document-level permissions. If the source restricts some articles, the index must carry those permissions and filter by the user's identity at query time (security trimming), or the corpus must be limited to broadly approved content.
- Connectors that can't use managed identity. Any connector limited to basic or key-based auth needs a documented exception and a plan to replace it, such as a custom OAuth connector.
- Answer quality on its own. Grounding and citations help; ongoing evaluation is what keeps answers accurate as the knowledge base changes.
Checklist
- [ ] Source system stays the single source of truth; the pipeline only reads
- [ ] Source URL carried as metadata end to end
- [ ] Agent reads the index, never the source system directly
- [ ] AI Foundry as the control plane for models and agents
- [ ] Private endpoints for AI and data services; VNet integration for compute
- [ ] Managed identity and RBAC everywhere; key auth off
- [ ] Every exception to the identity model documented with an exit plan
- [ ] Configuration validated against live APIs before promotion
Further reading
- Microsoft Foundry documentation (Microsoft Learn)
- Azure AI Search: indexers, semantic ranking, and security trimming (Microsoft Learn)
- Copilot Studio: knowledge sources (Microsoft Learn)