Provisioning Microsoft Foundry and AI Models
Now that the local development environment and Azure authentication are ready, the next step is to provision the cloud resources that will provide the intelligence for our agents.
Microsoft Foundry is the enterprise control plane for managing AI models, projects, agents, data, security, and related resources. It was previously associated with Azure AI Studio.
The overall process is:
Azure Account
↓
Microsoft Foundry
↓
Create Project
↓
Select Region + Resource Group
↓
Deploy AI Model
↓
Get Model Endpoint
↓
Connect .NET Application
1. Create a Microsoft Foundry Project
Start from the Microsoft Foundry portal:
ai.azure.com
A Foundry project can be viewed as an isolated workspace for a particular AI application or workload.
The project brings together resources such as:
- AI model deployments
- Agent resources
- Data
- Tools
- Connections
- Configuration
- Monitoring
When creating the project, you normally configure important Azure properties such as:
- Project name
- Azure subscription
- Resource group
- Region
For example:
Project Name: AgenticAIProject
Subscription: My Azure Subscription
Resource Group: rg-agentic-ai
Region: East US
The exact region and available models depend on current Azure availability and quota.
2. Why Use a Dedicated Resource Group?
A dedicated resource group gives you a clean boundary around your AI environment.
For example:
rg-agentic-ai
|
+-- Foundry Project
+-- AI Model Deployments
+-- Storage
+-- Key Vault
+-- Other AI Resources
This makes it easier to manage the lifecycle of the environment.
You can monitor the cost associated with the resource group and, when the learning environment is no longer required, remove the resources together rather than hunting for individual resources.
It also provides a useful separation between development, testing, and production environments.
3. Select the Azure Region Carefully
The region is an important architectural decision for AI workloads.
AI model availability and quota can differ between Azure regions. Therefore, you shouldn't simply select a region based on geographic proximity.
Consider:
- Model availability
- Regional capacity
- Token quotas
- Latency
- Data residency requirements
- Compliance requirements
- Cost
For a learning environment, a supported region such as East US may be appropriate if the required model is available there. For a production system, region selection should be based on the application's actual requirements.
4. Azure Creates the Supporting Infrastructure
When you create the Foundry project, Azure provisions the supporting resources required by the environment.
Conceptually:
Microsoft Foundry Project
|
+-- AI Resources
+-- Model Resources
+-- Storage
+-- Security Resources
+-- Other Azure Dependencies
The exact resources and architecture can evolve as Microsoft Foundry changes, so it is better to think of the project as the management boundary rather than assuming a fixed list of underlying Azure resources.
The important point is that you don't manually build every infrastructure component before starting your AI development.
5. Deploy an AI Model
Creating the Foundry project doesn't automatically mean that an LLM is ready for your application.
You still need to create a model deployment.
Go to the project's model or deployment area and select the option to deploy a model.
The Foundry model catalog contains models from multiple providers and model families.
For this course, the selected reasoning model is GPT-5 Mini.
The selection is based on the expected balance between capability, latency, and cost for agentic workloads.
The deployment flow is conceptually:
Foundry Model Catalog
↓
Select GPT-5 Mini
↓
Deploy Model
↓
Choose Deployment Name
↓
Deployment Succeeded
6. Deployment Name vs Model Name
There is an important distinction here.
Suppose the actual model is:
GPT-5 Mini
You might create a deployment with the name:
gpt-5-mini
Your application will generally use the deployment name when making model requests.
So keep this distinction clear:
| Term | Meaning |
|---|---|
| Model | The underlying AI model |
| Deployment | Your Azure deployment of that model |
| Deployment Name | The name your application uses to identify that deployment |
| Endpoint | The Azure URL used to communicate with the service |
This becomes important when writing the C# configuration.
7. Model Endpoint
After the deployment succeeds, the deployment details provide the information required by your application.
One important value is the endpoint.
Conceptually:
https://<azure-ai-resource>.openai.azure.com/
The endpoint tells the application where the AI service is located.
Your C# application will eventually use this endpoint through the appropriate Microsoft AI/Azure SDK abstraction.
8. Model Deployment Name
The second important value is the deployment name.
For example:
gpt-5-mini
Your application needs this value to identify which deployed model should process the request.
Conceptually:
C# Application
↓
Endpoint
↓
Deployment Name
↓
GPT-5 Mini
If you have multiple model deployments, the deployment name determines which one is used.
For example:
gpt-5-mini
text-embedding-3-small
another-model
Your application can use different deployments for different AI workloads.
9. API Keys — Important Security Point
Azure AI resources may also expose authentication keys, commonly shown as Key 1 and Key 2.
However, for the architecture we're building, the preferred authentication mechanism is Microsoft Entra ID rather than embedding API keys into the application.
This means the recommended approach is:
Development
↓
az login
↓
Azure Identity
↓
Microsoft Entra ID
↓
Azure AI Resource
And in production:
Production Application
↓
Managed Identity
↓
Microsoft Entra ID
↓
Azure AI Resource
API keys can still be useful for certain scenarios, such as systems that cannot use Entra ID, but they should be treated as secrets and managed through an appropriate secret-management mechanism.
10. Never Store Secrets in Source Control
Never commit credentials such as API keys into Git.
Avoid this:
{
"ApiKey": "actual-secret-key"
}
in a source-controlled appsettings.json.
Also avoid putting secrets directly into C# source code.
For enterprise applications, use identity-based authentication where supported, or an appropriate secret-management solution such as Azure Key Vault when a secret is genuinely required.
The principle is:
Bad:
Application → Hard-coded API Key
Better:
Application → Managed Identity → Entra ID → Azure Service
11. Embedding Model
The transcript also mentions a text embedding model such as text-embedding-3-small.
This is separate from the main reasoning model.
A reasoning model is used for tasks such as:
Question
↓
LLM
↓
Reasoned Answer
An embedding model converts text into numerical vectors:
Text
↓
Embedding Model
↓
Vector
↓
Vector Database / Search
This becomes important later when building RAG and semantic search systems.
So an agentic application may eventually use multiple models:
AI Models
|
+-----------+-----------+
| |
Reasoning Model Embedding Model
| |
Agent Logic RAG / Search
12. Test the Model in Foundry
Before connecting your C# application, you can use the Foundry playground to verify that the deployed model is working.
The basic flow is:
Foundry Project
↓
Model Deployment
↓
Playground
↓
Send Test Prompt
↓
Model Response
This is useful because it separates two possible problems:
Model problem:
The deployment itself isn't working.
Application problem:
The model works correctly, but your C# application isn't connecting to it correctly.
Testing in the playground first gives you a known-good baseline.
13. Cost Awareness
AI model usage is consumption-based, so development and testing can generate charges.
For a learning project, keep an eye on:
- Token consumption
- Model usage
- Number of requests
- Provisioned resources
- Running compute resources
- Storage
- Other Azure services
Use Azure's cost-management capabilities to monitor the environment.
A good development practice is:
Create resources
↓
Develop / Test
↓
Monitor Cost
↓
Stop/Delete unused resources
Don't assume that creating an Azure resource is automatically free just because you're using an Azure free account or credit.
14. Complete Provisioning Flow
At this point, we have completed the cloud-side preparation:
Azure Subscription
↓
Microsoft Foundry
↓
New Project
↓
Resource Group
↓
Select Region
↓
Model Catalog
↓
Deploy GPT-5 Mini
↓
Deployment Succeeded
↓
Endpoint + Deployment
↓
C# Application
We now have the two major sides of our development environment:
┌──────────────────────┐ ┌────────────────────────┐
│ Local Environment │ │ Azure Environment │
│ │ │ │
│ .NET 10 │ │ Microsoft Foundry │
│ C# │──────→│ GPT-5 Mini │
│ Azure CLI │ │ Embedding Model │
│ Azure Identity │ │ Security / Resources │
└──────────────────────┘ └────────────────────────┘
The next step is to connect these two worlds.
Our .NET application will use Azure Identity for authentication and Microsoft.Extensions.AI to communicate with the model deployed in Microsoft Foundry.