BrainyBeeBrainyBee
ExploreBlogStart Studying
HomeDeveloping AI Apps and Agents on Azure (AI-103)Configure an application to connect to a Foundry project
Lesson2,523 words

Configure an application to connect to a Foundry project

AI-103 › Unit 2: Implement generative AI and agentic solutions › Build generative applications by using Foundry › Configure an application to connect to a Foundry project

Configure an application to connect to a Foundry project

Connecting an application to a project is four things that must all be right: the correct resource kind, the correct endpoint shape, a credential the platform accepts, and a role assignment that actually grants what the code needs. When a connection fails, the error rarely names which of the four is wrong — so knowing the failure signatures is the practical skill.

Why This Matters

The resource kind decides what exists. An Azure OpenAI resource serves only /openai/v1. No project endpoint, no Agent Service. A scenario built on an existing Azure OpenAI resource that then asks for agents is testing this.

The endpoint shape is memorisable and asked directly. Project endpoints have one form, and the custom subdomain occupies a specific slot in it.

Working authentication is not sufficient authentication. A key connects and grants full access without role restrictions. Entra connects and grants exactly what a role assignment says — including nothing, if the assignment is missing.

One RBAC behaviour is genuinely counterintuitive. The automatic Foundry User assignment happens only through the portal UI. Create a project with the SDK or CLI and nobody is enrolled.

Endpoint and roles, verbatim

https://<resource-name>.services.ai.azure.com/api/projects/<project-name> — the custom subdomain replaces <resource-name>. Roles are Foundry User, Foundry Owner, Foundry Account Owner, Foundry Project Manager, Foundry Agent Consumer — renamed from the Azure AI equivalents with role IDs unchanged. Do not use Cognitive Services * roles.

Prerequisites

  • The difference between a Foundry resource, a project, and a deployment.
  • What a custom subdomain is on an Azure resource.
  • DefaultAzureCredential and its credential chain.
  • That RBAC assignments are scoped, and scope narrows what a role grants.

Learning Objectives

By the end of this lesson you will be able to:

  1. Choose the right resource kind for a stated requirement.
  2. Construct a project endpoint correctly, including the custom subdomain.
  3. Authenticate with Entra and explain why keys fail governance requirements.
  4. Assign the correct Foundry role at the correct scope.
  5. Diagnose a failed connection from its symptom.

Building Blocks

Resource kinds. A Foundry resource hosts projects, the Agent Service, connections, and the full tool surface. An Azure OpenAI resource serves only /openai/v1 — model inference and nothing else.

The project endpoint.

https://<resource-name>.services.ai.azure.com/api/projects/<project-name>

The custom subdomain replaces <resource-name>. That subdomain is not decorative: token-based authentication requires it, which is why a resource created without one can authenticate by key and fail with Entra.

The roles.

RoleGrantsRole ID
Foundry UserRead access to the account and projects53ca6127-db72-4b80-b1b0-d745d6d5456d
Foundry OwnerFull control of the accountc883944f-8b7b-4483-af10-35834be79c4a
Foundry Account OwnerAccount-level ownershipe47c6f54-e4a2-4754-9501-8e0985b135e1
Foundry Project ManagerManage projectseadc314b-1a2d-4efa-be10-5d325db5065e
Foundry Agent ConsumerUse agentseed3b665-ab3a-47b6-8f48-c9382fb1dad6

These were renamed from Azure AI User, Owner, Account Owner, and Project Manager. Role IDs are unchanged, so existing assignments by ID keep working — and a distractor naming a Cognitive Services * role or Azure AI Developer is wrong.

Scope. Assignments apply at resource, project, or agent scope, with agent scope evaluated only for endpoint access. Two agents in one project can therefore differ in who may call them.

The portal-only automatic assignment. Automatic Foundry User assignment happens only via the portal UI. Projects created through the SDK or CLI do not get it, so users must be assigned explicitly.

Keys. Keys grant full access without role restrictions — no scoping, no per-agent permission, no auditable identity.

Key against Entra

Attribute
Granularity

None — full access

Role and scope

Identity in logs

The key

The principal

Rotation

Manual, breaks callers

Platform-managed

Needs a custom subdomain

No

Yes for token auth

Fits

Local development

Production

Deep Dive

The resource kind, first

The cheapest mistake to avoid is building on the wrong resource.

An Azure OpenAI resource exposes only /openai/v1. It runs model inference well and has no project endpoint, no Agent Service, no connections, and no built-in tool surface. A Foundry resource has all of it.

The examinable version is a scenario that opens "the team already has an Azure OpenAI resource" and then requires agents, a project endpoint, or connected tools. The answer is not a configuration change on that resource — those capabilities do not exist on it. The correct move is a Foundry resource with a project.

Endpoint, subdomain, and the token-auth dependency

The project endpoint is https://<resource-name>.services.ai.azure.com/api/projects/<project-name>, and the custom subdomain replaces <resource-name>.

The subdomain has a functional role beyond naming: token-based authentication requires it. That produces a diagnostic signature worth memorising — a resource without a custom subdomain works with a key and fails with Entra. A team that develops with a key and switches to managed identity for production hits this precisely at the environment boundary, and the failure looks like an authentication bug rather than a resource-configuration one.

The second shape to keep separate is the model endpoint. Model inference on an Azure OpenAI resource lives under /openai/v1; the project endpoint carries /api/projects/<project-name>. Mixing them produces 404s that look like a missing deployment.

Connecting, in order

  1. 1

    Confirm the resource kind

    Projects, agents, and connections require a Foundry resource. Azure OpenAI serves only /openai/v1.

The RBAC behaviour that catches people

The automatic Foundry User assignment fires only through the portal UI.

Provision a project in the portal and the creator is enrolled. Provision the identical project with the SDK, the CLI, or infrastructure-as-code — the normal path for anything reproducible — and nobody is assigned. Authentication then succeeds and every call returns a permission error, which reads as a broken credential rather than a missing assignment.

The rule to carry: automated provisioning must assign roles explicitly. In a question, "the project was created via the CLI" or "deployed through a pipeline" alongside a permission failure is naming its own answer.

The second RBAC point is naming. The roles were renamed from Azure AI User, Owner, Account Owner, and Project Manager to Foundry equivalents, with role IDs unchanged — so assignments made by ID are unaffected, and any answer offering Cognitive Services User, Cognitive Services Contributor, or Azure AI Developer for project access is wrong.

Scope, and least privilege that means something

Three scopes exist: resource, project, and agent — with agent scope evaluated only for endpoint access.

That granularity is what makes least privilege expressible. A reporting application that must call one agent gets Foundry Agent Consumer at agent scope on that agent; it cannot reach the others. A platform team managing projects gets Foundry Project Manager at resource scope. A developer needing to read gets Foundry User.

Contrast a key, which grants full access without role restrictions. Any requirement mentioning least privilege, per-application permissions, auditable identity, or credential rotation eliminates key authentication outright — and keys remain the default in samples and local development, which is exactly how they reach production.

Diagnosing a failed connection

Each failure has a signature.

Works with a key, fails with Entra → no custom subdomain, or a missing role assignment. Check the subdomain first: token auth requires it.

Authenticates, then every call is forbidden → the credential is fine and the role assignment is missing. Suspect portal-only automatic assignment if the project was created by SDK, CLI, or pipeline.

404 on a project path → wrong endpoint shape, or an Azure OpenAI resource that has no project endpoint at all.

Works for one agent and not another → an assignment made at agent scope rather than project scope.

"The key works" proves nothing about authorisation

A key bypasses roles entirely, so a successful key-based call tells you the endpoint and resource are correct and nothing about whether the production identity is authorised. Validating with a key and deploying with a managed identity moves both the subdomain requirement and the role assignment requirement into production, undiscovered.

Worked Examples

Example 1 — an existing Azure OpenAI resource, now needing agents. A team has an Azure OpenAI resource in production and wants agents with File Search and an MCP tool.

An Azure OpenAI resource serves only /openai/v1 — it has no project endpoint and no Agent Service, so no configuration change adds them. Create a Foundry resource and a project. The existing deployments can keep serving inference during migration.

Example 2 — pipeline-provisioned project, permission errors everywhere. A project is created by an infrastructure pipeline. The application authenticates with its managed identity and every call returns forbidden.

Automatic Foundry User assignment happens only via the portal UI, so an SDK, CLI, or pipeline-created project enrols nobody. Assign explicitly — Foundry User to read, Foundry Agent Consumer to invoke agents — at the appropriate resource, project, or agent scope.

Example 3 — works locally, fails in production. Local development uses a key and succeeds. Production uses a managed identity and fails to authenticate.

Token-based authentication requires the custom subdomain, which the key path does not. Confirm the resource has one and that the endpoint uses it in the <resource-name> slot; then confirm a role assignment exists for the managed identity. The key masked both requirements.

Visual Explanations

The four things that must be right:

Loading Diagram...
Figure 1 — Mermaid diagram

Failure signatures:

Loading Diagram...
Figure 2 — Mermaid diagram

Common Mistakes

Trying to add agents to an Azure OpenAI resource. It serves only /openai/v1.

Omitting the custom subdomain. Token authentication requires it.

Confusing the model endpoint with the project endpoint.

Expecting SDK or CLI project creation to assign roles. Automatic assignment is portal-only.

Choosing a Cognitive Services * role or Azure AI Developer. The Foundry roles are the correct set.

Assuming a rename changed the role IDs. They are unchanged.

Validating with a key and deploying with a managed identity. The key masks both the subdomain and the role requirement.

Assigning at resource scope when agent scope was intended.

Practice Exercises

  1. Write the project endpoint template and say what the custom subdomain replaces.
  2. A pipeline-created project returns forbidden for every call by an authenticated identity. Diagnose it.
  3. Why does an application work with a key and fail with a managed identity?
  4. Name the five Foundry roles and what changed in the rename.
  5. Which scopes exist, and which is evaluated only for endpoint access?
▶Answers
  1. https://<resource-name>.services.ai.azure.com/api/projects/<project-name>. The custom subdomain replaces <resource-name>, and it is required for token-based authentication.
  2. Automatic Foundry User assignment occurs only through the portal UI, so a project created by SDK, CLI, or pipeline enrols nobody. Authentication succeeds while authorisation fails. Assign roles explicitly — Foundry User to read, Foundry Agent Consumer to invoke agents.
  3. Most often because the resource has no custom subdomain, which token authentication requires and key authentication does not; failing that, because no role assignment exists for the identity. Keys bypass roles entirely, so they hide both.
  4. Foundry User, Foundry Owner, Foundry Account Owner, Foundry Project Manager, Foundry Agent Consumer — renamed from the Azure AI equivalents with role IDs unchanged, so existing assignments by ID keep working.
  5. Resource, project, and agent. Agent scope is evaluated only for endpoint access, which is what lets two agents in one project differ in who may call them.

Summary & Concept Map

Connecting an application is four aligned decisions. The resource kind decides what exists at all — an Azure OpenAI resource serves only /openai/v1, so projects and agents require a Foundry resource. The endpoint is https://<resource-name>.services.ai.azure.com/api/projects/<project-name>, where the custom subdomain fills the resource-name slot and is required for token authentication — the reason key-based development can hide a production failure. The credential should be Entra with a managed identity, because keys grant full access without role restrictions. And the role assignment must be explicit: Foundry User, Owner, Account Owner, Project Manager, and Agent Consumer — renamed with IDs unchanged — assigned at resource, project, or agent scope, and never assigned automatically outside the portal UI.

Loading Diagram...
Figure 3 — Mermaid diagram
Loading flashcards…

Sources and freshness

Written against current Microsoft Learn documentation for the AI-103 skills measured (16 April 2026), reviewed 2026-08-20. Microsoft Learn controls every changing product contract — availability, preview status, quotas, limits, regional support, naming, and retirement dates all move independently of this lesson. Where a scenario turns on a specific number or a GA/preview boundary, confirm it against the product's own page before relying on it.

All Developing AI Apps and Agents on Azure (AI-103) Study Resources

Related Notes

  • Choose an appropriate method for retrieval and indexing2,778 words
  • Quick Note — Choose an appropriate method for retrieval and indexing888 words
  • Choose an appropriate model for each task, including LLMs, small language models, multimodal models, and Foundry Tools3,097 words
  • Quick Note — Choose an appropriate model for each task, including LLMs, small language models, multimodal models, and Foundry Tools1,041 words
  • Choose appropriate memory, tool, and knowledge integration services for agent solutions2,815 words
  • Quick Note — Choose appropriate memory, tool, and knowledge integration services for agent solutions949 words
  • Choose the appropriate Foundry services for generative tasks, grounding, vector search, agent workflows, or multimodal processing2,733 words
  • Quick Note — Choose the appropriate Foundry services for generative tasks, grounding, vector search, agent workflows, or multimodal processing901 words
  • Apply responsible AI instrumentation, including evaluators, safety evaluations, and explanation tooling2,891 words
  • Configure safety filters, guardrails, risk detection, and content moderation2,795 words
  • Govern agent behavior with oversight modes, constraints, and tool-access controls2,863 words
  • Implement auditing through trace logging, provenance metadata, and approval workflows2,624 words

Ready to study Developing AI Apps and Agents on Azure (AI-103)?

Practice tests, flashcards, and all study notes — free, no sign-up.

Start Studying

Ready to study Developing AI Apps and Agents on Azure (AI-103)?

Practice tests, flashcards, and all study notes — free, no sign-up needed.

Start Studying — Free
Developing AI Apps and Agents on Azure (AI-103) ResourcesExplore All HivesBlogHome

© 2026 BrainyBee. Free AI-powered exam prep.

Loading Diagram...
Flowchart, top to bottom. Application connects to Resource kind. R connects to /openai/v1 ONLY<br/>no project, no agents/ (Azure OpenAI). R connects to Project endpoint (Foundry). EP connects to Custom subdomain in the resource-name slot<br/>REQUIRED for token auth. SD connects to Credential. CRED connects to FULL access, no role restrictions (Key). CRED connects to Role assignment required (Entra + managed identity). RBAC connects to Foundry User / Agent Consumer /<br/>Project Manager / Owner / Account Owner. 1 more statements.
Loading Diagram...
Flowchart, left to right. Key works, Entra fails connects to No custom subdomain<br/>or missing role. Authenticates then forbidden connects to Missing role -<br/>portal-only auto assignment. 404 on a project path connects to Wrong endpoint shape or<br/>Azure OpenAI resource. One agent works, another does not connects to Assignment at AGENT scope.
Loading Diagram...
Flowchart, top to bottom. Connect to a project connects to Resource kind. Connect to a project] --> K[Resource kind connects to Endpoint. Connect to a project] --> K[Resource kind connects to Credential. Connect to a project] --> K[Resource kind connects to Authorisation. K connects to Foundry: projects, agents, connections. K connects to Azure OpenAI: /openai/v1 ONLY. E connects to services.ai.azure.com/api/projects/name. E connects to Custom subdomain in the resource-name slot. 7 more statements.

Connecting to a project — retrieval

Card 1 of 6

Front of flashcard 1 of 6

The project endpoint

easy

https://<resource-name>.services.ai.azure.com/api/projects/<project-name> — the custom subdomain replaces <resource-name>, and that subdomain is required for token-based authentication.

endpoint

Connecting to a project — retrieval

Card 1

Front

The project endpoint

Back

https://<resource-name>.services.ai.azure.com/api/projects/<project-name> — the custom subdomain replaces <resource-name>, and that subdomain is required for token-based authentication.

Card 2

Front

Azure OpenAI resource limitation

Back

It serves only /openai/v1 — model inference. No project endpoint, no Agent Service, no connections. Projects and agents require a Foundry resource.

Card 3

Front

The portal-only assignment

Back

Automatic Foundry User assignment happens only via the portal UI. Projects created by SDK, CLI, or pipeline enrol nobody — authentication succeeds and every call is forbidden until roles are assigned explicitly.

Card 4

Front

The five Foundry roles

Back

Foundry User, Foundry Owner, Foundry Account Owner, Foundry Project Manager, Foundry Agent Consumer — renamed from the Azure AI equivalents with role IDs unchanged. Cognitive Services * roles and Azure AI Developer are wrong answers here.

Card 5

Front

Role scopes

Back

Resource, project, and agent. Agent scope is evaluated only for endpoint access, which lets two agents in one project differ in who may call them.

Card 6

Front

Works with a key, fails with Entra

Back

Usually a missing custom subdomain (token auth requires it, key auth does not), or a missing role assignment. Keys grant full access without role restrictions, so a successful key call proves nothing about authorisation.

Connecting to a project — retrieval

Card 1

Front

The project endpoint

Back

https://<resource-name>.services.ai.azure.com/api/projects/<project-name> — the custom subdomain replaces <resource-name>, and that subdomain is required for token-based authentication.

Card 2

Front

Azure OpenAI resource limitation

Back

It serves only /openai/v1 — model inference. No project endpoint, no Agent Service, no connections. Projects and agents require a Foundry resource.

Card 3

Front

The portal-only assignment

Back

Automatic Foundry User assignment happens only via the portal UI. Projects created by SDK, CLI, or pipeline enrol nobody — authentication succeeds and every call is forbidden until roles are assigned explicitly.

Card 4

Front

The five Foundry roles

Back

Foundry User, Foundry Owner, Foundry Account Owner, Foundry Project Manager, Foundry Agent Consumer — renamed from the Azure AI equivalents with role IDs unchanged. Cognitive Services * roles and Azure AI Developer are wrong answers here.

Card 5

Front

Role scopes

Back

Resource, project, and agent. Agent scope is evaluated only for endpoint access, which lets two agents in one project differ in who may call them.

Card 6

Front

Works with a key, fails with Entra

Back

Usually a missing custom subdomain (token auth requires it, key auth does not), or a missing role assignment. Keys grant full access without role restrictions, so a successful key call proves nothing about authorisation.