Share via

Azure AI Inference SDK - Deployment/resource not found with target URI

Phi Huynh 20 Reputation points
2026-05-07T09:06:17.34+00:00

Hello,

I have deployed an embedding model using Azure AI Inference SDK within my Kotlin SpringBoot project. I followed the example code provided using the Embeddingsclient for Java (which I changed to the specified Kotlin syntax, see https://learn.microsoft.com/en-us/java/api/overview/azure/ai-inference-readme?view=azure-java-preview ), but the endpoint which is given does not seem to exist. I get the error that the deployment cannot be found, but I already deployed the model several days ago. Here is a sample of my Kotlin code:

val input = ListOf("blabla")

val client : EmbeddingsClient = EmbeddingsClientBuilder()

.endpoint([PROJECT_NAME].services.ai.azure.com/models)

.credential([API_KEY])

.buildClient()

val result: EmbeddingsResult = client.embed(input)

However, when I look at the example codes of other syntaxes, I see that they insert the model name or deployment name as well. I followed the sample code for JavaScript, and my endpoint does get called:

response = client.embed(
    input=["first phrase","second phrase","third phrase"],
    model=model_name
)

Any solution how this works with Kotlin/Java? There is EmbeddingsOptions which I can use, but this is not recognised by my dependency:

implementation("com.azure:azure-ai-inference:1.0.0-beta.5")
Azure AI Custom Vision
Azure AI Custom Vision

An Azure artificial intelligence service and end-to-end platform for applying computer vision to specific domains.

0 comments No comments

Answer accepted by question author

Vinodh247-1375 42,941 Reputation points Volunteer Moderator
2026-05-09T02:05:50.2433333+00:00

Hi ,

Thanks for reaching out to Microsoft Q&A.

Your issue is straightforward: you are missing the model/deployment name in the request, and the Java/Kotlin SDK does not infer it from the endpoint. In the Azure AI Inference SDK, the endpoint alone is not enough. Unlike some other SDKs, the model (deployment) must be explicitly passed in the request options. That is why you get “deployment/resource not found”.

  • Your endpoint: https://<project>.services.ai.azure.com/models -> OK
  • But you are calling: client.embed(input) -> Missing model name
  • Result: SDK calls a default route -> deployment not resolved

You must pass the model/deployment name using options:

val client = EmbeddingsClientBuilder()
    .endpoint("https://<project>.services.ai.azure.com")
    .credential(AzureKeyCredential("<API_KEY>"))
    .buildClient()

val options = EmbeddingsOptions(listOf("blabla"))
options.model = "<your-deployment-name>"   // IMPORTANT

val result = client.embed(options)

  • Remove /models from endpoint -> use base endpoint only

<your-deployment-name> must exactly match what you deployed in Azure AI Foundry

  • EmbeddingsOptions exists only in newer SDK versions -> your version 1.0.0-beta.5 is outdated

Upgrade dependency:

implementation("com.azure:azure-ai-inference:1.0.0-beta.7") // or latest
  • Then use EmbeddingsOptions with model

This is not a deployment issue. It is a request construction issue:

Wrong endpoint format

Missing model name

Possibly outdated SDK

Fix these three and it will work.

Please 'Upvote'(Thumbs-up) and 'Accept' as answer if the reply was helpful. This will be benefitting other community members who face the same issue.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. SRILAKSHMI C 19,005 Reputation points Microsoft External Staff Moderator
    2026-05-13T08:40:30.0366667+00:00

    Hello @HUYNH Phi

    Thank you for the detailed information and code sample.

    From your description, the issue appears to be related to how the Azure AI Inference SDK for Java/Kotlin handles deployment/model names when calling the embeddings endpoint.

    Currently, your code is building the client with:

    .endpoint("https://[PROJECT_NAME].services.ai.azure.com/models")
    

    and then calling:

    client.embed(input)
    

    without explicitly specifying the deployment/model name.

    In Azure AI Inference SDK scenarios, the deployment name must typically be included either: • directly in the API call, or • through EmbeddingsOptions / deployment configuration.

    Otherwise, the service cannot resolve which deployment should process the embeddings request, which commonly results in errors such as: • deployment not found, • resource not found, or • 404 responses.

    A few important points to verify:

    1. Endpoint format

    The endpoint should generally be the base resource endpoint only, for example:

    https://<resource-name>.openai.azure.com
    

    or the Azure AI Foundry project endpoint provided in the deployment page.

    Including /models directly in the endpoint can sometimes cause incorrect routing depending on the SDK version.

    1. Deployment/model name must be specified

    Unlike some JavaScript/Python SDK examples, the Java/Kotlin SDK versions prior to newer beta releases do not always automatically infer the deployment name.

    Since you are currently using:

    implementation("com.azure:azure-ai-inference:1.0.0-beta.5")
    

    this version has limited support for EmbeddingsOptions and deployment configuration.

    This means you may need to either:

    • upgrade the SDK version, or • explicitly pass the deployment/model name in the request.

    1. SDK version limitation

    EmbeddingsOptions support was introduced in later SDK builds (beta.6+).

    With newer versions, the pattern becomes:

    val options = EmbeddingsOptions(listOf("blabla"))
        .setDeploymentName("<deployment-name>")
    

    or equivalent model/deployment configuration methods.

    1. Recommended checks

    Please verify the deployment exists and is healthy in Azure AI Foundry, the deployment name exactly matches the configured deployment (case-sensitive), the endpoint, deployment, and resource belong to the same region/project, and the deployment provisioning state is “Succeeded”.

    1. Suggested approach

    Recommended next steps would be:

    Upgrade to a newer SDK version (beta.6 or later), use the base endpoint instead of appending /models, and explicitly specify the deployment/model name in the embeddings request.

    Example structure:

    val client = EmbeddingsClientBuilder()
        .endpoint("https://<resource>.openai.azure.com")
        .credential(AzureKeyCredential("<key>"))
        .buildClient()
    

    then pass:

    "<deployment-name>"
    

    through the embeddings request/options.

    Please refer this

    Azure AI Model Inference REST API reference: https://learn.microsoft.com/rest/api/aifoundry/modelinference/?wt.mc_id=knowledgesearch_inproduct_azure-cxp-community-insider#inference-sdk-support

    Java SDK reference for Azure AI Inference: https://aka.ms/azsdk/azure-ai-inference/java/reference

    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.

    Thank you!

    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.