Skip to content

Commit 0c70c63

Browse files
authored
Changes to include files
1 parent 12d32ff commit 0c70c63

File tree

4 files changed

+40
-39
lines changed

4 files changed

+40
-39
lines changed

articles/app-service/includes/deploy-intelligent-apps/deploy-intelligent-apps-linux-dotnet-pivot.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ ms.date: 04/10/2024
88
ms.author: jefmarti
99
---
1010

11-
You can create intelligent apps by using Azure App Service with popular AI frameworks like LangChain and Semantic Kernel connected to OpenAI. In the following tutorial, learn to add an Azure OpenAI service using Semantic Kernel to a .NET 8 Blazor web application.
11+
You can create intelligent apps by using Azure App Service with popular AI frameworks like LangChain and Semantic Kernel connected to OpenAI. In this article, you add an Azure OpenAI service using Semantic Kernel to a .NET 8 Blazor web application.
1212

1313
## Prerequisites
1414

1515
- An [Azure OpenAI resource](/azure/ai-services/openai/quickstart?pivots=programming-language-csharp&tabs=command-line%2Cpython#set-up) or an [OpenAI account](https://platform.openai.com/overview).
16-
- A .NET 8 Blazor web app. Create the application with a template [here](https://dotnet.microsoft.com/learn/aspnet/blazor-tutorial/intro).
16+
- A .NET 8 Blazor web app. Create the application with a [template](https://dotnet.microsoft.com/learn/aspnet/blazor-tutorial/intro).
1717

1818
## 1. Set up Blazor web app
1919

20-
For this Blazor web application, we're building off the Blazor [template](https://dotnet.microsoft.com/learn/aspnet/blazor-tutorial/intro) to create a new razor page that can send and receive requests to an Azure OpenAI or OpenAI service by using Semantic Kernel.
20+
For this Blazor web application, you're building off the Blazor [template](https://dotnet.microsoft.com/learn/aspnet/blazor-tutorial/intro) to create a new razor page that can send and receive requests to an Azure OpenAI or OpenAI service by using Semantic Kernel.
2121

22-
1. Right-click on the **Pages** folder found under the **Components** folder and add a new item named `OpenAI.razor`.
23-
1. Add the following code to the `OpenAI.razor` file and select **Save**.
22+
1. Right-click the **Pages** folder found under the **Components** folder and add a new item named `OpenAI.razor`.
23+
1. Add the following code to the `OpenAI.razor` file, and then select **Save**.
2424

2525
```csharp
2626
@page "/openai"
@@ -45,9 +45,10 @@ For this Blazor web application, we're building off the Blazor [template](https:
4545
}
4646
```
4747

48-
Next, add the new page to the navigation so that you can go to the service.
48+
Next, add the new page to the navigation so that you can go to the service:
4949

50-
1. Go to the `NavMenu.razor` file under the **Layout** folder and add the following div in the nav class. Select **Save**.
50+
1. Go to the `NavMenu.razor` file under the **Layout** folder
51+
1. Add the following `div` in the `nav` class, and then select **Save**.
5152

5253
```csharp
5354

@@ -58,27 +59,27 @@ Next, add the new page to the navigation so that you can go to the service.
5859
</div>
5960
```
6061

61-
After the navigation is updated, we can prepare to build the OpenAI client to handle our requests.
62+
After the navigation is updated, you can prepare to build the OpenAI client to handle the requests.
6263

6364
### API keys and endpoints
6465

65-
In order to make calls to OpenAI with your client, you need to first grab the key and endpoint values from Azure OpenAI or OpenAI and add them as secrets that your application uses. Retrieve and save the values for later use.
66+
To make calls to OpenAI with your client, you need to first get the key and endpoint values from Azure OpenAI or OpenAI and add them as secrets that your application uses. Save the values for later use.
6667

67-
To retrieve the key and endpoint values for Azure OpenAI, see [this documentation](/azure/ai-services/openai/quickstart?pivots=programming-language-csharp&tabs=command-line%2Cpython#retrieve-key-and-endpoint). If you're planning to use [managed identity](../../overview-managed-identity.md) to secure your app, you need only the `deploymentName` and `endpoint` values. Otherwise, you need each of the following values:
68+
To retrieve the key and endpoint values for Azure OpenAI, see [this documentation](/azure/ai-services/openai/quickstart?pivots=programming-language-csharp&tabs=command-line%2Cpython#retrieve-key-and-endpoint). If you're planning to use a [managed identity](../../overview-managed-identity.md) to help secure your app, you need only the `deploymentName` and `endpoint` values. Otherwise, you need each of the following values:
6869

6970
- `deploymentName`
7071
- `endpoint`
7172
- `apiKey`
7273
- `modelId`
7374

74-
To retrieve the API keys for OpenAI, see this [documentation](https://platform.openai.com/docs/api-reference). For our application, you need the following values:
75+
To retrieve the API keys for OpenAI, see [this documentation](https://platform.openai.com/docs/api-reference). For this application, you need the following values:
7576
7677
- `apiKey`
7778
- `modelId`
7879

79-
Because you're deploying to App Service, you can secure these secrets in Azure Key Vault for protection. Follow the [Quickstart](/azure/key-vault/secrets/quick-create-cli#create-a-key-vault) to set up your key vault and add the secrets that you saved earlier.
80-
Next, we can use key vault references as app settings in our App Service resource for our application to reference. Follow the instructions in the [documentation](../../app-service-key-vault-references.md?source=recommendations&tabs=azure-cli) to grant your app access to your key vault and to set up key vault references.
81-
Then, go to the portal **Environment Variables** pane in your resource and add the following app settings:
80+
Because you're deploying to App Service, you can put these secrets in Azure Key Vault for protection. Follow the [quickstart](/azure/key-vault/secrets/quick-create-cli#create-a-key-vault) to set up your key vault and add the secrets that you saved earlier.
81+
Next, you can use key vault references as app settings in your App Service resource for your application to reference. Follow the instructions in the [documentation](../../app-service-key-vault-references.md?source=recommendations&tabs=azure-cli) to grant your app access to your key vault and to set up key vault references.
82+
Then, go to the portal **Environment Variables** pane in your resource and add the following app settings.
8283

8384
Use the following settings for Azure OpenAI:
8485

@@ -130,11 +131,11 @@ For OpenAI:
130131

131132
## 2. Semantic Kernel
132133

133-
By using Semantic Kernel, an open-source software development kit (SDK), you can easily develop AI agents that work with your existing code. You can use Semantic Kernel with Azure OpenAI and OpenAI models.
134+
By using Semantic Kernel, an open-source SDK, you can easily develop AI agents that work with your existing code. You can use Semantic Kernel with Azure OpenAI and OpenAI models.
134135

135136
To create the OpenAI client, install Semantic Kernel.
136137

137-
To install Semantic Kernel, browse the NuGet package manager in Visual Studio and install the `Microsoft.SemanticKernel` package. For NuGet package manager instructions, see [here](/nuget/consume-packages/install-use-packages-visual-studio#find-and-install-a-package). For CLI instructions, see [here](/nuget/consume-packages/install-use-packages-dotnet-cli).
138+
To install Semantic Kernel, browse the NuGet package manager in Visual Studio and install the `Microsoft.SemanticKernel` package. For NuGet package manager instructions, see [this procedure](/nuget/consume-packages/install-use-packages-visual-studio#find-and-install-a-package). For CLI instructions, see [this article](/nuget/consume-packages/install-use-packages-dotnet-cli).
138139
After the Semantic Kernel package is installed, you can now initialize the kernel.
139140

140141
## 3. Initialize the kernel
@@ -157,11 +158,11 @@ To initialize the kernel, add the following code to the `OpenAI.razor` file.
157158
}
158159
```
159160

160-
In this step, we add the using statement and create the kernel in a method that we can use when we send the request to the service.
161+
In this step, you add the using statement and create the kernel in a method that you can use when you send the request to the service.
161162

162163
## 4. Add your AI service
163164

164-
After the kernel is initialized, we can add our chosen AI service to the kernel. We define our model and pass in our key and endpoint information that the chosen model consumes. If you plan to use managed identity with Azure OpenAI, add the service by using the example in the next section.
165+
After the kernel is initialized, you can add your chosen AI service to the kernel. You define your model and pass in your key and endpoint information that the chosen model consumes. If you plan to use managed identity with Azure OpenAI, add the service by using the example in the next section.
165166

166167
Use the following code for Azure OpenAI:
167168

@@ -227,9 +228,9 @@ Your web app is now added as a cognitive service OpenAI user and can communicate
227228

228229
## 5. Configure a prompt and create semantic function
229230

230-
Now that our chosen OpenAI service client is created with the correct keys, we can add a function to handle the prompt. With Semantic Kernel, you can handle prompts by using a semantic function, which turns the prompt and the prompt configuration settings into a function the kernel can execute. Learn more on configuring prompts [here](/semantic-kernel/prompts/configure-prompts?tabs=Csharp).
231+
Now that your chosen OpenAI service client is created with the correct keys, you can add a function to handle the prompt. With Semantic Kernel, you can handle prompts by using a semantic function, which turns the prompt and the prompt configuration settings into a function the kernel can execute. [Learn more about configuring prompts](/semantic-kernel/prompts/configure-prompts?tabs=Csharp).
231232

232-
First, we create a variable that holds the user's prompt. Then, add a function with execution settings to handle and configure the prompt. Add the following code to the `OpenAI.razor` file:
233+
First, create a variable that holds the user's prompt. Then, add a function with execution settings to handle and configure the prompt. Add the following code to the `OpenAI.razor` file:
233234

234235
```csharp
235236

@@ -346,14 +347,14 @@ Here's the example in its completed form. In this example, use the Azure OpenAI
346347
}
347348
```
348349

349-
Now, save the application and follow the next steps to deploy it to App Service. If you would like to test it locally first, you can swap the config values with the literal string values of your OpenAI service. For example: `string modelId = 'gpt-4-turbo';`.
350+
Now, save the application and follow the next steps to deploy it to App Service. If you want to test it locally first, you can swap the config values with the literal string values of your OpenAI service. For example: `string modelId = 'gpt-4-turbo';`.
350351

351352
## 5. Deploy to App Service
352353

353354
You're now ready to deploy to App Service. If you run into any issues, make sure you granted your app access to your key vault and added the app settings with key vault references as your values. App Service resolves the app settings in your application that match what you added in the portal.
354355

355356
### Authentication
356357

357-
We highly recommend that you also add authentication to your web app when using an Azure OpenAI or OpenAI service. This optional step can add a level of security with no other code. Learn how to enable authentication for your web app [here](../../scenario-secure-app-authentication-app-service.md).
358+
We highly recommend that you also add authentication to your web app when using an Azure OpenAI or OpenAI service. This optional step can add a level of security with no other code. [Learn how to enable authentication for your web app](../../scenario-secure-app-authentication-app-service.md).
358359

359360
After the app is deployed, browse to the web app and go to the OpenAI tab. Enter a query to the service and you should see a populated response from the server.

articles/app-service/includes/deploy-intelligent-apps/deploy-intelligent-apps-linux-java-pivot.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ ms.date: 04/10/2024
88
ms.author: jefmarti
99
---
1010

11-
You can use Azure App Service to create applications by using Azure OpenAI and OpenAI. In the following tutorial, we're adding Azure OpenAI Service to a Java 17 Spring Boot application using the Azure software development kit (SDK).
11+
You can use Azure App Service to create applications by using Azure OpenAI and OpenAI. In this article, you add Azure OpenAI Service to a Java 17 Spring Boot application by using the Azure SDK.
1212

1313
#### Prerequisites
1414

1515
- An [Azure OpenAI resource](/azure/ai-services/openai/quickstart?pivots=programming-language-csharp&tabs=command-line%2Cpython#set-up) or an [OpenAI account](https://platform.openai.com/overview).
16-
- A Java Spring Boot application. Create the application by using this [quickstart](../../quickstart-java.md?tabs=springboot&pivots=java-maven-javase).
16+
- A Java Spring Boot application. Create the application by using the [quickstart](../../quickstart-java.md?tabs=springboot&pivots=java-maven-javase).
1717

1818
### Set up web app
1919

20-
For this Spring Boot application, we're building off the [quickstart](../../quickstart-java.md?tabs=springboot&pivots=java-javase) app and adding an extra feature to make a request to an Azure OpenAI or OpenAI service. Add the following code to your application:
20+
For this Spring Boot application, you're building off the [quickstart](../../quickstart-java.md?tabs=springboot&pivots=java-javase) app and adding an extra feature to make a request to an Azure OpenAI or OpenAI service. Add the following code to your application:
2121

2222
```java
2323
@RequestMapping("/")
@@ -39,14 +39,14 @@ For Azure OpenAI, see [this documentation](/azure/ai-services/openai/quickstart?
3939
- `apiKey`
4040
- `deploymentName`
4141

42-
For OpenAI, see this [documentation](https://platform.openai.com/docs/api-reference) to retrieve the API keys. For our application, you need the following values:
42+
For OpenAI, see this [documentation](https://platform.openai.com/docs/api-reference) to retrieve the API keys. For this application, you need the following values:
4343

4444
- `apiKey`
4545
- `modelName`
4646

47-
Because we're deploying to App Service, we can secure these secrets in Azure Key Vault for protection. Follow the [quickstart](/azure/key-vault/secrets/quick-create-cli#create-a-key-vault) to set up your key vault and add the secrets you saved from earlier.
47+
Because you're deploying to App Service, you can put these secrets in Azure Key Vault for protection. Follow the [quickstart](/azure/key-vault/secrets/quick-create-cli#create-a-key-vault) to set up your key vault and add the secrets you saved from earlier.
4848

49-
Next, we can use key vault references as app settings in our App Service resource to reference in our application. Follow the instructions in the [documentation](../../app-service-key-vault-references.md?source=recommendations&tabs=azure-cli) to grant your app access to your key vault and to set up key vault references.
49+
Next, you can use key vault references as app settings in your App Service resource to reference in the application. Follow the instructions in the [documentation](../../app-service-key-vault-references.md?source=recommendations&tabs=azure-cli) to grant your app access to your key vault and to set up key vault references.
5050

5151
Then, go to the portal **Environment Variables** page in your resource and add the following app settings:
5252

@@ -106,11 +106,11 @@ Before you can create the client, you first need to add the Azure SDK dependency
106106
</dependency>
107107
```
108108

109-
After the package is created, we can start working on the client that makes our calls.
109+
After the package is created, you can start working on the client that makes your calls.
110110

111111
### Create OpenAI client
112112

113-
After the package and environment variables are set up, we can create the client that enables chat completion calls.
113+
After the package and environment variables are set up, you can create the client that enables chat completion calls.
114114

115115
Add the following code to create the OpenAI client:
116116

articles/app-service/includes/deploy-intelligent-apps/deploy-intelligent-apps-linux-node-pivot.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ ms.date: 09/30/2024
88
ms.author: jefmarti
99
---
1010

11-
You can use Azure App Service to create applications by using Azure OpenAI and OpenAI. In the following tutorial, we're adding Azure OpenAI Service to an Express application by using the Azure software development kit (SDK).
11+
You can use Azure App Service to create applications by using Azure OpenAI and OpenAI. In this article, you add Azure OpenAI Service to an Express application by using the Azure SDK.
1212

1313
#### Prerequisites
1414

1515
- An [Azure OpenAI resource](/azure/ai-services/openai/quickstart?pivots=programming-language-csharp&tabs=command-line%2Cpython#set-up) or an [OpenAI account](https://platform.openai.com/overview).
16-
- A Node.js Express application. Create the sample app by using our [quickstart](/azure/app-service/quickstart-nodejs?tabs=linux&pivots=development-environment-vscode).
16+
- A Node.js Express application. Create the sample app by using the [quickstart](/azure/app-service/quickstart-nodejs?tabs=linux&pivots=development-environment-vscode).
1717

1818
### Set up a web app
1919

20-
For this application, we're building off the [quickstart](/azure/app-service/quickstart-nodejs?tabs=linux&pivots=development-environment-vscode) Express app and adding an extra feature to make a request to an Azure OpenAI or OpenAI service.
20+
For this application, you're building off the [quickstart](/azure/app-service/quickstart-nodejs?tabs=linux&pivots=development-environment-vscode) Express app and adding an extra feature to make a request to an Azure OpenAI or OpenAI service.
2121

2222
First, copy and replace the `index.ejs` file with the following code:
2323

@@ -63,7 +63,7 @@ For OpenAI, see this documentation to retrieve the API keys. For our application
6363

6464
- `apiKey`
6565

66-
Because we're deploying to App Service, we can secure these secrets in Azure Key Vault for protection. Follow the [Quickstart](/azure/key-vault/secrets/quick-create-cli#create-a-key-vault) to set up your key vault and add the secrets that you saved from earlier.
66+
Because you're deploying to App Service, you can put these secrets in Azure Key Vault for protection. Follow the [Quickstart](/azure/key-vault/secrets/quick-create-cli#create-a-key-vault) to set up your key vault and add the secrets that you saved from earlier.
6767

6868
Next, we can use key vault references as app settings in our App Service resource to reference in our application. Follow the instructions in the [documentation](../../app-service-key-vault-references.md?source=recommendations&tabs=azure-cli) to grant your app access to your key vault and to set up key vault references.
6969

0 commit comments

Comments
 (0)