Foundry Setup & Deployments
Foundry resource and projects · topology · RBAC · deployment types · model and agent deployments · CI/CD
By the tools4free.dev team · Last reviewed November 13, 2026
Practice questions for this topic →
Resource hierarchy and topology
| Piece | Azure type | Role |
|---|---|---|
| Foundry resource | Microsoft.CognitiveServices/accounts, kind AIServices | Top-level resource: networking, security, model deployments |
| Foundry project | Microsoft.CognitiveServices/accounts/projects (subresource) | Development boundary: agents, evaluations, files. Shares network security, deployments and tool integration with the parent |
| Connected resources | Storage, Key Vault, Azure AI Search | Independent Azure resources with their own governance boundaries; manage their networking and access separately |
| Decision | Setup | Main trade-off |
|---|---|---|
| Co-located workloads, experimentation | One Foundry resource, one project per use case | Shared blast radius: production incidents, quota exhaustion, misconfiguration |
| Production workload with strict containment, access control and quota or cost boundaries | One Foundry resource per production workload boundary | More resources to manage; self-serve is harder |
- Production: treat isolation as the default; colocate only as a deliberate exception.
- Some capabilities, including OpenAI batch and fine-tuning, work at the Foundry resource scope. Don't assume separate projects isolate their files. If each team needs independent fine-tuning, use separate Foundry resources. Content Understanding and Translator also don't give project-level RBAC isolation.
- A resource's first default project is more capable: OpenAI Batch, fine-tuning and stored completions work only there; other projects support Responses, Files and Conversations in the OpenAI API.
- Networking for outbound isolation: managed VNet (simpler, fewer options) or customer-managed VNet (your subnet delegated to
Microsoft.App/environments, more control). Foundry doesn't support automatic cross-region failover: deploy separate resources per region and route in your app. - Customer-managed keys need Key Vault in the same region as the Foundry resource, soft delete and purge protection enabled, and managed identities with key permissions (for example Key Vault Crypto User).
Create the resource and grant access
- Create (or reuse) a resource group.
az cognitiveservices account createwith--kind AIServices --sku S0 --custom-domain <name> --assign-identity --allow-project-management true.az cognitiveservices account project createwith--name(resource),--project-nameand--location.- Verify both with
show --query properties.provisioningState; the output should beSucceeded.
--assign-identitycreates the managed identity that project management requires; without it project creation fails.--allow-project-managementcan't be changed after the resource exists.--custom-domainmust be globally unique (CustomDomainInUseotherwise).- The portal creates the Foundry resource automatically when you create a project. Use the Azure portal or templates when your Azure Policy needs custom names, security controls or cost tags.
- Control plane actions (create deployments, projects) are separate from data plane actions (build agents, run evaluations, upload files). Owner or Contributor isn't enough to develop: a user can manage resources yet need a data plane role to chat with an agent.
- Project agent storage defaults set on the account are inherited by projects; changing account defaults later doesn't update existing projects.
| Role | Use it for |
|---|---|
| Foundry User | Least-privilege role for developers building and testing agents (data actions, reader access, interact with agent endpoints) |
| Foundry Project Manager | Manage and build in projects, assign the Foundry User role, publish agents |
| Foundry Account Owner | Manage projects and resources (manage models); assign Foundry User, ACR and monitoring roles; doesn't build in projects |
| Foundry Owner | Full access to manage and build; assign Foundry User, ACR and monitoring roles |
| Foundry Agent Consumer | Only interact with agent endpoints |
These roles were previously named Azure AI User, Azure AI Owner, Azure AI Account Owner and Azure AI Project Manager. Role IDs and core permissions are unchanged.
Deployment types for models
| Type | SKU code | Processing | Billing | Best for |
|---|---|---|---|---|
| Global Standard | GlobalStandard | Any Azure region | Pay-per-token | Default: newest models, lowest price, broadest regions |
| Global Provisioned | GlobalProvisionedManaged | Any Azure region | Reserved PTU | Predictable high throughput |
| Global Batch | GlobalBatch | Any Azure region | 50% discount, 24-hour target | Large async jobs |
| Data Zone Standard | DataZoneStandard | Within the Microsoft-specified data zone | Pay-per-token | Data zone compliance |
| Data Zone Provisioned | DataZoneProvisionedManaged | Within data zone | Reserved PTU | Data zone plus throughput |
| Data Zone Batch | DataZoneBatch | Within data zone | 50% discount | Async jobs in a data zone |
| Standard | Standard | Within Azure geography | Pay-per-token | Geography compliance, low volume |
| Regional Provisioned | ProvisionedManaged | Within Azure geography | Reserved PTU | Geography compliance plus throughput |
| Developer | DeveloperTier | Any Azure region | Pay-per-token | Fine-tuned model evaluation only: 24-hour lifetime, no SLA |
- Start with Global Standard; move only for data residency, reserved throughput or asynchronous batch. Not every model supports every type.
- Provisioned types give guaranteed throughput and lower latency variance; standard types are best-effort. Data stored at rest stays in the designated geography; only inference processing differs by type.
- PTU billing is hourly on deployed PTUs, not tokens, even when idle. Provisioned deployments can't be paused; billing stops only when the deployment is deleted. PTU quota is shared across supported models in a region and deployment type.
- These types apply to the serverless API option. Models on managed compute (for example Hugging Face models) bill by virtual machine core hours, need VM quota and need a hub-based project in the Foundry portal (classic).
- Instant access (preview) calls supported models by name with no deployment.
Configure model and agent deployments
- List models and SKUs:
az cognitiveservices account list-models. Note name, format, version and SKU. - Create the deployment:
az cognitiveservices account deployment createwith--deployment-name,--model-name,--model-version,--model-format,--sku-capacityand--sku-name. - Verify:
az cognitiveservices account deployment show;provisioningStateshould beSucceeded.
- Creating deployments needs the Cognitive Services Contributor role or equivalent on the Foundry resource. Partner and community models also need Azure Marketplace permissions; the subscription Owner and Contributor roles include them.
- You can deploy the same model more than once under different deployment names, for example to test different content filters.
- Agent types: prompt-based, voice-based prompt and hosted. A hosted agent is a container image in Azure Container Registry; Agent Service assigns it a dedicated Microsoft Entra agent identity and a dedicated endpoint.
- Agent versions are immutable once saved. In code you refer to
<agent_name>:<version>; the name can't change after you create it. Create once and reuse the ID; treat a 404 as terminal (the agent was deleted). - Publishing (legacy agent applications article) creates an Agent Application with its own URL, authentication policy and unique Entra agent identity. Permissions don't transfer: reassign RBAC to the new agent identity or tool calls fail. Publishing needs Foundry Project Manager on the resource; invoking needs Foundry User on the application (Foundry Agent Consumer doesn't grant invoke).
- Basic agent setup keeps threads, messages and files in Microsoft-managed multitenant storage. Standard setup brings your own Azure resources (Storage, Cosmos DB, AI Search) and isolates data by project. Cosmos DB for NoSQL must offer at least 3000 RU/s; 3 to 5 containers of 1000 RU/s each are provisioned. Foundry account, project and Azure OpenAI resource must be in the same region.
CI/CD for Foundry projects
- Define prompt agents with the SDK or REST API (or keep them in source control with
azd) so changes go through code review and pipelines. Provision infrastructure as code (Bicep or Terraform) and standardize pipelines for projects, connections, model deployments and configuration; plan rollback. - The hosted agent quickstart pipeline uses GitHub Actions with azd: it deploys the updated agent code, shows the hosted agent status and sends a smoke-test message. It signs in with GitHub OIDC (a federated credential), not a stored secret, and deploys to existing infrastructure: run
azd provisionandazd deployfirst. - For code deployment, grant the workflow identity Foundry User and Contributor on the target Foundry project; container deployment needs more Azure RBAC for the registry. Keep non-secret settings (subscription ID, tenant ID, client ID, project endpoint, model deployment name) as GitHub Actions variables.
- The agent evaluation GitHub Action runs offline evaluation in the pipeline: give it
azure-ai-project-endpoint,deployment-name,data-pathandagent-ids(agent-name:version, comma-separated; optionalbaseline-agent-id). Use any evaluator from the Foundry catalog. Items marked preview on that page are preview.
CLI and PowerShell
| Task | Azure CLI | PowerShell |
|---|---|---|
| Create the Foundry resource | az cognitiveservices account create --name my-foundry-resource --resource-group my-foundry-rg --kind AIServices --sku S0 --location eastus --custom-domain my-foundry-resource --assign-identity --allow-project-management true | - |
| Create a project | az cognitiveservices account project create --name my-foundry-resource --resource-group my-foundry-rg --project-name my-foundry-project --location eastus | - |
| List models and SKUs available to the resource | az cognitiveservices account list-models -n $accountName -g $resourceGroupName | - |
| Create a model deployment | az cognitiveservices account deployment create -n $accountName -g $resourceGroupName --deployment-name Phi-4-mini-instruct --model-name Phi-4-mini-instruct --model-version 1 --model-format Microsoft --sku-capacity 1 --sku-name GlobalStandard | - |
| Check a deployment's state | az cognitiveservices account deployment show --deployment-name Phi-4-mini-instruct -n $accountName -g $resourceGroupName | - |
Exam Tips
Tick each tip once you can answer it without looking.
“Several teams need isolated work areas with shared model deployments” → One Foundry resource with a project per team or use case. Trap: Projects share network security and deployments with the parent; some capabilities work at resource scope only.
“Production workload needs independent access, quota and cost boundaries” → One Foundry resource per production workload boundary. Trap: Co-location shares the blast radius: incidents, quota exhaustion, misconfiguration.
“Each team needs independent fine-tuning or file isolation” → Separate Foundry resources. Trap: Fine-tuning and batch files are resource-scoped; separate projects don't isolate them.
“CLI project creation fails: managed identity must be enabled” → Create the resource with --assign-identity. Trap: --allow-project-management can't be changed after creation, so pass it when you create the resource.
“Developer manages resources but can't chat with an agent” → Add a data plane role such as Foundry User. Trap: Owner or Contributor are management roles and aren't sufficient for all development.
“Least-privilege role to build and test agents” → Foundry User. Trap: Foundry Agent Consumer only interacts with agent endpoints.
“Role that publishes agents and can assign Foundry User” → Foundry Project Manager on the Foundry resource. Trap: Foundry User can't publish; Foundry Account Owner is for managing projects and resources.
“Default deployment type for most workloads” → Global Standard (GlobalStandard). Trap: Move off it only for data residency, reserved throughput or batch.
“Keep inference inside the EU or US with pay-per-token” → Data Zone Standard (DataZoneStandard). Trap: Standard keeps processing in an Azure geography; Global types can process in any region.
“Guaranteed throughput and low latency variance” → A provisioned type (PTU), such as Global Provisioned. Trap: PTUs bill hourly even when idle and can't be paused; only deleting the deployment stops billing.
“Big asynchronous job, results within 24 hours, lowest cost” → Global Batch or Data Zone Batch (50% less). Trap: Developer is only for evaluating fine-tuned models: 24-hour lifetime, no SLA.
“Deploy a partner or community model” → Needs Azure Marketplace permissions (subscription Owner or Contributor include them). Trap: Models sold by Azure don't have this requirement.
“Published agent's tool calls now fail with authorization errors” → Reassign RBAC to the new agent identity. Trap: Publishing creates a unique agent identity, and permissions don't transfer automatically.
“Referring to a specific agent version in code” → <agent_name>:<version>; versions are immutable. Trap: Edits create a new version; a 404 on a stored ID means the agent was deleted, so recreate it.
“GitHub Actions pipeline to deploy a hosted agent” → OIDC sign-in, then azd deploy; assign Foundry User and Contributor on the project. Trap: The template deploys to existing infrastructure; provision first with azd provision.
“Run offline agent evaluation before release in CI/CD” → The agent evaluation GitHub Action with a dataset and agent-ids. Trap: Preview items on that page are preview; use agent-name:version for each agent ID.
Sources
- Microsoft Foundry architecture
- Microsoft Foundry rollout across my organization
- Create a project
- Role-based access control for Microsoft Foundry
- Understanding deployment types in Microsoft Foundry Models
- Microsoft Foundry Models overview
- Provisioned throughput billing and cost management
- Deploy models using Azure CLI and Bicep
- Agent development lifecycle in Microsoft Foundry
- Hosted agents in Foundry Agent Service
- Agent applications in Microsoft Foundry
- Use your own resources in the Foundry Agent Service
- Set up CI/CD for a hosted agent
- How to run an evaluation in GitHub Action
- What is Microsoft Foundry Agent Service?
Checked against Microsoft Learn on November 13, 2026.