Skip to main content
  1. Public practice questions
  2. AZ-104 Practice Exams | Azure Administrator Associate
  3. AZ-104 Case Study Set

Question 13 — AZ-104 Case Study Set

Review the AI client configuration used by Paideffort.

from azure.identity import DefaultAzureCredential, get_bearer_token_provider
from azure.ai.projects import AIProjectClient
from openai import OpenAI

credential = DefaultAzureCredential()

project_client = AIProjectClient(
    endpoint=FOUNDRY_PROJECT_ENDPOINT,
    credential=credential
)

token_provider = get_bearer_token_provider(
    credential,
    "https://ai.azure.com/.default"
)

openai_client = OpenAI(
    base_url=FOUNDRY_PROJECT_ENDPOINT,
    api_key=token_provider
)

embedding = openai_client.embeddings.create(
    model=EMBEDDING_DEPLOYMENT,
    input=query_text
)

Given Paideffort's stated endpoint architecture, which two conclusions correctly identify what should be retained and what should be changed? (Select two answers)

  1. Retain the Foundry project endpoint for AIProjectClient because Paideffort uses that client for Foundry project and agent capabilities.

  2. Change the OpenAI client's base URL to Paideffort's Azure OpenAI endpoint before issuing the embedding request.

  3. Change AIProjectClient to use the Azure OpenAI endpoint because all Foundry project operations must use the model endpoint.

  4. Retain the Foundry project endpoint as the OpenAI embedding base URL because a single project endpoint routes every supported model operation.

Correct answers

  1. Retain the Foundry project endpoint for AIProjectClient because Paideffort uses that client for Foundry project and agent capabilities.

  2. Change the OpenAI client's base URL to Paideffort's Azure OpenAI endpoint before issuing the embedding request.

Explanations

Correct Answer:

Retain the Foundry project endpoint for AIProjectClient because Paideffort uses that client for Foundry project and agent capabilities.

Change the OpenAI client's base URL to Paideffort's Azure OpenAI endpoint before issuing the embedding request.

Explanation:

Paideffort's architecture separates Foundry project operations from direct OpenAI-compatible model operations. The AIProjectClient is therefore aligned with the Foundry project endpoint. The embedding request is not: Microsoft documents the OpenAI SDK with the Azure OpenAI /openai/v1 endpoint for embeddings and notes that the Foundry project endpoint does not currently route embedding requests. The Entra token-provider approach can remain in place while the OpenAI base URL is corrected.

Wrong Answers:

Change AIProjectClient to use the Azure OpenAI endpoint because all Foundry project operations must use the model endpoint.

Paideffort uses AIProjectClient for Foundry project capabilities, so replacing its project endpoint with the Azure OpenAI endpoint would reverse the intended endpoint responsibilities.

Retain the Foundry project endpoint as the OpenAI embedding base URL because a single project endpoint routes every supported model operation.

The Paideffort code attempts an embedding request through that URL, but embeddings require the OpenAI-compatible Azure OpenAI endpoint in this architecture. The project endpoint is retained for Foundry-specific project capabilities rather than used as a universal endpoint.