What is the correct way to use Azure AI Search to search for CSV data

Sukesh 0 Reputation points
2025-09-30T08:12:16.9133333+00:00

Hello Everyone,

I have a .csv file with employee sales data which has records of sales made by employees every month. An employee can have multiple rows in that csv. I have uploaded this to Azure storage account. I want to Azure AI Search to answer queries like:

  • What is highest order made by John Doe
  • Who made the lowest sale order
  • What is the total revenue for June 2025 etc.
    I want to test this first in the Azure Foundry chat playground.

Here are the steps I followed but that is not giving the expected responses.
Could you please tell me what am I doing wrong and what is the correct approach.

  1. Uploaded csv file to Azure storage account.
  2. Create a data source in AI Search service.
    Screenshot 2025-09-30 131343
  3. Created a new index.

Screenshot 2025-09-30 132000

  1. Created a new indexer.

Screenshot 2025-09-30 132214

  1. The documents count generated in the new index match the number of rows in the csv.

Screenshot 2025-09-30 132651

  1. In the chat playground, added the index s data source and select "keyword" as search type.

Screenshot 2025-09-30 133228

  1. The response is not correct. I'm expecting a response like $200.

Screenshot 2025-09-30 133325

Thank you

Azure AI Search
Azure AI Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
{count} votes

1 answer

Sort by: Most helpful
  1. Praneeth Maddali 1,110 Reputation points Microsoft External Staff Moderator
    2025-10-01T03:02:56.06+00:00

    Hi @Sukesh

    Thank you for reaching out regarding the issue with querying your CSV data in Azure AI Search.

    Looks like The issue occurs because the CSV indexer does not have a delimiter setting, which leads to incomplete field mapping, such as missing the Total_Cost field. Additionally, the Keyword search type in the chat playground has difficulty with natural language queries and aggregations. While Azure AI Search can retrieve the data, it depends on the LLM to calculate sums or maximum values on the client side, which can result in incomplete or irrelevant outcomes. To resolve this, set the delimiter to , for accurate CSV parsing and use Semantic search for improved query performance.

    To resolve this and receive the correct responses (such as "$200" for totals), please follow these steps:

    1. Correct CSV Parsing in the Indexer:
      • Go to Azure AI Search > Indexers > Edit index-csv-data.
      • Set the Parsing mode to Delimited text, choose Delimiter character as ,, and ensure First line contains headers is checked.
      • Save your changes, then Reset and Run the indexer. Check in Search explorer using Employee_Name:Yesenia Hernandez to confirm that Total_Cost values are displayed.
    2. How to Update Search Type in Azure AI Studio:
      • Go to the Chat playground and add index-csv-data as a data source.
      • Set the Search type to Semantic, adjust Top to 10-20, and select GPT-4o-mini.
      • Try queries such as "What is the total cost for Yesenia Hernandez?" to confirm it sums the Total_Cost field.

    Reference :
    https://free.blessedness.top/en-us/azure/search/search-how-to-index-csv-blobs
    https://free.blessedness.top/en-us/azure/ai-foundry/openai/use-your-data-quickstart?tabs=keyless%2Ctypescript-keyless%2Cpython-new&pivots=ai-foundry-portal
    https://free.blessedness.top/en-us/azure/search/semantic-search-overview

    Kindly let us know if the above helps or you need further assistance on this issue.

    Please "upvote" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.