#Fill vector store via CURL does not work

14 messages · Page 1 of 1 (latest)

pearl onyx
#

Hey everyone! 🙂
Very simple use case - I want to fill the vector memory of my project in Azure AI Foundry via a CURL command. I use the way described in the documentation: https://learn.microsoft.com/en-us/azure/ai-foundry/agents/how-to/tools/file-search-upload-files?pivots=rest

Uploading the file, which apparently has to be done before adding the file to the vector store, works fine. But adding the same file to the vector store does not work - the command, the variables you see below are unchanged and work for the CURL command that first uploads the file.

This is the command:
curl --request POST
--url "$AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/vector_stores/vs_v383i2msmd8939d/files?api-version=2025-05-01"
-H "Authorization: Bearer $ACCESS_TOKEN"
-H "Content-Type: application/json"
-d "{"file_id": "$FILE_ID"}"

The error message I get is:
"error": {
"message": "No vector store found with id 'vs_v383i2msmd8939d'.",
"type": "invalid_request_error",
"param": null,
"code": null
}
The vector store is definitely available and I could also upload this file manually, but I would like to do this automatically via a CI/CD pipeline, where this CURL command is then executed.

Does anyone know more about this and could help me? I would be very grateful!

Find code samples and instructions for uploading files to Azure AI Foundry Agent Service.

copper moss
#

Hi @pearl onyx Thanks for sharing the details. Based on your error message here are some key things to check and try:

Troubleshooting the “No vector store found” Error

Double-check the Vector Store ID

  • Ensure that the ID vs_v383i2msmd8939d is correct and matches exactly what was returned when the vector store was created.
  • If you created the vector store programmatically, you can retrieve its ID using the GET vector store API.

Confirm the Vector Store Status

  • The vector store must be in a "ready" or "completed" state before you can add files to it.
  • Use this endpoint to check its status:
    curl --request GET \
      --url "$AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/vector_stores/vs_v383i2msmd8939d?api-version=2025-05-01" \
      -H "Authorization: Bearer $ACCESS_TOKEN"
    
  • If the status is still "creating" or "in_progress", wait until it's ready.

Verify the Endpoint Format

  • Ensure the endpoint you're using is the project-specific endpoint, not a generic Azure OpenAI endpoint.
  • It should look like:
    https://<your-resource-name>.services.ai.azure.com/projects/<project-id>

Check API Version Compatibility

  • You're using api-version=2025-05-01, which is valid per the docs, but ensure that your Azure region supports this version.
  • If in doubt, try downgrading to a stable version like 2024-05-01-preview and see if the issue persists.

Find code samples and instructions for uploading files to Azure AI Foundry Agent Service.

#

@pearl onyx
Validate Authorization Scope

  • Make sure your $ACCESS_TOKEN has the correct scopes and roles (e.g., Cognitive Services OpenAI Contributor).
  • If you're using a service principal or managed identity, verify its role assignments in Azure IAM.

Suggested Next Step

Try this modified command after confirming the above:

curl --request POST \
  --url "$AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/vector_stores/vs_v383i2msmd8939d/files?api-version=2025-05-01" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"file_id\": \"$FILE_ID\"}"

Note the escaped double quotes in the JSON payload—this is important when passing JSON via -d in shell scripts.

pearl onyx
#

Thank you very much! I'll write what results I got.

#

https://<your-resource-name>.openai.azure.com/ai-foundry/projects/<project-id>

So, you mean instead of the "Azure AI Foundry Project Endpoint" I should use the one with .openai?

#

Trying to upload file ...
{
"id": "assistant-GcEIksW28ksmvL2kfl",
"object": "vector_store.file",
"usage_bytes": 0,
"created_at": 1751533418,
"vector_store_id": "vs_dFsGug3USjsmaFkv",
"status": "in_progress",
"last_error": null,
"chunking_strategy": {
"type": "static",
"static": {
"max_chunk_size_tokens": 800,
"chunk_overlap_tokens": 400
}
}

With my project endpoint (which is <resource-name>.services.ai.azure.com/[...] I could upload the file, but I the vector store is still not listed in the Azure AI Foundry project

pearl onyx
pearl onyx
#

@copper moss You can mark it as resolved! Thank you for your help! I found the solution - it is documented here:
https://github.com/orgs/azure-ai-foundry/discussions/83

Do you think it would be OK to add your comment you sent me right here to the discussion?

GitHub

Hey everyone! 🙂 Very simple use case - I want to fill the vector memory of my project in Azure AI Foundry via a CURL command. I use the way described in the documentation: https://learn.microsoft.c...

copper moss
pearl onyx
copper moss
#

Just copy and paste the bits you found useful and say this is how you fixed it.

pearl onyx
#

Verify the Endpoint Format
Ensure the endpoint you're using is the project-specific endpoint, not a generic Azure OpenAI endpoint.
It should look like:
https://<your-resource-name>.openai.azure.com/ai-foundry/projects/<project-id>

I do not know where this is listed, but this information is not correct for that case. I used it, it did not work

copper moss
#

If you change this to <resource-name>.services.ai.azure.com/ does it work so it should be https://<your-resource-name>.services.ai.azure.com/projects/<project-id>

#

It should be
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT