What if your support team could start every morning with an AI-generated summary of tickets most likely to breach SLA? This tutorial shows you how to build exactly that: a grounded agent in Microsoft Foundry that automatically analyzes your ticket data and surfaces risks. Using Routines in Microsoft Foundry, we run the agent on a recurring schedule so risks are identified early and addressed before they escalate.
You'll learn how to:
- Connect Azure Blob Storage data to Azure AI Search for RAG
- Create a Foundry IQ knowledge base from your search index
- Build a grounded agent with SLA triage instructions
- Schedule daily automated runs using Routines
Time to complete: ~45 minutes | Prerequisites: Azure subscription, Microsoft Foundry access
Prepare the dataset in Blob Storage
Before the agent can summarize SLA risk, it needs a trusted place to retrieve ticket context from. In this example, we used a sample dataset from Hugging Face. A subset of this data is uploaded to a private Azure Blob Storage container and later indexed by Azure AI Search.
Instructions:
- Open Azure Portal and go to Storage Accounts.
- Create or open the storage account that you want to use.
- In the storage account left navigation, select Data storage → Containers.
- Create a new container for your data. This is where the sample dataset will be stored. Open the newly created container.
Permission note: if the portal cannot list or upload blobs with the signed-in Entra account, go to the storage account Access Control (IAM) and assign Storage Blob Data Contributor to the signed-in user. The later Search indexing step also requires the Search service managed identity to have Storage Blob Data Reader on the storage account.
- In the container toolbar, select Upload.
- In the Upload blob pane, select Browse for files.
- Select the desired files. Select Upload.
Create the Azure AI Search vector index
Now that the sample data is available in Blob Storage, the next step is to make it searchable for grounding. Azure AI Search reads the content from the blob container, chunks and vectorizes the text, and creates the index that Foundry IQ will use later as the knowledge source for the agent.
Instructions:
- Go to Azure AI Search. Create an Azure AI Search service or select the one you want to use. Click import data.
- On Choose a data source, select Azure Blob Storage.
- On What scenario are you targeting? select RAG.
- Configure the blob source. Fill in your subscription, storage account and blob container. Leave parsing mode on default and authentication using managed identity on enabled. Select Next.
Permission note: if the import wizard cannot read from the container, make sure the Search service managed identity has Storage Blob Data Reader on the storage account. If needed, also assign Reader so the service can resolve the storage resource during import.
- On Vectorize your text, in the Kind dropdown, select Microsoft Foundry (this replaces the default Azure OpenAI option with Foundry's integrated embedding capabilities). Select the preferred Foundry project and embedding model. Put authentication type on System assigned identity. Check the acknowledgement box for additional costs, then select Next.
- On Vectorize your images, leave image vectorization and image text extraction disabled. (The sample data is text-first, so text vectorization is enough for this scenario.). Click Next.
- On Advanced settings, Leave everything on default and select Next.
- On Review and create, leave default and select Create.
When the import completes, Azure AI Search creates the index, indexer, and skillset.
Connect Azure AI Search to Foundry IQ and create the Foundry IQ knowledge base
Let's now connect the Azure AI search to Foundry IQ so we can do agentic RAG across data sources and
- Go to Microsoft Foundry at https://ai.azure.com. And select the preferred project.
- In the new Microsoft Foundry experience, click Build on the top right.
- In the left navigation under Build, click Knowledge.
- In the Foundry IQ resource field, click the dropdown/open button.
- Select the AI search we created.
- Leave Auth Type as API Key.
- Click Connect. Foundry IQ is now connected to the Azure AI Search resource and ready to create a knowledge base from one of its indexes.
- Click Create a knowledge base.
- In Choose a knowledge type, select: Azure AI Search Index.
- Click Connect.
- In the knowledge-base wizard, enter the knowledge source details. Open the Search index dropdown and select our created search index.
- Click Create / Next to create the knowledge source.
- After the knowledge source was created, select the chat/completions model for the knowledge base. Open the Model dropdown and select the desired model. Click Save / Save knowledge base.
Foundry IQ now has a knowledge base that wraps the Azure AI Search index and can be connected to a Foundry agent.
Create the grounded SLA risk agent
Create a prompt agent named and instruct it to use the connected Foundry IQ knowledge base for SLA risk analysis.
- In the left navigation, click Agents. On the Agents page, click New agent and then Build an agent.
- In the agent name field, enter a name for your agent.
- In the agent setup, select a model/deployment.
- In the Instructions field, entered instructions for example:
You are an SLA risk triage agent for IT support operations.
Use the connected Foundry IQ knowledge base / Azure AI Search knowledge source to answer all SLA ticket questions.
Do not answer SLA ticket questions from memory. Use the connected knowledge source whenever ticket details, breach risk, categories, queues, priorities, deadlines, or summaries are requested.
Identify the tickets at highest risk of SLA breach. Prioritize tickets with:- Critical or High priority- Open or In progress status- Low hours_until_breach values- Clear business impact in the ticket summary
For each high-risk ticket, include:- Ticket ID- Priority- Status- Category- Support queue- Hours until breach, if available- Why it is risky- Recommended next action.
If the answer is not available in the connected knowledge base, say: “I don’t know based on the available SLA ticket knowledge base.”
Cite sources where available. - Click into the Knowledge section of the agent. Click Add. Choose the option to connect Foundry IQ knowledge. In the Foundry IQ connection dialog, select the knowledge base we created. Click Connect.
- Click Save. The agent now exists in Foundry, has SLA triage instructions, and is grounded on the Foundry IQ knowledge base.
- Test the agent by asking: Test prompt: Using the connected SLA ticket knowledge base, summarize the tickets at highest risk of SLA breach and recommend next actions.
Create the daily Routine
- In the left navigation, click Agent again and open the agent we created.
- On the top right, click publish and then create routine.
- In the routine setup form, entered a routine name and choose a suitable routine schedule and run time.
- In the routine prompt/instructions field, enter the user prompt you want the agent to be triggered with. E.g. Run the daily SLA risk summary from the connected SLA ticket knowledge base. Click Create & start.
- Wait for the routine creation to complete. Open the routine detail/run area.
- Click ‘test run’ to trigger a manual test run from the portal.
- Confirm the routine dispatched successfully. Wait for the run history/status to update to ‘Completed’.
- Open the completed run entry / trace result by clicking on the response name.
- We can observe that the output came from the grounded agent connected to the SLA ticket knowledge base.
So the routine is active, and will run daily, scheduled at 9:00 AM, and has been manually test-run once successfully.
Conclusion
You've built a production-ready SLA risk agent that runs automatically every morning, grounded on your actual ticket data. The same pattern works for any recurring analysis task e.g. inventory alerts, compliance checks, or customer health scores.
Next Steps
Ready to go deeper?
- 📚 Foundry IQ documentation – Learn about advanced knowledge base configurations
- ⏰ Routines in Foundry Agent Service documentation – Learn details about Routines
- 🔧 Azure AI Search tutorials – Optimize your search index for better grounding
- 💬Microsoft Foundry community – Share your implementation and get help
Want to extend this solution?
- Add Microsoft Teams notifications when high-risk tickets are detected
- Connect multiple data sources to your Foundry IQ knowledge base
- Build a dashboard to track SLA trends over time
Have questions or built something cool with Microsoft Foundry Routines? Drop a comment below!