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: articles/ai-foundry/how-to/develop/get-started-projects-vs-code.md
+66-58Lines changed: 66 additions & 58 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,17 @@
1
1
---
2
2
title: Work with the Azure AI Foundry for Visual Studio Code extension
3
3
titleSuffix: Azure AI Foundry
4
-
description: Use this article to learn how to deploy Large Language Models and develop AI agents using Azure AI Foundry capabilities directly in VS Code.
4
+
description: Use this article to learn how to deploy Large Language Models using Azure AI Foundry capabilities directly in VS Code.
5
5
manager: mcleans
6
6
ms.service: azure-ai-foundry
7
7
content_well_notification:
8
8
- AI-contribution
9
9
ms.topic: how-to
10
-
ms.date: 04/03/2025
10
+
ms.date: 04/21/2025
11
11
ms.reviewer: erichen
12
12
ms.author: johalexander
13
13
author: ms-johnalex
14
-
# customer intent: As an AI app developer, I want to learn how to use the Azure AI Foundry for Visual Studio Code extension so that I can deploy Large Language Models and develop AI agents using Azure AI Foundry capabilities directly in VS Code.
14
+
# customer intent: As an AI app developer, I want to learn how to use the Azure AI Foundry for Visual Studio Code extension so that I can deploy Large Language Models using Azure AI Foundry capabilities directly in VS Code.
15
15
---
16
16
17
17
# Work with the Azure AI Foundry for Visual Studio Code extension (Preview)
@@ -85,22 +85,46 @@ Sign in to your Azure subscription to access your resources with the following s
85
85
86
86
1. Under the "Resources" section, select your Azure Subscription and Resource Group.
87
87
88
-
1. Select **Azure AI Foundry** and open your project.
88
+
1. Select **Azure AI Foundry** and right-click your project.
89
89
90
-
1.The**Agents** and **Models** sections are listed under your project.
90
+
1.Select**Open in Azure AI Foundry Extension**.
91
91
92
+
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/open-azure-ai-foundry-extension.png" alt-text="A screenshot of the Open in Azure AI Foundry Extension option." lightbox="../../media/how-to/get-started-projects-vs-code/open-azure-ai-foundry-extension.png":::
92
93
93
-
### Set the default Azure AI Foundry Project
94
94
95
-
Set your default Azure AI Foundry Project with the following steps:
95
+
### Explore the Azure AI Foundry Extension
96
96
97
-
1. Open a new Visual Studio Code window.
97
+
The Azure AI Foundry Extension opens in its own view, with the Azure AI Foundry Icon now displayed on the VS Code Navbar. The extension has three main sections: **Resources**, **Tools**, and **Help and Feedback**.
98
98
99
-
1. Select <kbd>F1</kbd> to open the command palette.
100
99
101
-
1. Enter **Azure AI Foundry: Select Default Project** and press Enter.
100
+
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/initial-view.png" alt-text="A screenshot of the Azure AI Foundry Extension with highlighted sections.":::
101
+
102
+
-**Resources**: This section contains the resources you have access to in your Azure AI Foundry project. The **Resources** section is the main view for interacting with your Azure AI Foundry resources. It contains the following subsections:
103
+
-**Models**: This section contains the models you can use to build and deploy your AI applications. The **Models** view is where you can find your deployed models in your Azure AI Foundry project.
104
+
-**Agents**: This section contains your deployed agents in your Azure AI Foundry project.
105
+
-**Threads**: This section contains the threads and runs from a deployed agent in your Azure AI Foundry project.
106
+
107
+
-**Tools**: This section contains the tools you can use to build and deploy your AI applications. The **Tools** view is where you can find the tools available to deploy and then work with your deployed models and agents. It contains the following subsections:
108
+
-**Model Catalog**: The link to the model catalog you can use to discover and deploy models.
109
+
-**Model Playground**: The link to the model playground for interacting with your deployed models in your Azure AI Foundry project.
110
+
-**Agent Playground**: The link to the agent playground for interacting with your deployed agents in your Azure AI Foundry project.
111
+
112
+
-**Help and Feedback**: This section contains links to the Azure AI Foundry documentation, feedback, and support. It contains the following subsections:
113
+
-**Documentation**: The link to the Azure AI Foundry Extension documentation.
114
+
-**GitHub**: The link to the Azure AI Foundry extension GitHub repository.
115
+
116
+
>[!NOTE]
117
+
> To learn more about working with Agents and Threads in the Azure AI Foundry Extension, see the [Work with Azure AI Agent Service in Visual Studio Code](./vs-code-agents.md) article.
118
+
119
+
### The default Azure AI Foundry Project
102
120
103
-
1. Select the Azure AI Foundry Project you want to use from the list of available projects and press Enter.
121
+
When you open a project in the Azure AI Foundry Extension, that project is set as your default project.
122
+
123
+
Switch your default project by following these steps:
124
+
125
+
1. Right-click on your deployed model and select the **Switch Default Project in Azure Extension** option.
126
+
127
+
1. In the top center, select the Azure AI Foundry Project you want to use from the list of available projects and press Enter.
104
128
105
129
Your selected project will now display **Default** after the project name.
106
130
@@ -115,7 +139,14 @@ The Azure AI Foundry for Visual Studio Code extension enables you to create, int
115
139
116
140
The [model catalog](/azure/ai-foundry/how-to/model-catalog-overview) in Azure AI Foundry portal is the hub to discover and use a wide range of models for building generative AI applications.
117
141
118
-
Access the model catalog from the command palette to explore and deploy a curated selection of models available in Azure AI Foundry, right from inside VS Code.
142
+
Access the model catalog from several different ways:
143
+
- The **Azure AI Foundry: Open Model Catalog** command palette command.
144
+
- Select the **plus** icon next to **Models** in the **Resources** section of the Azure AI Foundry Extension view.
145
+
- Select the **Model Catalog** link in the **Tools** section of the Azure AI Foundry Extension view.
146
+
147
+
#### Open the model catalog from the command palette
148
+
149
+
Access the model catalog from the command palette to explore and deploy a curated selection of models available in Azure AI Foundry, right from inside VS Code.
119
150
120
151
1. Select <kbd>F1</kbd> to open the command palette.
121
152
@@ -130,8 +161,22 @@ The [model catalog](/azure/ai-foundry/how-to/model-catalog-overview) in Azure AI
130
161
131
162
1. Search for a specific model using the search bar at the top-center of the page.
132
163
164
+
#### Open the model catalog from the Resources section
133
165
134
-
#### Deploy a model from the model catalog
166
+
The **Model Catalog** is also available in the **Resources** section of the Azure AI Foundry Extension view.
167
+
168
+
In the Azure AI Foundry Extension view, select the **plus** icon next to **Models** to open the Model Catalog.
169
+
170
+
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/select-model-plus-expanded.png" alt-text="Screenshot of the plus sign next to models with the list of models expanded." lightbox="../../media/how-to/get-started-projects-vs-code/select-model-plus-expanded.png":::
171
+
172
+
> [!TIP]
173
+
> You can also right-click on **Models** and select the **Deploy new AI model** option to open the Model Catalog to start the deployment process.
174
+
175
+
#### Open the model catalog from the Tools section
176
+
177
+
The **Model Catalog** is also available in the **Tools** section of the Azure AI Foundry Extension view. Double-click on the **Model Catalog** link to open the Model Catalog.
178
+
179
+
### Deploy a model from the model catalog
135
180
136
181
Deploy a selected model in the model catalog using the following steps:
137
182
@@ -163,48 +208,7 @@ Deploy a selected model in the model catalog using the following steps:
163
208
164
209
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/deployed-model.png" alt-text="Screenshot of the newly deployed model under the Models section." lightbox="../../media/how-to/get-started-projects-vs-code/deployed-model.png":::
165
210
166
-
### Deploy, view, and update models
167
-
168
-
#### Deploy a model
169
-
170
-
You can also deploy a model directly from your Azure AI Foundry project.
171
-
172
-
1. In the Azure Resources Extension view, select the **plus** icon next to **Models** to start the deployment process.
173
-
174
-
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/select-model-plus-expanded.png" alt-text="Screenshot of the plus sign next to models with the list of models expanded." lightbox="../../media/how-to/get-started-projects-vs-code/select-model-plus-expanded.png":::
175
-
176
-
> [!TIP]
177
-
> You can also right-click on **Models** and select the **Deploy new AI model** option to start the deployment process.
178
-
179
-
1. In the top center, select the AI service to use in the **Choose an AI service** dropdown and press Enter.
180
-
181
-
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/choose-ai-service.png" alt-text="Screenshot of the Choose AI service dropdown for model deployment." lightbox="../../media/how-to/get-started-projects-vs-code/choose-ai-service.png":::
182
-
183
-
1. In the top center, select the model to deploy in the **Choose a model to deploy** dropdown and press Enter.
184
-
185
-
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/select-deployment-model.png" alt-text="Screenshot of the Choose a model to deploy dropdown." lightbox="../../media/how-to/get-started-projects-vs-code/select-deployment-model.png":::
186
-
187
-
1. In the top center, select the model version to use in the **Choose model version** dropdown and press Enter.
188
-
189
-
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/select-model-version-2.png" alt-text="Screenshot of the Choose model version dropdown for model deployment." lightbox="../../media/how-to/get-started-projects-vs-code/select-model-version-2.png":::
190
-
191
-
1. In the top center, select the deployment type to use in the **Choose deployment type** dropdown and press Enter.
192
-
193
-
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/select-deployment-type.png" alt-text="Screenshot of the Choose deployment type dropdown for model deployment." lightbox="../../media/how-to/get-started-projects-vs-code/select-deployment-type.png":::
194
-
195
-
1. In the top center, enter the model deployment name to use in the **Enter deployment name** textbox and press Enter.
196
-
197
-
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/enter-deployment-name-2.png" alt-text="Screenshot of the Enter deployment name textbox for model deployment." lightbox="../../media/how-to/get-started-projects-vs-code/enter-deployment-name-2.png":::
198
-
199
-
1. A confirmation dialog box appears. Select the **Deploy** button to deploy the model to your project.
200
-
201
-
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/deploy-model-popup-2.png" alt-text="Screenshot of the model deployment confirmation dialog box with the Deploy button highlighted." lightbox="../../media/how-to/get-started-projects-vs-code/deploy-model-popup-2.png":::
202
-
203
-
1. After a successful deployment, your model will be listed with your other deployed models under the **Models** section in your project.
204
-
205
-
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/deployed-model-2.png" alt-text="Screenshot of the deployed model under the Models section." lightbox="../../media/how-to/get-started-projects-vs-code/deployed-model-2.png":::
206
-
207
-
#### View deployed models
211
+
### View deployed models
208
212
209
213
In the Azure Resources Extension view, select the **caret** icon in front of the **Models** section to view the list of deployed models.
210
214
@@ -271,7 +275,9 @@ This Python sample code file that demonstrates a basic call to the chat completi
271
275
272
276
Chat interactively with the model, change settings, and system instructions using the **Model Playground**.
273
277
274
-
Open the model playground using the following steps:
278
+
The **Model Playground** is available in the **Tools** section of the Azure AI Foundry Extension view. Double-click on the **Model Playground** link to open the Model Playground.
279
+
280
+
You can also open the model playground using the following steps:
275
281
276
282
1. Right-click on your deployed model and select the **Open in playground** option.
277
283
@@ -294,13 +300,15 @@ The Azure resources that you created in this article are billed to your Azure su
294
300
295
301
### Delete your agents
296
302
297
-
Delete the deployed agent in the [online AI Foundry portal](https://ai.azure.com). Select **Agents** from the navigation menu on the left, select your agent, then select the **Delete** button.
303
+
1. In the VS Code navbar, refresh the **Azure AI Foundry Extension**. In the **Resources** section, expand the **Agents** subsection to display the list of deployed agents.
304
+
305
+
1. Right-click on your deployed agent to delete and select the **Delete** option.
298
306
299
307
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/delete-agent.png" alt-text="Screenshot of the AI Foundry portal with 'Agents' from the navigation menu on the left and the **Delete** button highlighted." lightbox="../../media/how-to/get-started-projects-vs-code/delete-agent.png":::
300
308
301
309
### Delete your models
302
310
303
-
1. In the VS Code navbar, refresh the **Azure Resources**view. Expand the **Models** subsection to display the list of deployed models.
311
+
1. In the VS Code navbar, refresh the **Azure AI Foundry Extension**. In the **Resources**section, expand the **Models** subsection to display the list of deployed models.
304
312
305
313
1. Right-click on your deployed model to delete and select the **Delete** option.
Copy file name to clipboardExpand all lines: articles/ai-foundry/how-to/develop/vs-code-agents.md
+41-20Lines changed: 41 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ ms.service: azure-ai-foundry
7
7
content_well_notification:
8
8
- AI-contribution
9
9
ms.topic: how-to
10
-
ms.date: 04/03/2025
10
+
ms.date: 04/23/2025
11
11
ms.reviewer: erichen
12
12
ms.author: johalexander
13
13
author: ms-johnalex
@@ -31,11 +31,9 @@ Follow these steps to create an Azure AI Agent:
31
31
32
32
1. First, finish the [Get Started](./get-started-projects-vs-code.md#get-started) section to sign in to your Azure resources and set your default project.
33
33
34
-
1.[Deploy a model](./get-started-projects-vs-code.md#deploy-a-model) to use with your agent.
34
+
1.[Deploy a model](./get-started-projects-vs-code.md#deploy-a-model-from-the-model-catalog) to use with your agent.
35
35
36
-
1. Select your AI Foundry project in the Azure Resources sidebar.
37
-
38
-
1. Under your project, find the **Agents** section.
36
+
1. In the Azure AI Foundry Extension view, find the **Resources** section.
39
37
40
38
1. Select the **+** (plus) icon next to the **Agents** subsection to create a new AI Agent.
41
39
@@ -49,7 +47,7 @@ Follow these steps to create an Azure AI Agent:
49
47
50
48
### Interact with your agent in the designer
51
49
52
-
After you choose your save location, the Designer view will open to edit your AI Agent.
50
+
After you choose your save location, both the agent .yaml file and the Designer view will open to edit your AI Agent.
53
51
54
52
1. Perform the following tasks in the agent designer:
55
53
@@ -69,24 +67,27 @@ After you choose your save location, the Designer view will open to edit your AI
69
67
70
68
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/agent-designer.png" alt-text="Screenshot of the Agent designer that enables you to edit and interact with your AI Agent." lightbox="../../media/how-to/get-started-projects-vs-code/agent-designer.png":::
71
69
72
-
1. Select the **Save locally** button in the bottom-center of the **Agent Preferences** screen to store your agent configuration.
73
-
74
-
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/save-agent-locally.png" alt-text="Screenshot of the Agent designer with the 'Save locally' button highlighted." lightbox="../../media/how-to/get-started-projects-vs-code/save-agent-locally.png":::
70
+
1. To save the .yaml file, select **File** > **Save** in the VS Code menu bar.
75
71
76
-
### Show the Azure AI Agent YAML definition
72
+
### Explore the Azure AI Agent YAML definition
77
73
78
-
Select the **Open Yaml File** on the top-right of the designer to open your AI Agent .yaml file. This file contains the details and setup information for your agent, similar to the following .yaml file example:
74
+
Your AI Agent .yaml file was opened at the same time the designer was. This file contains the details and setup information for your agent, similar to the following .yaml file example:
@@ -128,7 +129,7 @@ Create a tool configuration .yaml file using the following steps:
128
129
- Azure AI Foundry Project name
129
130
- Bing connection name
130
131
131
-
1. Save the .yaml file.
132
+
1. To save the .yaml file, select **File** > **Save** in the VS Code menu bar.
132
133
133
134
#### Add the tool to the AI Agent
134
135
@@ -146,7 +147,8 @@ Add a tool to the AI Agent with the following steps:
146
147
147
148
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/agent-added-tool.png" alt-text="Screenshot of the Agent designer TOOL section with the new tool highlighted." lightbox="../../media/how-to/get-started-projects-vs-code/agent-added-tool.png":::
148
149
149
-
1. Select the **Save locally** button in the bottom-center of the **Agent Preferences** screen to store your agent configuration.
150
+
1. To save the .yaml file, select **File** > **Save** in the VS Code menu bar.
151
+
150
152
151
153
### Deploy Azure AI Agents to the Azure AI Foundry Studio
152
154
@@ -177,14 +179,33 @@ Open the **Agents Playground** using the following steps:
177
179
178
180
1. Right-click on your deployed agent and select the **Open Playground** option This action starts a thread with your agent and let you send messages.
179
181
180
-
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/agent-open-playground.png" alt-text="Screenshot of the agent context menu with the 'Open Playground' option highlighted." lightbox="../../media/how-to/get-started-projects-vs-code/agent-open-playground.png":::
181
-
182
182
1. The **Playground** page is displayed.
183
183
184
184
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/agent-display-playground.png" alt-text="Screenshot of the **Agents Playground** page in VS Code." lightbox="../../media/how-to/get-started-projects-vs-code/agent-display-playground.png":::
185
185
186
186
1. Type your prompt and see the outputs.
187
187
188
+
## Explore Threads
189
+
190
+
The **Threads** subsection displays the threads created during a run with your agent. In the Azure Resources Extension view, select the **caret** icon in front of the **Threads** subsection to view the list of threads.
191
+
192
+
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/thread-list.png" alt-text="Screenshot of the threads in the Threads subsection." lightbox="../../media/how-to/get-started-projects-vs-code/thread-list.png":::
193
+
194
+
195
+
196
+
### View thread details
197
+
198
+
Select a thread to view its details. The **Thread Details** page is displayed.
199
+
200
+
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/thread-view.png" alt-text="Screenshot of the thread details view." lightbox="../../media/how-to/get-started-projects-vs-code/thread-view.png":::
201
+
202
+
- A **Thread** is a conversation session between an agent and a user. Threads store **Messages** and automatically handle truncation to fit content into a model’s context.
203
+
204
+
- A **Message** is a single interaction between the agent and the user. Messages can include text, images, and other files. Messages are stored as a list on the Thread.
205
+
206
+
- A **Run** is a single execution of an agent. Each run can have multiple threads, and each thread can have multiple messages. The agent uses its configuration and Thread’s Messages to perform tasks by calling models and tools. As part of a Run, the agent appends Messages to the Thread.
207
+
208
+
188
209
## Cleanup resources
189
210
190
211
The Azure resources that you created in this article are billed to your Azure subscription. If you don't expect to need these resources in the future, delete them to avoid incurring more charges.
0 commit comments