Skip to content

Commit 21e62cb

Browse files
authored
Merge branch 'MicrosoftDocs:main' into l3-network-overlaps-warning
2 parents 9b08d21 + bc008f5 commit 21e62cb

File tree

60 files changed

+579
-551
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+579
-551
lines changed

.openpublishing.publish.config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,7 @@
12281228
"articles/ai-services/.openpublishing.redirection.applied-ai-old.json",
12291229
"articles/ai-services/.openpublishing.redirection.applied-ai-services.json",
12301230
"articles/ai-services/.openpublishing.redirection.cognitive-services.json",
1231+
"articles/ai-studio/.openpublishing.redirection.ai-studio.json",
12311232
"articles/energy-data-services/.openpublishing.redirection.energy-data-services.json",
12321233
"articles/azure-fluid-relay/.openpublishing.redirection.fluid-relay.json",
12331234
"articles/azure-netapp-files/.openpublishing.redirection.azure-netapp-files.json",

articles/ai-services/openai/includes/use-your-data-dotnet.md

Lines changed: 17 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ string searchKey = GetEnvironmentVariable("SearchKey");
2929
string searchIndex = GetEnvironmentVariable("SearchIndex");
3030
string deploymentName = GetEnvironmentVariable("AOAIDeploymentId");
3131

32+
3233
var client = new OpenAIClient(new Uri(azureOpenAIEndpoint), new AzureKeyCredential(azureOpenAIKey));
3334

3435
var chatCompletionsOptions = new ChatCompletionsOptions()
3536
{
3637
Messages =
3738
{
38-
new ChatMessage(ChatRole.User, "What are the differences between Azure Machine Learning and Azure AI services?"),
39+
new ChatRequestUserMessage("What are the differences between Azure Machine Learning and Azure AI services?"),
3940
},
4041
AzureExtensionsOptions = new AzureChatExtensionsOptions()
4142
{
@@ -48,12 +49,13 @@ var chatCompletionsOptions = new ChatCompletionsOptions()
4849
IndexName = searchIndex,
4950
},
5051
}
51-
}
52+
},
53+
DeploymentName = deploymentName
5254
};
5355

54-
Response<ChatCompletions> response = client.GetChatCompletions(deploymentName, chatCompletionsOptions);
56+
Response<ChatCompletions> response = client.GetChatCompletions(chatCompletionsOptions);
5557

56-
ChatMessage responseMessage = response.Value.Choices[0].Message;
58+
ChatResponseMessage responseMessage = response.Value.Choices[0].Message;
5759

5860
Console.WriteLine($"Message from {responseMessage.Role}:");
5961
Console.WriteLine("===");
@@ -62,7 +64,7 @@ Console.WriteLine("===");
6264

6365
Console.WriteLine($"Context information (e.g. citations) from chat extensions:");
6466
Console.WriteLine("===");
65-
foreach (ChatMessage contextMessage in responseMessage.AzureExtensionsContext.Messages)
67+
foreach (ChatResponseMessage contextMessage in responseMessage.AzureExtensionsContext.Messages)
6668
{
6769
string contextContent = contextMessage.Content;
6870
try
@@ -126,25 +128,22 @@ using Azure.AI.OpenAI;
126128
using System.Text.Json;
127129
using static System.Environment;
128130

129-
string endpoint = GetEnvironmentVariable("AOAIEndpoint");
130-
string key = GetEnvironmentVariable("AOAIKey");
131-
132-
var client = new OpenAIClient(new Uri(endpoint), new AzureKeyCredential(key));
133-
134131
string azureOpenAIEndpoint = GetEnvironmentVariable("AOAIEndpoint");
135132
string azureOpenAIKey = GetEnvironmentVariable("AOAIKey");
136133
string searchEndpoint = GetEnvironmentVariable("SearchEndpoint");
137134
string searchKey = GetEnvironmentVariable("SearchKey");
138135
string searchIndex = GetEnvironmentVariable("SearchIndex");
139136
string deploymentName = GetEnvironmentVariable("AOAIDeploymentId");
140137

138+
141139
var client = new OpenAIClient(new Uri(azureOpenAIEndpoint), new AzureKeyCredential(azureOpenAIKey));
142140

143141
var chatCompletionsOptions = new ChatCompletionsOptions()
144142
{
143+
DeploymentName = deploymentName,
145144
Messages =
146145
{
147-
new ChatMessage(ChatRole.User, "What are the differences between Azure Machine Learning and Azure AI services?"),
146+
new ChatRequestUserMessage("What are the differences between Azure Machine Learning and Azure AI services?"),
148147
},
149148
AzureExtensionsOptions = new AzureChatExtensionsOptions()
150149
{
@@ -159,44 +158,15 @@ var chatCompletionsOptions = new ChatCompletionsOptions()
159158
}
160159
}
161160
};
162-
163-
Response<StreamingChatCompletions> response = await client.GetChatCompletionsStreamingAsync(
164-
deploymentName,
165-
chatCompletionsOptions);
166-
167-
using StreamingChatCompletions streamingChatCompletions = response.Value;
168-
169-
await foreach (StreamingChatChoice streamingChatChoice in streamingChatCompletions.GetChoicesStreaming())
161+
await foreach (StreamingChatCompletionsUpdate chatUpdate in client.GetChatCompletionsStreaming(chatCompletionsOptions))
170162
{
171-
await foreach (ChatMessage chatMessage in streamingChatChoice.GetMessageStreaming())
163+
if (chatUpdate.Role.HasValue)
172164
{
173-
if (chatMessage.Role != default)
174-
{
175-
Console.WriteLine($"Message from {chatMessage.Role}: ");
176-
}
177-
if (chatMessage.Content != default)
178-
{
179-
Console.Write(chatMessage.Content);
180-
}
181-
if (chatMessage.AzureExtensionsContext != default)
182-
{
183-
Console.WriteLine($"Context information (e.g. citations) from chat extensions:");
184-
foreach (var contextMessage in chatMessage.AzureExtensionsContext.Messages)
185-
{
186-
string contextContent = contextMessage.Content;
187-
try
188-
{
189-
var contextMessageJson = JsonDocument.Parse(contextMessage.Content);
190-
contextContent = JsonSerializer.Serialize(contextMessageJson, new JsonSerializerOptions()
191-
{
192-
WriteIndented = true,
193-
});
194-
}
195-
catch (JsonException)
196-
{}
197-
Console.WriteLine($"{contextMessage.Role}: {contextContent}");
198-
}
199-
}
165+
Console.Write($"{chatUpdate.Role.Value.ToString().ToUpperInvariant()}: ");
166+
}
167+
if (!string.IsNullOrEmpty(chatUpdate.ContentUpdate))
168+
{
169+
Console.Write(chatUpdate.ContentUpdate);
200170
}
201171
}
202172
```
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"redirections": [
3+
{
4+
"source_path_from_root": "/articles/ai-studio/how-to/vscode-web.md",
5+
"redirect_url": "/azure/ai-studio/how-to/develop-in-vscode",
6+
"redirect_document_id": true
7+
}
8+
]
9+
}

articles/ai-studio/how-to/cli-install.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ You can install the Azure AI CLI locally as described previously, or run it usin
9191

9292
### Option 1: Using VS Code (web) in Azure AI Studio
9393

94-
VS Code (web) in Azure AI Studio creates and runs the development container on a compute instance. To get started with this approach, follow the instructions in [How to work with Azure AI Studio projects in VS Code (Web)](vscode-web.md).
94+
VS Code (web) in Azure AI Studio creates and runs the development container on a compute instance. To get started with this approach, follow the instructions in [Work with Azure AI projects in VS Code](develop-in-vscode.md).
9595

9696
Our prebuilt development environments are based on a docker container that has the Azure AI SDK generative packages, the Azure AI CLI, the Prompt flow SDK, and other tools. It's configured to run VS Code remotely inside of the container. The docker container is similar to [this Dockerfile](https://github.com/Azure/aistudio-copilot-sample/blob/main/.devcontainer/Dockerfile), and is based on [Microsoft's Python 3.10 Development Container Image](https://mcr.microsoft.com/en-us/product/devcontainers/python/about).
9797

@@ -221,7 +221,7 @@ As mentioned in step 2 above, your flow.dag.yaml should reference connection and
221221

222222
If you're working in your own development environment (including Codespaces), you might need to manually update these fields so that your flow runs connected to Azure resources.
223223

224-
If you launched VS Code from the AI Studio, you are in an Azure-connected custom container experience, and you can work directly with flows stored in the `shared` folder. These flow files are the same underlying files prompt flow references in the Studio, so they should already be configured with your project connections and deployments. To learn more about the folder structure in the VS Code container experience, see [Get started with Azure AI projects in VS Code (Web)](vscode-web.md)
224+
If you launched VS Code from the AI Studio, you are in an Azure-connected custom container experience, and you can work directly with flows stored in the `shared` folder. These flow files are the same underlying files prompt flow references in the Studio, so they should already be configured with your project connections and deployments. To learn more about the folder structure in the VS Code container experience, see [Work with Azure AI projects in VS Code](develop-in-vscode.md)
225225

226226
## ai chat
227227

@@ -295,7 +295,7 @@ ai help
295295

296296
## Next steps
297297

298-
- [Try the Azure AI CLI from Azure AI Studio in a browser](vscode-web.md)
298+
- [Try the Azure AI CLI from Azure AI Studio in a browser](develop-in-vscode.md)
299299

300300

301301

articles/ai-studio/how-to/create-manage-compute.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ To create a compute instance in Azure AI Studio:
5757
:::image type="content" source="../media/compute/compute-scheduling.png" alt-text="Screenshot of the option to enable idle shutdown and create a schedule." lightbox="../media/compute/compute-scheduling.png":::
5858

5959
> [!IMPORTANT]
60-
> The compute can't be idle if you have [prompt flow runtime](./create-manage-runtime.md) in **Running** status on the compute. You need to delete any active runtime before the compute instance can be eligible for idle shutdown. You also can't have any active [VS Code (Web)](./vscode-web.md) sessions hosted on the compute instance.
60+
> The compute can't be idle if you have [prompt flow runtime](./create-manage-runtime.md) in **Running** status on the compute. You need to delete any active runtime before the compute instance can be eligible for idle shutdown. You also can't have any active [VS Code (Web)](./develop-in-vscode.md) sessions hosted on the compute instance.
6161
6262
1. You can update the schedule days and times to meet your needs. You can also add additional schedules. For example, you can create a schedule to start at 9 AM and stop at 6 PM from Monday-Thursday, and a second schedule to start at 9 AM and stop at 4 PM for Friday. You can create a total of four schedules per compute instance.
6363

@@ -84,7 +84,7 @@ Note that disabling SSH prevents SSH access from the public internet. But when a
8484
To avoid getting charged for a compute instance that is switched on but inactive, you can configure when to shut down your compute instance due to inactivity.
8585

8686
> [!IMPORTANT]
87-
> The compute can't be idle if you have [prompt flow runtime](./create-manage-runtime.md) in **Running** status on the compute. You need to delete any active runtime before the compute instance can be eligible for idle shutdown. You also can't have any active [VS Code (Web)](./vscode-web.md) sessions hosted on the compute instance.
87+
> The compute can't be idle if you have [prompt flow runtime](./create-manage-runtime.md) in **Running** status on the compute. You need to delete any active runtime before the compute instance can be eligible for idle shutdown. You also can't have any active [VS Code (Web)](./develop-in-vscode.md) sessions hosted on the compute instance.
8888
8989
The setting can be configured during compute instance creation or for existing compute instances.
9090

articles/ai-studio/how-to/vscode-web.md renamed to articles/ai-studio/how-to/develop-in-vscode.md

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,42 @@
11
---
2-
title: Get started with Azure AI projects in VS Code (Web)
2+
title: Work with Azure AI projects in VS Code
33
titleSuffix: Azure AI Studio
4-
description: This article provides instructions on how to get started with Azure AI projects in VS Code (Web).
4+
description: This article provides instructions on how to get started with Azure AI projects in VS Code.
55
manager: nitinme
66
ms.service: azure-ai-studio
77
ms.custom:
88
- ignite-2023
99
ms.topic: how-to
10-
ms.date: 11/15/2023
10+
ms.date: 1/10/2024
1111
ms.reviewer: eur
1212
ms.author: eur
1313
author: eric-urban
1414
---
1515

16-
# Get started with Azure AI projects in VS Code (Web)
16+
# Get started with Azure AI projects in VS Code
1717

1818
[!INCLUDE [Azure AI Studio preview](../includes/preview-ai-studio.md)]
1919

20-
Azure AI Studio supports developing in VS Code for the Web. In this scenario, VS Code is remotely connected to a prebuilt custom container running on a virtual machine, also known as a compute instance. To work in your local environment instead, or to learn more, follow the steps in [Install the Azure AI SDK](sdk-install.md) and [Install the Azure AI CLI](cli-install.md).
20+
Azure AI Studio supports developing in VS Code - Web and Desktop. In each scenario, your VS Code instance is remotely connected to a prebuilt custom container running on a virtual machine, also known as a compute instance. To work in your local environment instead, or to learn more, follow the steps in [Install the Azure AI SDK](sdk-install.md) and [Install the Azure AI CLI](cli-install.md).
2121

22-
## Launch VS Code (Web) from Azure AI Studio
22+
## Launch VS Code from Azure AI Studio
2323

24-
1. Go to the Azure AI Studio homepage at [aka.ms/AzureAIStudio](https://aka.ms/AzureAIStudio).
24+
1. Go to [Azure AI Studio](https://ai.azure.com).
2525

26-
1. Got to **Build** > **Projects** and select or create the project you want to work with.
26+
1. Go to **Build** > **Projects** and select or create the project you want to work with.
2727

28-
1. At the top-right of any page in the **Build** tab, select **Open project in VS Code (Web)**
28+
1. At the top-right of any page in the **Build** tab, select **Open project in VS Code (Web)** if you want to work in the browser. If you want to work in your local VS Code instance instead, select the dropdown arrow and choose **Open project in VS Code (Desktop)**.
2929

30-
1. Select or create the compute instance that you want to use.
30+
1. Within the dialog that opened following the previous step, select or create the compute instance that you want to use.
3131

3232
1. Once the compute is running, select **Set up** which configures the container on your compute for you. The compute setup might take a few minutes to complete. Once you set up the compute the first time, you can directly launch subsequent times. You might need to authenticate your compute when prompted.
3333

3434
> [!WARNING]
35-
> Even if you enable and configure idle shutdown on your compute instance, any computes that host this custom container for VS Code (Web) won't idle shutdown. This is to ensure the compute doesn't shut down unexpectedly while you're working within a container. We are working to improve this experience. Scheduled startup and shutdown should still work as expected.
35+
> Even if you [enable and configure idle shutdown on your compute instance](./create-manage-compute.md#configure-idle-shutdown), any computes that host this custom container for VS Code won't idle shutdown. This is to ensure the compute doesn't shut down unexpectedly while you're working within a container.
3636
37-
1. Once the container is ready, select **Launch**. This launches VS Code (Web) in a new browser tab connected to *vscode.dev*.
37+
1. Once the container is ready, select **Launch**. This launches your previously selected VS Code experience, remotely connected to a custom development environment running on your compute instance.
3838

39+
If you selected VS Code (Web), a new browser tab connected to *vscode.dev* opens. If you selected VS Code (Desktop), a new local instance of VS Code opens on your local machine.
3940

4041
## The custom container folder structure
4142

@@ -80,25 +81,30 @@ If you prefer to work interactively, the Azure AI CLI has everything you need to
8081

8182
### Working with prompt flows
8283

83-
You can use the Azure AI SDK and Azure AI CLI to create, reference and work with the flows.
84+
You can use the Azure AI SDK and Azure AI CLI to create, reference and work with prompt flows.
8485

85-
Prompt flows already created in the Azure AI Studio can be found at `shared\Users\{user-name}\promptflow`. You can also create new flows in your `code` or `shared` folder using the CLIs and SDKs.
86+
Prompt flows already created in the Azure AI Studio can be found at `shared\Users\{user-name}\promptflow`. You can also create new flows in your `code` or `shared` folder using the Azure AI CLI and SDK.
8687

87-
- To reference an existing flow using the Azure AI CLI, use `ai flow invoke`.
88-
- To create a new flow using the Azure AI CLI, use `ai flow new`.
88+
- To reference an existing flow using the AI CLI, use `ai flow invoke`.
89+
- To create a new flow using the AI CLI, use `ai flow new`.
8990

90-
For prompt flow specific capabilities that aren't present in the AI SDK and CLI, you can work directly with the Prompt flow CLI or SDK, or the Prompt flow VS Code extension (all preinstalled in this environment). For more information, see [prompt flow capabilities](https://microsoft.github.io/promptflow/reference/index.html).
91+
Prompt flow will automatically use the Azure AI connections your project has access to when you use the AI CLI or SDK.
92+
93+
You can also work with the prompt flow extension in VS Code, which is preinstalled in this environment. Within this extension, you can set the connection provider to your Azure AI project. See [consume connections from Azure AI](https://microsoft.github.io/promptflow/cloud/azureai/consume-connections-from-azure-ai.html).
94+
95+
For prompt flow specific capabilities that aren't present in the AI SDK and CLI, you can work directly with the prompt flow CLI or SDK. For more information, see [prompt flow capabilities](https://microsoft.github.io/promptflow/reference/index.html).
9196
9297
## Remarks
9398
9499
If you plan to work across multiple code and data directories, or multiple repositories, you can use the split root file explorer feature in VS Code. To try this feature, follow these steps:
100+
95101
1. Enter *Ctrl+Shift+p* to open the command palette. Search for and select **Workspaces: Add Folder to Workspace**.
96102
1. Select the repository folder that you want to load. You should see a new section in your file explorer for the folder you opened. If it was a repository, you can now work with source control in VS Code.
97103
1. If you want to save this configuration for future development sessions, again enter *Ctrl+Shift+p* and select **Workspaces: Save Workspace As**. This action saves a config file to your current folder.
98-
104+
99105
For cross-language compatibility and seamless integration of Azure AI capabilities, explore the Azure AI Hub at [https://aka.ms/azai](https://aka.ms/azai). Discover app templates and SDK samples in your preferred programming language.
100106
101107
## Next steps
102108
103109
- [Get started with the Azure AI CLI](cli-install.md)
104-
- [Quickstart: Generate product name ideas in the Azure AI Studio playground](../quickstarts/playground-completions.md)
110+
- [Quickstart: Generate product name ideas in the Azure AI Studio playground](../quickstarts/playground-completions.md)

articles/ai-studio/how-to/sdk-install.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ You can install the Azure AI SDK locally as described previously, or run it via
102102

103103
### Option 1: Using VS Code (web) in Azure AI Studio
104104

105-
VS Code (web) in Azure AI Studio creates and runs the development container on a compute instance. To get started with this approach, follow the instructions in [How to work with Azure AI Studio projects in VS Code (Web)](vscode-web.md).
105+
VS Code (web) in Azure AI Studio creates and runs the development container on a compute instance. To get started with this approach, follow the instructions in [Work with Azure AI projects in VS Code](develop-in-vscode.md).
106106

107107
Our prebuilt development environments are based on a docker container that has the Azure AI Generative SDK, the Azure AI CLI, the prompt flow SDK, and other tools. It's configured to run VS Code remotely inside of the container. The docker container is defined in [this Dockerfile](https://github.com/Azure/aistudio-copilot-sample/blob/main/.devcontainer/Dockerfile), and is based on [Microsoft's Python 3.10 Development Container Image](https://mcr.microsoft.com/en-us/product/devcontainers/python/about).
108108

@@ -127,5 +127,5 @@ The Azure AI code samples in GitHub Codespaces help you quickly get started with
127127
## Next steps
128128
129129
- [Get started building a sample copilot application](https://github.com/azure/aistudio-copilot-sample)
130-
- [Try the Azure AI CLI from Azure AI Studio in a browser](vscode-web.md)
130+
- [Try the Azure AI CLI from Azure AI Studio in a browser](develop-in-vscode.md)
131131
- [Azure SDK for Python reference documentation](/python/api/overview/azure/ai)

articles/ai-studio/index.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ landingContent:
6464
url: how-to/sdk-install.md
6565
- text: Get started with the Azure AI CLI
6666
url: how-to/cli-install.md
67-
- text: Get started with projects in VS Code (Web)
68-
url: how-to/vscode-web.md
67+
- text: Work with Azure AI projects in VS Code
68+
url: how-to/develop-in-vscode.md
6969
- linkListType: concept
7070
links:
7171
- text: Connections for flows and indexing

0 commit comments

Comments
 (0)