# Microsoft Foundry: Resources, Projects and Model Deployments

**Microsoft Foundry · Part 3**

In the previous articles, we explored Microsoft Foundry and its capabilities. Today, let us build our first Foundry environment. But before creating anything, let us understand what we are actually creating.

## 1\. Understanding the architecture

![Inside an Azure resource group, the Foundry resource contains a project and a model deployment. The project provides an endpoint and can send agent traces to Application Insights.](https://cdn.hashnode.com/uploads/covers/6b004c3a823e7883755c4a91/6309b4bc-6d88-4d50-9d67-53b591ccae8f.png align="center")

*Figure 1. Microsoft Foundry resource architecture. Application Insights is shown in the same resource group for this example.*

Every component has a purpose.

| Component | Purpose |
| --- | --- |
| Azure Subscription | Who owns and pays for the resources? |
| Resource Group | Where do we organise our resources? |
| Foundry Resource | Where do we manage our AI infrastructure? |
| Foundry Project | Where do we develop our AI solutions? |
| Model Deployment | Which AI model can we use? |
| Managed Identity | How do services authenticate securely? |
| Project Endpoint | How does our application connect? |
| Application Insights | How do we observe agent behaviour? |

Understanding these components makes the implementation much easier.

## 2\. Why do we need both a resource and a project?

This is an important distinction. **A Foundry resource manages the infrastructure. A Foundry project organises the development work.** Imagine an organisation building three different AI assistants.

![Three projects for document, policy and reporting assistants send model requests to one shared gpt-5-mini deployment.](https://cdn.hashnode.com/uploads/covers/6b004c3a823e7883755c4a91/d88cc2c3-adcc-4b0f-a429-aa07f324fadf.png align="center")

*Figure 2. Each team can organise its work in a separate project and reuse one deployment.*

Instead of creating an entirely new Foundry resource for every application, we can create multiple projects within a resource and reuse model deployments. However, when stronger security or infrastructure isolation is required, separate Foundry resources may be more appropriate.

## 3\. Let us build our first Foundry environment

![Six numbered Azure CLI steps show the resource group, its Foundry resource, the project and model deployment, and the endpoint provided by the project.](https://cdn.hashnode.com/uploads/covers/6b004c3a823e7883755c4a91/270bd2ae-2ab2-451d-b151-e5165bf095ca.png align="center")

*Figure 3. From signing in to Azure to retrieving the address your application will use.*

You will need an active Azure subscription, Azure CLI version 2.80.0 or later and permission to create a resource group in the subscription. Run the examples in order in the same Bash session.

**Permissions.** Contributor on an existing resource group is enough to create the Foundry resource and project. Granting a teammate access requires role-assignment permission at the relevant scope.

### Step 1 - Sign in to Azure

```bash
az version
az login
az account show
```

### Step 2 - Create a resource group

Check that `az account show` displayed the subscription you want to use. Set the names once so every command uses the same resources. The timestamp and random suffix help give your Foundry resource a globally unique name.

```bash
foundry_name="foundry-$(date -u +%Y%m%d%H%M%S)-${RANDOM}"
group_name="rg-${foundry_name}"
az group create --location eastus --name "$group_name"
```

This gives us a logical container for our resources.

### Step 3 - Create the Foundry resource

```bash
az cognitiveservices account create \
  --resource-group "$group_name" \
  --name "$foundry_name" \
  --location eastus \
  --kind AIServices \
  --sku S0 \
  --custom-domain "$foundry_name" \
  --assign-identity \
  --allow-project-management true
```

Three parameters deserve particular attention.

| Parameter | Why it matters |
| --- | --- |
| `--kind AIServices` | Creates the appropriate AI resource type. |
| `--assign-identity` | Enables the identity required for project management. |
| `--allow-project-management true` | Allows projects to be created within the resource. |

The custom domain must be globally unique. Enable project management when creating the resource because this setting is fixed at creation.

### Step 4 - Create a Foundry project

```bash
az cognitiveservices account project create \
  --name "$foundry_name" \
  --resource-group "$group_name" \
  --project-name document-assistant \
  --location eastus
```

We now have an environment in which we can develop our AI solution.

### Step 5 - Deploy a model

A model in the catalog and a model deployment are not the same thing. The model is the AI capability. The deployment makes that capability accessible to our applications.

First, check which versions and deployment types Azure lists for `gpt-5-mini` in West Europe.

```bash
az cognitiveservices model list \
  --location eastus \
  --query "[?model.name=='gpt-5-mini'].{version:model.version,skus:join(',',model.skus[].name)}" \
  --output table
```

The quickstart uses version `2025-08-07` with the `GlobalStandard` deployment type. Use that combination if the table lists it and your subscription has sufficient quota. Otherwise, select a supported version and deployment type, or choose another available model.

```bash
az cognitiveservices account deployment create \
  --name "$foundry_name" \
  --resource-group "$group_name" \
  --deployment-name gpt-5-mini \
  --model-name gpt-5-mini \
  --model-version 2025-08-07 \
  --model-format OpenAI \
  --sku-capacity 10 \
  --sku-name GlobalStandard
```

Model versions, deployment types and quota availability may differ across regions and subscriptions.

### Step 6 - Retrieve the project endpoint

```bash
az cognitiveservices account project show \
  --name "$foundry_name" \
  --resource-group "$group_name" \
  --project-name document-assistant \
  --query 'properties.endpoints."AI Foundry API"' \
  --output tsv
```

The command returns one project endpoint. Its address follows this pattern.

```text
https://<your-foundry-resource-name>.services.ai.azure.com/api/projects/document-assistant
```

This is the project address our application can connect to using appropriate authentication.

## 4\. What about security and monitoring?

Creating infrastructure is only the beginning.

**Identity** - Microsoft Entra ID and managed identities help authenticate users and services.

**Access control** - Azure RBAC defines what someone can do. The scope of the role assignment determines where those permissions apply.

| Foundry role | When to use it |
| --- | --- |
| **Foundry User** | Build and test applications in a project using an already deployed model. |
| **Foundry Project Manager** | Manage a project and grant teammates the Foundry User role within its assignment conditions. |
| **Foundry Account Owner** | Manage Foundry resources and projects and deploy models for teams to use. |
| **Foundry Owner** | Manage the infrastructure and build applications inside projects. |

**Observability** - Connect Application Insights to the project when developing agents. Verify that traces appear after running your first agent request, and consider the sensitivity of any recorded information.

These components become particularly important when moving from experimentation to enterprise AI applications.

## 5\. Before we finish

Check the provisioning state of the resource, project and model deployment. Each command should return `Succeeded`.

```bash
az cognitiveservices account show \
  --name "$foundry_name" --resource-group "$group_name" \
  --query properties.provisioningState --output tsv

az cognitiveservices account project show \
  --name "$foundry_name" --resource-group "$group_name" \
  --project-name document-assistant \
  --query properties.provisioningState --output tsv

az cognitiveservices account deployment show \
  --name "$foundry_name" --resource-group "$group_name" \
  --deployment-name gpt-5-mini \
  --query properties.provisioningState --output tsv
```

If you have finished experimenting, you can remove the resources to avoid ongoing costs. Deleting a resource group deletes everything within it. Use this command only for a group dedicated to the experiment and check the group name before confirming.

```bash
az group delete --name "$group_name"
```

## Final thoughts

Microsoft Foundry is not simply a place to deploy AI models. It provides an environment in which we can develop, secure, evaluate and operate AI solutions.

Understanding the relationship between resources, projects and model deployments is the first step towards designing that environment properly.

**Understand the architecture before building the application.**

![The Foundry resource contains the project and hosts the model deployment. The project uses the model to serve application requests.](https://cdn.hashnode.com/uploads/covers/6b004c3a823e7883755c4a91/89cbd366-bbc7-42f7-8c24-db2340ecacdd.png align="center")

*Figure 4. Three roles to remember when you design your first Foundry application.*

## References

- [Microsoft Foundry - Set up Foundry resources](https://learn.microsoft.com/en-us/azure/foundry/tutorials/quickstart-create-foundry-resources?tabs=azurecli)
- [Microsoft Foundry - Architecture](https://learn.microsoft.com/en-us/azure/foundry/concepts/architecture)
- [Microsoft Foundry - Role-based access control](https://learn.microsoft.com/en-us/azure/foundry/concepts/rbac-foundry#permissions-for-each-built-in-role)

*Part of my Microsoft Foundry series, exploring applied AI from fundamentals to enterprise implementation.*
