Migration of Image embedding model (Embed-v4) after the deprecation of Azure Inference SDK

Do, Nam 20 Reputation points
2026-06-01T08:51:22.4866667+00:00

Hi, I'm using Cohere Embed-v4 deploying on Azure foundry to embed images. Currently using Azure inference SDK to do so.

However, it would be deprecated in August, and the advice is to migrate to OpenAI inference SDK. But seems like the inference SDK from OpenAI doesn't support image embedding and cannot be used with Cohere models like Embed-v4.

So, is there another way I can still use resources on Azure to do image embedding, or I have to use a 3rd party subcription to do it?

Foundry Models
Foundry Models

A catalog of AI models in Microsoft Foundry that you can discover, compare, and deploy using Azure’s built‑in tools for evaluation, fine‑tuning, and inference


3 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    1 deleted comment

    Comments have been turned off. Learn more

  2. Anshika Varshney 15,790 Reputation points Microsoft External Staff Moderator
    2026-06-11T21:50:28.1533333+00:00

    Hi @Do, Nam ,

    You’re absolutely right that the Azure Inference SDK changes can be a bit confusing, especially for image embedding scenarios like Cohere Embed‑v4.

    To clarify, the older OpenAI-style SDKs mainly focus on text-based scenarios and don’t fully support image embeddings. However, you can still continue using Embed‑v4 fully within Azure without needing any external services.

    Here are the supported approaches:

    1. Use Azure AI Foundry + new Azure AI Inference APIs

    The recommended path is to continue using your existing Embed‑v4 deployment in Azure AI Foundry and switch to the newer Azure AI Inference SDK or REST API.

    • These newer clients fully support image embeddings
    • You just need to:
      • Point to your Foundry endpoint
      • Use your deployment name
      • Call the image embedding API

    For example (Python):

    from azure.ai.inference import ModelClient
    from azure.identity import DefaultAzureCredential
    
    client = ModelClient(
        endpoint="https://<your-endpoint>.cognitiveservices.azure.com",
        credential=DefaultAzureCredential()
    )
    
    with open("image.jpg", "rb") as f:
        image_bytes = f.read()
    
    result = client.begin_image_embeddings(
        deployment_id="your-embed-v4-deployment",
        image=image_bytes
    ).result()
    
    print(result.embeddings)
    

    The same approach works with REST, C#, or JavaScript.

    1. Optional: Container-based deployment

    If you need more control, you can deploy the model as a container (Azure ML / ACI) and call it via endpoint. This uses the same inference pattern but gives you more flexibility in hosting.

    You do not need to move away from Azure. The only change required is to move from the older Azure Inference/OpenAI SDK to the new Azure AI Inference SDK or REST API, which supports image embeddings.

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

    Thankyou!

    Was this answer helpful?

    0 comments No comments

  3. Do, Nam 20 Reputation points
    2026-06-04T04:44:20.9133333+00:00

    Hi @Jerald Felix

    Thanks for the response. I gave this a check, the first option doesn't work as it raises the error: "An expected StartArray node was found when reading from JSON reader. A 'PrimitiveValue' node was expected."

    I assume this is a conflict in the payload of cohere SDK and azure endpoint.

    The second options works with route /images/embeddings but since the SDK is removed, would Microsoft removes the route for this as well?

    Was this answer helpful?

    0 comments No comments

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.