Skip to content

[BUG] Deleting agent vector stores leave empty AI Search indexes. #51447

@jraadt

Description

@jraadt

Library name and version

Azure.AI.Projects 1.0.0-beta.10

Describe the bug

I use the Azure AI Foundry Agent service with the Standard setup, with Bring Your Own (BYO) resources configured for threads, files, and vector stores. When I create a vector store and add files, it creates an index in the connected Azure AI Search instance.

PersistentAgentsVectorStore vectorStore =
  await agentsClient.VectorStores.CreateVectorStoreAsync(
      fileIds: myFileIds,
      name: "my-vector-store",
      expiresAfter: new VectorStoreExpirationPolicy(
          VectorStoreExpirationPolicyAnchor.LastActiveAt,
          7
      ),
      cancellationToken: cancellationToken
  );

When I delete the vector store, the vector store is deleted, but the associated index in Azure AI Search doesn't get removed. The index document count goes to 0 and total storage size goes to 0, but it never gets deleted.

await agentsClient.VectorStores.DeleteVectorStoreAsync(
    "my-vector-id",
    cancellationToken: cancellationToken
);

Should this get removed as well? What is the proper way to clean up the index since there is a limit to the number of indexes an AI Search can have?

Expected behavior

I expect the AI Search index to also be removed so we don't run out of quota space.

Actual behavior

The AI Search index is emptied, but not removed.

Reproduction Steps

PersistentAgentsVectorStore vectorStore =
  await agentsClient.VectorStores.CreateVectorStoreAsync(
      fileIds: myFileIds,
      name: "my-vector-store",
      expiresAfter: new VectorStoreExpirationPolicy(
          VectorStoreExpirationPolicyAnchor.LastActiveAt,
          7
      ),
      cancellationToken: cancellationToken
  );

await agentsClient.VectorStores.DeleteVectorStoreAsync(
    "my-vector-id",
    cancellationToken: cancellationToken
);

Environment

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    AI ProjectsClientThis issue is related to a non-management packageService AttentionWorkflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions