Identity and Access in Foundry
This lesson explains the Foundry built-in roles, the scopes they are assigned at, how managed identities are used, and how keyless authentication replaces API keys.
Learning outcomes
After completing this lesson, you will be able to:
- Compare the Foundry built-in roles.
- Choose a scope for role assignments.
- Describe how managed identities reach connected services.
- Explain how to disable local authentication.
Foundry built-in roles
Foundry has built-in roles designed for its two-level model. They separate building with Foundry, which needs data actions such as calling models and creating agents, from managing it, which needs control-plane actions such as creating deployments and projects.
| Role | Can | Typical holder |
|---|---|---|
| Foundry User | Build and use agents, evaluations and models in a project (data actions) | Developers and data scientists |
| Foundry Project Manager | Everything Foundry User can, plus manage the project and assign the Foundry User role | Team leads |
| Foundry Account Owner | Manage the resource, its deployments and projects, without data access | Platform administrators |
| Foundry Owner | Full management and data access | Small teams or break-glass accounts |
Microsoft advises against using the older Cognitive Services roles for Foundry access, apart from narrow cases such as Cognitive Services Usages Reader for quota visibility. A Foundry Agent Consumer role also exists for callers that only need to invoke published agent endpoints.
Scopes
Roles can be assigned at the subscription, resource group, Foundry resource or project scope. Assigning Foundry User on a project lets a developer work in that project only, so the three product teams in a shared resource cannot see each other's agents or evaluations. Assigning it on the resource grants access to every project under it.
Platform administrators often hold Foundry Account Owner on the resource, so that they can create deployments and projects and manage networking without being able to read project data, while each team's lead holds Foundry Project Manager on their project and grants access to team members without involving the platform team.
Managed identities
The Foundry resource and each project can have a system-assigned or user-assigned managed identity. The resource must have one before projects can be created. These identities act when Foundry itself calls other services: a project's identity reading an Azure AI Search index for an agent, writing files to the project's storage, or running continuous evaluation, which needs the Foundry User role on the project.
| Caller | Target | Role on the target |
|---|---|---|
| Project identity | Azure AI Search index used by agents | Search Index Data Reader (and Search Service Contributor if it creates indexes) |
| Project identity | Storage for files and datasets | Storage Blob Data Contributor |
| Azure AI Search identity | Embedding deployment used by an indexer or vectorizer | Cognitive Services OpenAI User |
| Application's managed identity | Model deployments and agents in the project | Foundry User, or a narrower role |
| Project identity | The project, for continuous evaluation | Foundry User |
Keyless authentication
Applications should call Foundry with Microsoft Entra ID tokens rather than API keys. In Python, DefaultAzureCredential provides the token, from the developer's sign-in locally and from the application's managed identity in Azure, and access is granted with a role assignment that can be audited and revoked per application.
from azure.identity import DefaultAzureCredential
from azure.ai.projects import AIProjectClient
project = AIProjectClient(
endpoint="https://contoso-ai-prod.services.ai.azure.com/api/projects/support",
credential=DefaultAzureCredential(),
)
openai = project.get_openai_client()
reply = openai.responses.create(model="chat", input="Summarize our refund policy.")
print(reply.output_text)Once every caller uses Microsoft Entra ID, local authentication can be disabled on the resource by setting disableLocalAuth to true. Keys then stop working entirely, which removes a whole class of leaked-credential incidents. Azure Policy can require the setting across subscriptions.
az resource update --ids $(az cognitiveservices account show -n contoso-ai-prod -g rg-ai-prod --query id -o tsv) \
--set properties.disableLocalAuth=trueLeast privilege for teams and platform
A shared development Foundry resource hosts projects for the support and marketing teams. Each team must manage its own members, developers must not see the other team's agents, and the platform team must create deployments and manage networking without reading any project's data. An application in Azure Container Apps calls the support project's agents.
Assign the platform team Foundry Account Owner on the resource. Assign each team lead Foundry Project Manager on their own project, so they can grant Foundry User on that project to their developers. Give the container app a managed identity with Foundry User on the support project, and disable local authentication so that no API key is needed or accepted.
Foundry Owner for the platform team would include data access. Foundry User on the resource would let developers see both projects. Storing an API key in the container app's secrets works but leaves a shared secret that local authentication could otherwise eliminate.
A platform engineer must manage a Foundry resource's networking and deployments but must not use projects' data. Which role fits?
Show answer
Foundry Account Owner, which manages the resource without data access. Foundry Owner adds data access, and Foundry User builds in projects without managing the resource.
Exam Tips
Remember for the exam
- Foundry User builds in a project; Foundry Project Manager also manages project access.
- Foundry Account Owner manages the resource without data access; Foundry Owner has both.
- Assign roles at project scope to isolate teams in a shared resource.
- Use managed identities and DefaultAzureCredential; disable local authentication with disableLocalAuth.