You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 02-SetupDevEnvironment/getting-started-azure-openai.md
+17-16Lines changed: 17 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,19 @@
1
1
# Setting Up the Development Environment for Azure OpenAI
2
2
3
-
If you want to use Azure AI Foundry models for your .NET AI apps in this course, follow the steps in this guide.
3
+
If you want to use Microsoft Foundry models for your .NET AI apps in this course, follow the steps in this guide.
4
4
5
5
Don't want to use Azure OpenAI?
6
6
7
7
👉 [To use GitHub Models this is the guide for you](README.md)
8
8
👉 [Here are the steps for Ollama](getting-started-ollama.md)
9
9
10
-
## Create the Azure AI Foundry resources
10
+
## Create the Microsoft Foundry resources
11
11
12
-
To use Azure AI Foundry models, you need to create a hub and project in the Azure AI Foundry portal. Then you'll need to deploy a model. This section will show you how to do that.
12
+
To use Microsoft Foundry models, you need to create a hub and project in the Microsoft Foundry portal. Then you'll need to deploy a model. This section will show you how to do that.
13
13
14
-
### Create a Hub and Project in Azure AI Foundry
14
+
### Create a Hub and Project in Microsoft Foundry
15
15
16
-
1. Go to the [Azure AI Foundry Portal](https://ai.azure.com/).
16
+
1. Go to the [Microsoft Foundry Portal](https://ai.azure.com/).
17
17
1. Sign in with your Azure account.
18
18
1. Select **All hubs + projects** from the left-hand menu and then click the **+ New hub** from the dropdown. (Note: You may have to click on **+ New project** first to see the **+ New hub** option).
19
19

@@ -28,13 +28,13 @@ To use Azure AI Foundry models, you need to create a hub and project in the Azur
28
28
- Give your project a name (e.g., "GenAINET") or accept the default.
29
29
- Click **Create**.
30
30
31
-
🎉 **Done!** You’ve just created your first project in Azure AI Foundry.
31
+
🎉 **Done!** You've just created your first project in Microsoft Foundry.
32
32
33
-
### Deploy a Language Model in Azure AI Foundry
33
+
### Deploy a Language Model in Microsoft Foundry
34
34
35
35
Now, let’s deploy a **gpt-4o-mini** model to your project:
36
36
37
-
1. In the Azure AI Foundry portal, navigate to your project (it should automatically open after creating it).
37
+
1. In the Microsoft Foundry portal, navigate to your project (it should automatically open after creating it).
38
38
1. Click on **Models and Endpoints** from the left-hand menu and then the **Deploy Model** button.
39
39
1. Select **Deploy base model** from the dropdown.
40
40
1. Search for **gpt-4o-mini** in the model catalog.
@@ -43,7 +43,7 @@ Now, let’s deploy a **gpt-4o-mini** model to your project:
43
43
1. Click **Deploy** and wait for the model to be provisioned.
44
44
1. Once deployed, note the **Model Name**, **Target URI**, and **API Key** from the model details page.
45
45
46
-
🎉 **Done!** You’ve deployed your first Large Language Model in Azure AI Foundry.
46
+
🎉 **Done!** You've deployed your first Large Language Model in Microsoft Foundry.
47
47
48
48

49
49
@@ -58,7 +58,7 @@ To be secure, let's add the API key you just created to your Codespace's secrets
58
58
59
59

60
60
1. Name your secret **AZURE_AI_SECRET**.
61
-
1. Paste the API key you copied from the Azure AI Foundry portal into the **Secret** field.
61
+
1. Paste the API key you copied from the Microsoft Foundry portal into the **Secret** field.
62
62
63
63
## Creating a GitHub Codespace
64
64
@@ -90,15 +90,17 @@ Now let’s update the code to use the newly deployed model. First we'll need to
90
90
1. Open the terminal and switch to the project directory:
91
91
92
92
If you're using Windows Command Prompt (CMD) or PowerShell:
93
+
93
94
```bash
94
95
cd samples\CoreSamples\BasicChat-01MEAI
95
96
```
96
-
97
+
97
98
If you're using Linux, macOS, Git Bash, WSL, or the VS Code terminal:
99
+
98
100
```bash
99
101
cd samples/CoreSamples/BasicChat-01MEAI
100
102
```
101
-
103
+
102
104
> **Note**: GitHub Codespaces runs a Linux environment, so always use forward slashes (`/`) in paths when working in Codespaces, regardless of your local operating system.
103
105
104
106
1. Run the following commands to add the required package:
@@ -114,7 +116,6 @@ Now let’s update the code to use the newly deployed model. First we'll need to
114
116
115
117
Add the following using statements at the top of the file:
116
118
117
-
118
119
```csharp
119
120
using System.ClientModel;
120
121
using Azure.AI.OpenAI;
@@ -160,13 +161,13 @@ Now let’s update the code to use the newly deployed model. First we'll need to
160
161
161
162
## Summary
162
163
163
-
In this lesson, you learned how to set up your development environment for the rest of the course. You created a GitHub Codespace and configured it to use Azure OpenAI. You also updated the sample code to use the newly deployed model in Azure AI Foundry.
164
+
In this lesson, you learned how to set up your development environment for the rest of the course. You created a GitHub Codespace and configured it to use Azure OpenAI. You also updated the sample code to use the newly deployed model in Microsoft Foundry.
164
165
165
166
### Additional Resources
166
167
167
-
- [Azure AI Foundry Documentation](https://learn.microsoft.com/azure/ai-services/)
Copy file name to clipboardExpand all lines: 03-CoreGenerativeAITechniques/01-lm-completions-functions.md
+14-11Lines changed: 14 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ A text completion itself is not a chat application, it is a one and done interac
16
16
17
17
### Text completions
18
18
19
-
Let's see how you would use text completions using the **Microsoft.Extensions.AI** library in .NET.
19
+
Let's see how you would use text completions using the **Microsoft.Extensions.AI** library in .NET.
20
20
21
21
> 🧑💻**Sample code**: [Here is a working example of this application](../samples/CoreSamples/BasicChat-01MEAI/) you can follow along with.
22
22
@@ -26,22 +26,25 @@ To run the sample code, you'll need to:
26
26
27
27
1. Make sure you have set up a GitHub Codespace with the appropriate environment as described in the [Setup guide](../02-SetupDevEnvironment/readme.md)
28
28
2. Ensure you have configured your GitHub Token as described in the [Pre-flight check section](../02-SetupDevEnvironment/readme.md#pre-flight-check-setting-up-github-access-tokens)
29
-
3. Open a terminal in your codespace (Ctrl+`or Cmd+`)
29
+
3. Open a terminal in your codespace (Ctrl+`or Cmd+`)
30
30
4. Navigate to the sample code directory:
31
-
31
+
32
32
If you're using Windows Command Prompt (CMD) or PowerShell:
33
+
33
34
```bash
34
35
cd samples\CoreSamples\BasicChat-01MEAI
35
36
```
36
-
37
+
37
38
If you're using Linux, macOS, Git Bash, WSL, or the VS Code terminal:
39
+
38
40
```bash
39
41
cd samples/CoreSamples/BasicChat-01MEAI
40
42
```
41
-
43
+
42
44
> **Note**: GitHub Codespaces runs a Linux environment, so always use forward slashes (`/`) in paths when working in Codespaces, regardless of your local operating system.
> 🗒️**Note:** This example showed GitHub Models as the hosting service. If you want to use Ollama, [check out this example](../samples/CoreSamples/BasicChat-03Ollama/) (it instantiates a different `IChatClient`).
72
-
>
73
-
>If you want to use Azure AI Foundry you can use the same code, but you will need to change the endpoint and the credentials.
75
+
> If you want to use Microsoft Foundry you can use the same code, but you will need to change the endpoint and the credentials.
76
+
>
74
77
>
75
78
> **GitHub Models Endpoint:** The endpoint `https://models.github.ai/inference` is the new dedicated GitHub Models endpoint as announced in the [GitHub Models deprecation notice](https://github.blog/changelog/2025-07-17-deprecation-of-azure-endpoint-for-github-models/), replacing the previous Azure-based endpoint.
76
79
>
77
80
> If you want to use both Ollama and Semantic Kernel together, [check out the BasicChat-04OllamaSK example](../samples/CoreSamples/BasicChat-04OllamaSK/).
78
-
>
81
+
>
79
82
> For instructions on how to set up Ollama, refer to [Getting Started with Ollama](../02-SetupDevEnvironment/getting-started-ollama.md).
80
83
81
84
> 🙋 **Need help?**: If you encounter any issues running this example, [open an issue in the repository](https://github.com/microsoft/Generative-AI-for-beginners-dotnet/issues/new?template=Blank+issue) and we'll help you troubleshoot.
@@ -210,9 +213,9 @@ In the next lesson you'll see how to start chatting with data and build what's k
Copy file name to clipboardExpand all lines: 03-CoreGenerativeAITechniques/04-agents.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,11 +16,12 @@ One key thing to keep in mind when building agents is that they are focused on d
16
16
17
17
## Creating an AI Agent
18
18
19
-
We'll be working with a couple of new concepts in order to build an AI agent in .NET. We'll be using a new SDK and will have to do some additional setup in Azure AI Foundry to get things started.
19
+
We'll be working with a couple of new concepts in order to build an AI agent in .NET. We'll be using a new SDK and will have to do some additional setup in Microsoft Foundry to get things started.
20
20
21
21
> 🧑💻**Sample code**: We'll be working from the [AgentLabs-01-Simple sample](../samples/CoreSamples/AgentLabs-01-Simple/) for this lesson.
22
22
>
23
23
> We also have more advanced agent examples:
24
+
>
24
25
> -[AgentLabs-02-Functions](../samples/CoreSamples/AgentLabs-02-Functions/) - Showing how to create custom functions for your agents
25
26
> -[AgentLabs-03-OpenAPIs](../samples/CoreSamples/AgentLabs-03-OpenAPIs/) - Demonstrating how agents can use OpenAPI specifications
26
27
> -[AgentLabs-03-PythonParksInformationServer](../samples/CoreSamples/AgentLabs-03-PythonParksInformationServer/) - A Python server that works with the OpenAPI example
@@ -29,7 +30,7 @@ We'll be working with a couple of new concepts in order to build an AI agent in
29
30
30
31
We're going to introduce a new Azure Service that will help us build agents, the appropriately named [Azure AI Agent Service](https://learn.microsoft.com/azure/ai-services/agents/overview).
31
32
32
-
To run the code samples included in this lesson, you'll need to perform some additional setup in Azure AI Foundry. You can follow [these instructions to setup a **Basic Agent**](https://learn.microsoft.com/azure/ai-services/agents/quickstart?pivots=programming-language-csharp).
33
+
To run the code samples included in this lesson, you'll need to perform some additional setup in Microsoft Foundry. You can follow [these instructions to setup a **Basic Agent**](https://learn.microsoft.com/azure/ai-services/agents/quickstart?pivots=programming-language-csharp).
33
34
34
35
### Azure AI Projects library
35
36
@@ -65,12 +66,12 @@ We'll be building a single purpose agent that acts as a tutor to math students.
Secondnotethe `instructions` thatarebeingsentalong. It's a prompt and we'relimitingittoansweringmathquestions. Thenlastcreatingtheagentisanasyncoperation. That'sbecauseit'screatinganobjectwithinAzureAIFoundryAgentsservice. Soweboth `await` the `CreateAgentAsync` functionandthengrabthe `Value` ofitsreturntogetattheactual `Agent` object. You'llseethispatternoccuroverandoveragain when creating objects with the **Azure.AI.Projects** SDK.
91
+
Secondnotethe `instructions` thatarebeingsentalong. It's a prompt and we'relimitingittoansweringmathquestions. Thenlastcreatingtheagentisanasyncoperation. That'sbecauseit'screatinganobjectwithinMicrosoftFoundryAgentsservice. Soweboth `await` the `CreateAgentAsync` functionandthengrabthe `Value` ofitsreturntogetattheactual `Agent` object. You'llseethispatternoccuroverandoveragain when creating objects with the **Azure.AI.Projects** SDK.
91
92
92
93
1. An `AgentThread` isanobjectthathandlesthecommunicationbetweenindividualagentsandtheuserandsoon. We'llneedtocreatethatsowecanadda `ThreadMessage` ontoit. Andinthiscaseit'stheuser'sfirstquestion.
93
94
@@ -120,6 +121,7 @@ We'll be building a single purpose agent that acts as a tutor to math students.
120
121
, additionalInstructions: "You are working in FREE TIER EXPERIENCE mode, every user has premium account for a short period of time. Explain detailed the steps to answer the user questions"
121
122
);
122
123
ThreadRunrun=runResponse.Value;
124
+
123
125
```
124
126
125
127
1. Allthat's left then is to check the status of the run
|[AgentFx-AIFoundry-01](../samples/AgentFx/AgentFx-AIFoundry-01/)| Single agent using Azure AI Foundry | Azure CLI authentication, managed identity |Azure AI Foundry |
109
+
|[AgentFx-AIFoundry-01](../samples/AgentFx/AgentFx-AIFoundry-01/)| Single agent using Microsoft Foundry | Azure CLI authentication, managed identity |Microsoft Foundry |
110
110
|[AgentFx-Ollama-01](../samples/AgentFx/AgentFx-Ollama-01/)| Single agent using local Ollama models | Local AI inference, privacy-focused | Ollama (local) |
@@ -176,7 +176,7 @@ dotnet user-secrets set "GITHUB_TOKEN" "your-github-token"
176
176
dotnet run
177
177
```
178
178
179
-
**Azure AI Foundry** (requires Azure CLI login):
179
+
**Microsoft Foundry** (requires Azure CLI login):
180
180
181
181
Windows (CMD/PowerShell):
182
182
@@ -328,7 +328,7 @@ var nextResponse = await agent.RunAsync("What is my name?", resumedThread);
328
328
### Key Considerations
329
329
330
330
-**Agent consistency**: You must use the same agent type to deserialize threads, as different agents may have unique internal implementations
331
-
-**Storage flexibility**: The framework abstracts storage details - some agents (like Azure AI Foundry) persist history in the service, while others (like OpenAI chat completion) manage state in-memory
331
+
-**Storage flexibility**: The framework abstracts storage details - some agents (like Microsoft Foundry) persist history in the service, while others (like OpenAI chat completion) manage state in-memory
332
332
-**Production storage**: For production scenarios, use reliable storage like cloud databases or blob storage instead of local files
333
333
334
334
> 🧑💻 **Sample code**: Explore the persisted conversation samples:
0 commit comments