Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

2.1. Connecting to Foundry and Generating Completions

💡 First Principle: Every generative call starts the same way — authenticate to a project endpoint, name a deployment (not a model), send messages, read the response. Master this skeleton and every fancier capability (tools, agents, streaming) is a variation on it, not a new thing to memorize.

A surprising number of exam mistakes happen before any AI reasoning occurs: choosing the wrong client, hard-coding a key where a managed identity belongs, or confusing the model name with the deployment name. Getting the connection skeleton right is the foundation the whole domain rests on. The Foundry SDK gives you a project client; from it you obtain an authenticated model client and issue chat completions against a deployment you created in the planning phase.

The mental model is a phone call: the project endpoint is the phone number, credentials are how the network verifies you're allowed to call, the deployment name is the specific extension you're dialing, and messages are the conversation. You don't dial a person's name ("gpt-4o") — you dial the extension you set up ("my-gpt4o-deployment").

⚠️ Common Misconception: "I pass the model name like gpt-4o to the API." You pass the deployment name you chose when you deployed that model into the project. The same base model can back several deployments with different versions and quotas, so the API needs the deployment, not the model family.

Alvin Varughese
Written byAlvin Varughese
Founder18 professional certifications