RAG in AI means retrieving relevant material before a model generates an answer. If you already have an Azure AI Search index, start by querying it and checking the returned passages before you add answer generation. This walkthrough is for developers who want to understand that retrieval step using the azure-ai skill.
Microsoft now documents both a classic RAG pattern, where an application passes search results to a model, and agentic retrieval through knowledge bases. The exercise here stays with a query to an existing index. It does not require a knowledge base, a model deployment or a new application.
What is RAG in AI, and what does retrieval do?
Retrieval-augmented generation has two jobs with different failure modes. A search system finds material related to a question. A language model then uses that material to compose a reply. Microsoft's RAG overview describes the classic pattern as a search query followed by a separate handoff to the model. You can inspect the first job without doing the second.
Suppose someone asks whether an employee can carry unused leave into the next year. A search result might contain a policy passage about carryover, its effective date and an exception for a particular location. Retrieval has succeeded only if the right passage is available to inspect. The proposed answer still needs to preserve the exception and date. A fluent sentence that drops either one is a bad answer even when the search returned the right document.
This distinction matters because a search hit is not a verified claim. A title may match while the body addresses an older policy. Several passages may disagree because they cover different offices or periods. The top result may mention the question's words without answering it. Before asking a model to write, look at the actual text returned, identify its source and decide whether the answer is there.
Azure AI Search supports keyword, vector and hybrid retrieval. Keyword search looks for terms in searchable fields. Vector retrieval depends on an index configured with vectors and the means to query them. Hybrid search combines text and vector results. For this exercise, the existing index determines what is available. Do not describe a keyword result as semantic or vector retrieval simply because the original question was phrased in natural language.
What do you need before using the azure-ai skill?
The skill and its source
The catalog entry for azure-ai identifies a Microsoft repository and lists Copilot CLI and Claude Code compatibility. The current SKILL.md in microsoft/azure-skills covers classic Azure AI Search indexes and queries, among several other Azure AI services. Its search guidance points to service listing, index inspection, index queries and a separate diagnostics reference. It is guidance for an agent, not a search service that stores documents.
The repository describes the skill as MIT licensed. Its page does not establish a separate subscription price or usage allowance for the skill, so do not treat it as an alternative Azure pricing plan. A query still uses your Azure AI Search service. Your chosen agent host may have its own access requirements and charges, which you should check with that host before relying on it.
An existing index and Azure MCP
You need the name of an existing Azure AI Search service, an index you are allowed to inspect or query, and an authenticated host with the Azure MCP Server enabled. The catalog notes that the skill's search tool references depend on Azure MCP. Microsoft's Search tool reference documents the index inspection and query operations. If your host cannot reach those tools, reading the skill alone will not produce live search results.
Permissions need a closer look than a general Azure sign-in. Microsoft's role guidance says Search Index Data Reader can query an index but cannot view index definitions. Index inspection and querying may therefore require different permissions. Ask your administrator for the narrow access needed for each operation rather than using an admin key to get around an authorization error.
How should you check the skill before installing it?
Open the catalog entry, follow its source link, and read the version of SKILL.md you intend to install. Check the publisher and the exact repository and commit. The repository's current skill directory includes a scripts folder, so inspect its contents and read any scripts your installation or chosen workflow might run. Do this before giving an agent access to a signed-in Azure session.
The catalog's full safety checklist also calls for limiting access, trying a test project, scanning the skill and reviewing updates before installing them. A scanner can catch some known risks; it cannot tell you that every sentence in a skill is appropriate for your task. Instructions to read credentials, send data to an unrelated endpoint or run unexpected setup code deserve investigation regardless of a clean scan.
Treat a catalog description as a starting point, not a frozen copy of the repository. The current Microsoft skill document names `search_index_get` and `search_query` in its AI Search guidance. Microsoft's MCP documentation describes the corresponding operations and their required service, index and query inputs. Check the tool names exposed by your installed version instead of copying a command from a different revision.
How do you test retrieval from an existing Azure AI Search index?
Inspect the index first
In a compatible host, ask the agent to use azure-ai to show the schema of your named index in your named search service, without changing anything. For example: "Use azure-ai and Azure MCP to inspect index 'policy-docs' in service 'company-search'. Show which fields are searchable and which can be returned in results. Do not create or modify resources." The names are placeholders; replace them with your own.
Microsoft's index inspection tool returns details such as fields and index properties. Look for the field containing the passage text, a document identifier and, if present, a source URL or date. Check whether the text field can actually be returned in a query result. A search that returns only an opaque ID is difficult to evaluate as a RAG input. If index inspection is denied, record that limit and ask for the appropriate permission rather than guessing the schema.
Query with a question you can check
Choose a question whose answer you can verify in the underlying documents. Then ask: "Use azure-ai to query index 'policy-docs' in service 'company-search' for 'unused leave carryover rules'. Return the matching text and source identifiers. Do not write an answer or change the index." Keep the service, index and query explicit. The Azure MCP query tool reference identifies all three as required inputs.
Read the returned fields, not just the result order or relevance score. Does the passage contain the rule, or merely mention leave? Is the policy for the right location? Can you trace the text back to a document? If the first query misses a known passage, try the terminology used by the document, then compare results. That tells you something concrete about the index and query. Repeating the same broad question will not tell you why the passage was missed.
Identify what kind of search ran
The documented Azure MCP query tool chooses keyword search when the index has no vector fields. It can use hybrid search when vector fields have a suitable profile and a configured vectorizer. If that vectorizer is unavailable, the query can fail rather than quietly becoming keyword-only. The tool does not offer a vector-only mode. Inspect the schema and any tool error before drawing a conclusion about vector retrieval.
Semantic ranking is another choice, not a default to assume. The MCP query tool offers a semantic query mode when the index has a semantic configuration. Microsoft's pricing page says semantic ranker is unavailable on the Dedicated Free tier. For a first retrieval check, use the index as it stands and note whether the query used ordinary or semantic ranking. Change modes only when the index and tier support it and you have a reason to compare the results.
How do you check a proposed answer against retrieved passages?
Write a short candidate answer separately from the search results. Then match each factual statement to a specific returned passage. If the candidate says leave can always be carried over but the passage applies only to employees in one location, narrow the sentence. If it states a deadline that none of the results contains, remove the deadline or retrieve the document that establishes it. Do not let the answer's confident tone substitute for evidence.
Record the source identifier next to the statement it supports. A document title alone may be too coarse if several sections have different rules. Where the index returns excerpts rather than whole documents, open the source before treating a clipped sentence as definitive. If two retrieved passages conflict, check their dates and scope in the original documents. The honest result may be that the available material cannot settle the question.
Try a second question designed to expose a boundary: an exception, a date or a term the policy does not cover. You are looking for whether retrieval supplies enough context to distinguish a supported answer from an attractive guess. If it does not, fix the retrieval problem first. Adding a model to write over incomplete results may make the gap less visible to the eventual reader.
What does this retrieval exercise cost?
Azure AI Search
Microsoft's free-tier guidance says a subscription can have one Dedicated Free search service with 50 MB of storage. It does not expire, but it cannot scale and does not support semantic ranking or managed identities for Microsoft Entra ID authentication. That makes it a possible choice for a small search exercise, not a suitable stand-in when your intended workflow requires those features. An existing paid index remains on its existing billable plan.
For paid services, Microsoft's cost guide says Dedicated capacity is billed by the hour using search units; Serverless bills compute usage by compute-unit hour and indexed storage by GB per month. Serverless billing began in September 2026, so do not assume it is a free option for an occasional query. Optional features and model calls can add charges. The public pricing page lists rates, but they are not a reliable total without checking region, agreement and usage. Check your region, agreement and expected usage in the Azure portal or pricing calculator before quoting a total.
The skill, MCP server and agent host
The Microsoft repository is publicly available under the MIT license, and Microsoft documents ways to connect an agent host to Azure MCP. Neither fact makes your Azure service, model use or agent host free. The practical limit for this exercise is access: the skill needs a compatible host, Azure MCP needs to be connected, and the signed-in identity needs the permissions for the requested operation. Check host pricing and limits with the host provider; the skill page does not establish them.
How should you choose the smallest useful setup?
If your team already has an index and an approved Copilot CLI or Claude Code setup, use that host, the reviewed azure-ai skill and narrowly scoped Azure MCP access. For a small budget, inspect and query the existing index before paying for a model or optional ranking feature. A new Free search service is the wrong choice if you need to inspect the team's real documents or use a feature its tier excludes.
For a larger team, agree on the service and index names, who may query them, and how results may be shared. Microsoft's Azure MCP security guidance recommends limiting roles and enabled tools because the server acts with its caller's Azure permissions. Do not paste sensitive passages into an unapproved agent host. Where privacy rules rule out that host, use an approved environment or perform the retrieval check through your organization's existing search tooling instead.
The azure-ai skill is a poor pick if you have no searchable index and expect it to ingest documents for you, or if you need a complete deployed RAG application. Its current Microsoft guidance keeps classic search work in azure-ai and routes Foundry IQ knowledge bases to separate guidance. Once you can show that the right passages are returned, you can decide whether a classic search-to-model handoff meets your needs or whether to investigate Microsoft's knowledge-base route. That is a later design choice, not a prerequisite for seeing what your index retrieves.
Sources
azure-ai: official source · listing on Browse AI Tools
