Share via

GPT-5.2 (Azure AI Foundry, Canada East) Chat Completions ignores PDF files (inline CreateFilePart + uploaded file_id both ignored) — Azure.AI.OpenAI 2.2.0-beta.4

Christian Martel 0 Reputation points
2026-05-01T18:07:14.41+00:00

Hi everyone,

I’m seeing what looks like a model/deployment behavior change when moving from a GPT-4.1 deployment to GPT-5.2 in Azure AI Foundry. My models are deployed in Canada East.

What I’m trying to do

Include a PDF as part of a Chat Completions request, so the model can summarize/quote from it.

What worked before (GPT-4.1)

With GPT-4.1, I could include a PDF using ChatMessageContentPart.CreateFilePart(...) and the model clearly used the PDF content in its response.

What happens now (GPT-5.2)

With GPT-5.2, the call returns success (no refusal, no error), but the PDF content is ignored. The answer is generic and behaves as if the file was not provided.

I tried these two approaches:

  1. Inline file part (bytes in request)
  2. Upload first + reference by file id (The upload was successful, but again, file content was ignored)

Packages / versions

<PackageReference Include="Azure.AI.OpenAI" Version="2.2.0-beta.4" />
<PackageReference Include="Azure.Core" Version="1.54.0" />
<PackageReference Include="OpenAI" Version="2.2.0-beta.4" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.3.9" />

Region / deployment

  • Azure AI Foundry
  • Region: Canada East
  • Model deployment: gpt-5.2
  • Previously: gpt-4.1

Minimal code (upload + fileId reference)

using Azure.AI.OpenAI;
using OpenAI.Chat;
using OpenAI.Files;
using System.ClientModel;
var azureClient = new AzureOpenAIClient(new Uri(endpoint), new ApiKeyCredential(apiKey));
var chatClient = azureClient.GetChatClient(deploymentName);   // gpt-5.2 deployment
var fileClient = azureClient.GetOpenAIFileClient();
var upload = fileClient.UploadFile(localPdfPath, FileUploadPurpose.Assistants);
var fileId = upload.Value.Id;
#pragma warning disable OPENAI001
var parts = new List<ChatMessageContentPart>
{
    ChatMessageContentPart.CreateTextPart("Summarize the attached PDF and quote the first paragraph verbatim."),
    ChatMessageContentPart.CreateFilePart(fileId),
};
#pragma warning restore OPENAI001
var messages = new List<ChatMessage>
{
    ChatMessage.CreateUserMessage(parts)
};
var completion = chatClient.CompleteChat(messages);
Console.WriteLine(completion.Value.Content[0].Text);

Minimal code (inline bytes in request)

#pragma warning disable OPENAI001
var parts = new List<ChatMessageContentPart>
{
    ChatMessageContentPart.CreateTextPart("Summarize the attached PDF."),
    ChatMessageContentPart.CreateFilePart(
        BinaryData.FromBytes(pdfBytes, "application/pdf"),
        "application/pdf",
        "document.pdf")
};
#pragma warning restore OPENAI001


Questions

  1. Does GPT-5.2 on Azure currently support using PDFs in Chat Completions via ChatMessageContentPart.CreateFilePart(...) (either inline bytes or fileId)?
  2. If not, what’s the recommended Azure-supported approach for document grounding with GPT-5.2 (Responses API? Assistants + vector store? something else)?
  3. Is this a known limitation/bug for gpt-5.2 or for Canada East deployments?
  4. Are there any required request options, headers, or deployment settings to enable file usage?

Any guidance or confirmation would be appreciated. I can provide sanitized logs / raw request payload if needed.

Azure OpenAI in Foundry Models
0 comments No comments

2 answers

Sort by: Most helpful
  1. Anshika Varshney 13,305 Reputation points Microsoft External Staff Moderator
    2026-05-05T03:10:37.49+00:00

    Hi Christian Martel,

    Thank you for sharing the update I appreciate you taking the time to confirm the resolution! From your update, it looks like the issue is indeed related to how the prompt is structured, not the region or model availability.

    When prompts are too long or include multiple instructions, the model can give inconsistent or weaker responses. This is common even when everything is set up correctly.

    You can try a few simple things:

    Use a shorter and more direct prompt.
    Avoid combining too many tasks in one request.
    Keep system instructions clear and not conflicting.
    Reduce long conversation history if you are sending it.
    Test with a simple question and then gradually add complexity.

    In simple words: The model is working fine in the region. The output quality depends a lot on how the prompt is written.

    If a simple prompt works better and a complex one does not, then it confirms it is a prompting issue.

    I Hope this helps. Do let me know if you have any further queries.

    If this answers your query, please do click Accept Answer and Yes for was this answer helpful.

    Thankyou!

    Was this answer helpful?

    0 comments No comments

  2. Christian Martel 0 Reputation points
    2026-05-01T19:26:58.6266667+00:00

    Solved, it was an issue with my prompting.

    Was 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.