
If you’ve been following my blog for a while, you know I love exploring how modern Microsoft technologies can connect with enterprise systems. Today, I want to share something I found really exciting , and I think you will too . In many companies, an AS400 system has been running quietly in the background for 10, 15 sometimes even 20 years. It holds customer records, inventory data, financial transactions, all of it trusted. But asking it a question? That still takes a developer, a custom report, and sometimes days of waiting. In this article, I’m going to show you how I changed that : using Azure Data Factory, Azure AI Search, Azure AI Foundry and Microsoft Copilot.

Welcome back again, Today’s article is one I’ve been really excited to write. If you work with enterprise legacy systems, there’s a good chance you’ve come across an AS400 at some point. It’s one of those systems that just keeps running , year after year, holding critical business data, running core processes, and never missing a beat. The problem is not the system itself. The problem is getting a quick answer out of it.
So I decided to test something: can I connect a real AS400 to Microsoft Azure AI, and let a business user simply ask it a question in natural language? The answer is yes , and in this article, I’ll show you exactly how I did it.
I used Azure Data Factory to pull the data, Azure AI Search with Azure AI Foundry to make it searchable by AI, and Copilot to publish the bot and deliver the answers directly in Microsoft Teams. The AS400 was never modified. Nothing was migrated.
Grab a coffee and let’s get into it 
In many organizations that still run an AS400, accessing business data quickly can be a challenge. Some clients have already built reporting layers or dashboards on top of their IBM i system , and that’s great. But in a lot of cases, especially for ad-hoc questions that weren’t planned in advance, the process still looks something like this: a business user needs a specific answer, they ask IT, IT runs a query or generates a report, and the user gets their answer ; hours or sometimes days later. If that sounds familiar in your context, this article is for you. If you’ve already solved that problem, the AI layer I’m about to show you can still add value ; by making that access even faster and available to everyone.
Before I explain how the architecture works, I want to show you exactly what changes for the user. in the « Figure1 » screenshot this is what AS400 data actually looks like , real customer records, with field names like CUSNUM, LSTNAM, CDTLMT, CHGCO. The data is accurate and has been trusted for decades. But reading it requires knowing what every code means. On the « Figure2 » screenshot, this is what the same data looks like after adding the Azure AI layer and Copilot integration , a natural-language question in Copilot , a clear answer in seconds, with the exact source cited.
Same data. Same AS400. Completely different experience for the user.
Technical field names like CUSNUM, LSTNAM, CDTLMT, CHGCO. This is what the raw AS400 data looks like ; accurate and valuable, but impossible to read without knowing the system.



Let me be clear about something: the AS400 data is not the problem. In many companies, it’s actually the most reliable data they have. The challenge is simply how you access it. Today, getting a specific answer out of DB2 for i usually means one of three things :
None of these are self-service. And that’s the gap this article addresses.
What I’m showing in this article is a different approach: instead of trying to make the AS400 expose itself as an API, you connect to it from Azure, bring the data out on a schedule, make it searchable, and let people ask questions through Copilot. The AS400 keeps doing exactly what it already does. You just add a smarter front door on top of it.

Migration is often suggested as the only path to modernization. But a migration project is multi-year, expensive, and risky – and it frequently fails to capture business rules that were never documented, only encoded inside old programs. Migration solves a different problem than the one usually being asked. Most of the time, the real request is simpler: let people get answers.
I’ve written about this topic before : if you’re interested in how IBM i / AS400 data can be connected using Microsoft Fabric and D365 Finance & Operations, I covered that in a previous article:
Before I get into the technical setup, let me answer the question I always get asked first: « OK, but what do we actually gain from this? » Fair question. Here’s my honest answer.

| Dimension | Before | After |
| Time to an answer | Hours to days ; depends on IT availability | Seconds – self-service, any time |
| Who can get the answer | Only people with specialized system access, or who can wait for a developer | Any business user, in natural language, in Teams or Microsoft Copilot |
| IT involvement per question | Required for nearly every ad-hoc request | None – IT is only needed to maintain the pipeline, not answer questions |
| Risk to the source system | — | None. The AS400 is never modified |
| Investment required | — | Weeks of integration work, not a multi-year migration program |

Based on my experience on this kind of integration Legacy systems projects, here are some specific advantages, in practice i can mention :
Here’s my honest answer:
I asked this exact question before building anything. IBM has invested in AI – Watsonx is the main AI platform. So why not just use that? Here’s what I found when I looked into it.

Now let me show you the big picture before we go into detail. I like to explain the approach in four simple layers first without any product names – so the logic makes sense on its own. Then in the next section I’ll map each layer to the actual Azure service I used.

Alright, this is the part where things get interesting. Let me walk you through each tool, what it does in this architecture, and how configured it.

Five Microsoft and Azure services work together here.

Azure Data Factory is Microsoft’s cloud data integration service. Here, its job specific: reach into Db2 for i using its native DB2 connector, and copy data out on a schedule. ADF doesn’t transform or interpret anything; it moves data reliably, on schedule, and that’s the whole job.

SQL Database is where the copied data actually lives once it leaves the AS400 side. It plays two roles: a Bronze table holding a faithful, untouched copy of the source data, and a Silver view that renames cryptic legacy fields into plain business language. It’s also where new records created through the conversational layer get written safely, into their own staging table,

This is the most important element in the whole stack, Azure AI Search is not a database, and it isn’t the AI model either – it’s the layer that turns structured business data into something a language model can reason over accurately, instead of guessing.
What Azure AI Search actually does is build a searchable, structured index over the Silver layer. It supports:

Copilot Studio is Microsoft’s low-code platform for building and publishing AI assistants. Here, it connects directly to the Azure AI Search index as a knowledge source for answering questions, and to a Power Automate flow as a callable tool for creating new records. It’s also what puts the assistant directly into Microsoft Teams,

Microsoft Foundry can play the same conceptual role as Copilot Studio – connecting to the same Azure AI Search index and answering the same kinds of questions – but it’s aimed at teams who need full programmatic control: custom orchestration logic, a wider model LLM catalog, and deployment into a custom application rather than Teams or a web widget.
The connection uses Azure Data Factory’s native DB2 connector,
At its core, the pipeline contains the following activity: a Copy Data activity, with two sides:
When the pipeline runs, Data Factory opens a connection to Db2 for i, reads the rows, and writes them into Azure SQL , on a schedule. column names and values are copied. (Renaming into business language happens later, in the Silver layer – see the next section.)
your-host.com:446


Data lands first in a Bronze table, unmodified copy, with the original field names. A Silver layer, built as a SQL view, renames those fields and resolves coded values into plain business language. This translation step is what makes the data usable for grounding an AI answer.

Here are the concrete configuration that turn that role into a working index. The Silver layer gets indexed for hybrid (keyword + semantic) search. Two design constraints matter here, and they must be decided&n bsp;before the index is created:


Copilot Studio / Azure AI Foundry connects to the Azure AI Search index as a knowledge source, You point it at your index, From there, you publish it to Microsoft Teams or Microsoft Copilot.


Never write directly into the source-mirrored table, and never into the AS400 system itself, In practice, this means new records created through the chat interface land in a separate staging table in Azure SQL – never in the table that mirrors AS400.
On the write-back side, Copilot Studio calls another agent as a tool to let users create new records through a natural-language.


A record created through a natural-language request in chat, confirmed directly in the staging table: every field landed correctly


For write-back, the right tool in the Microsoft ecosystem is Azure Logic Apps Standard. It ships a dedicated IBM i Program Call connector , built-in connector that calls RPG or COBOL programs directly on the IBM i system over TCP/IP. Instead of writing raw SQL into a Db2 table, Logic Apps calls the program that already exists on the AS400.

A real deployment needs a recurring schedule. This is done with a&nb sp;schedule trigger attached to the pipeline ; in this implementation, set to run every hour, which is a reasonable cadence for reference-style data such as a customer master.
Two strategies exist for refreshing the Bronze table on each run:
The search index refresh must be chained into the same pipeline run as the data copy,, calls the search index’s Run Indexer endpoint directly. This keeps data updated and search index updated also .


And that’s a wrap
I hope this article gave you a clear picture of what it actually takes to connect an AS400 system to an Azure AI layer the setup steps, and the results you can expect at the end of it.
If I had to pick the one thing I want you to take away from this: you don’t need to migrate your AS400 to start getting value from its data. You can add an AI layer on top, and give your business users instant, self-service answers in Microsoft Copilot today.
If you have any questions, or if you’ve tried building something similar and ran into different issues, drop a comment or reach me directly through dynvision365.com. I’d love to hear about your experience.
See you in the next article
Thanks
Original Post https://dynvision365.com/2026/07/02/integrating-as400-with-azure-ai-and-copilot/






