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/app-service/includes/deploy-intelligent-apps/deploy-intelligent-apps-linux-dotnet-pivot.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -162,7 +162,7 @@ In this step, you add the using statement and create the kernel in a method that
162
162
163
163
## 4. Add your AI service
164
164
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.
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 a managed identity with Azure OpenAI, add the service by using the example in the next section.
If you're using Azure OpenAI, we highly recommend that you secure your application by using [managed identity](../../overview-managed-identity.md) to authenticate your app to your Azure OpenAI resource. This process enables your application to access the Azure OpenAI resource without managing API keys. If you're not using Azure OpenAI, your secrets can remain secure by using Azure Key Vault as outlined previously.
194
+
If you're using Azure OpenAI, we highly recommend that you secure your application by using a [managed identity](../../overview-managed-identity.md) to authenticate your app to your Azure OpenAI resource. This process enables your application to access the Azure OpenAI resource without managing API keys. If you're not using Azure OpenAI, your secrets can remain secure by using Azure Key Vault as outlined previously.
195
195
196
-
Complete the following tasks to secure your application with managed identity:
196
+
Complete the following tasks to secure your application with a managed identity.
197
197
198
198
Add the identity package `Azure.Identity`. By using this package, you can use Azure credentials in your app. Install the package by using NuGet package manager and add the using statement to the top of the `OpenAI.razor` file.
199
199
@@ -215,13 +215,13 @@ var kernel = Kernel.CreateBuilder()
215
215
216
216
After the credentials are added to the application, you'll need to enable a managed identity in your application and grant access to the resource.
217
217
218
-
1. In your web app resource, go to the **Identity** pane and turn on **System assigned** and select **Save**.
218
+
1. In your web app resource, go to the **Identity** pane and turn on **System assigned**, and then select **Save**.
219
219
1. After **System assigned** identity is turned on, it registers the web app with Microsoft Entra ID. The web app can be granted permissions to access protected resources.
220
-
1. Go to your Azure OpenAI resource and go to the **Access control (IAM)** pane on the left pane.
220
+
1. Go to your Azure OpenAI resource, and then go to **Access control (IAM)** on the left pane.
221
221
1. Find the **Grant access to this resource** card and select **Add role assignment**.
222
222
1. Search for the **Cognitive Services OpenAI User** role and select **Next**.
223
223
1. On the **Members** tab, find **Assign access to** and choose the **Managed identity** option.
224
-
1.Next, choose**+Select Members** and find your web app.
224
+
1.Choose**+Select Members** and find your web app.
225
225
1. Select **Review + assign**.
226
226
227
227
Your web app is now added as a cognitive service OpenAI user and can communicate to your Azure OpenAI resource.
Copy file name to clipboardExpand all lines: articles/app-service/includes/deploy-intelligent-apps/deploy-intelligent-apps-linux-java-pivot.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,13 +33,13 @@ For this Spring Boot application, you're building off the [quickstart](../../qui
33
33
34
34
Get the keys and endpoint values from Azure OpenAI or OpenAI and add them as secrets to use in your application. Retrieve and save the values for later use to build the client.
35
35
36
-
For Azure OpenAI, see [this documentation](/azure/ai-services/openai/quickstart?pivots=programming-language-csharp&tabs=command-line%2Cpython#retrieve-key-and-endpoint) to retrieve the key and endpoint values. If you're planning to use [managed identity](../../overview-managed-identity.md) to secure your app, you need only the `endpoint` value. Otherwise, you need each of the following values:
36
+
For Azure OpenAI, see [this documentation](/azure/ai-services/openai/quickstart?pivots=programming-language-csharp&tabs=command-line%2Cpython#retrieve-key-and-endpoint) to retrieve the key and endpoint values. If you're planning to use a [managed identity](../../overview-managed-identity.md) to secure your app, you need only the `endpoint` value. Otherwise, you need each of the following values:
37
37
38
38
-`endpoint`
39
39
-`apiKey`
40
40
-`deploymentName`
41
41
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:
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:
43
43
44
44
-`apiKey`
45
45
-`modelName`
@@ -48,7 +48,7 @@ Because you're deploying to App Service, you can put these secrets in Azure Key
48
48
49
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.
50
50
51
-
Then, go to the portal **Environment Variables** page in your resource and add the following app settings:
51
+
Then, go to the portal **Environment Variables** page in your resource and add the following app settings.
Although optional, we highly recommended that you secure your application using [managed identity](../../overview-managed-identity.md) to authenticate your app to your Azure OpenAI resource. This process enables your application to access the Azure OpenAI resource without managing API keys. Skip this step if you're not using Azure OpenAI.
144
+
Although optional, we highly recommend that you secure your application by using a[managed identity](../../overview-managed-identity.md) to authenticate your app to your Azure OpenAI resource. This process enables your application to access the Azure OpenAI resource without managing API keys. Skip this step if you're not using Azure OpenAI.
145
145
146
146
To secure your application, complete the following steps:
147
147
@@ -158,13 +158,13 @@ OpenAIClient client = new OpenAIClientBuilder()
158
158
159
159
After the credentials are added to the application, enable a managed identity in your application and grant access to the resource:
160
160
161
-
1. In your web app resource, go to the **Identity** pane and turn on **System assigned** and select **Save**.
161
+
1. In your web app resource, go to the **Identity** pane and turn on **System assigned**, and then select **Save**.
162
162
1. After system-assigned identity is turned on, it will register the web app with Microsoft Entra ID and the web app can be granted permissions to access protected resources.
163
-
1. Go to your Azure OpenAI resource and go to the **Access control (IAM)** page on the left pane.
163
+
1. Go to your Azure OpenAI resource, and then go to **Access control (IAM)** on the left pane.
164
164
1. Find the **Grant access to this resource** card and select **Add role assignment**.
165
165
1. Search for the **Cognitive Services OpenAI User** role and select **Next**.
166
166
1. On the **Members** tab, find **Assign access to** and choose the **Managed identity** option.
167
-
1.Next, choose**+Select Members** and find your web app.
167
+
1.Choose**+Select Members** and find your web app.
168
168
1. Select **Review + assign**.
169
169
170
170
Your web app is now added as a cognitive service OpenAI user and can communicate to your Azure OpenAI resource.
Copy file name to clipboardExpand all lines: articles/app-service/includes/deploy-intelligent-apps/deploy-intelligent-apps-linux-node-pivot.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,13 +42,13 @@ First, copy and replace the `index.ejs` file with the following code:
42
42
</html>
43
43
```
44
44
45
-
The preceding code adds an input box to our index page to submit requests to OpenAI.
45
+
The preceding code adds an input box to the index page to submit requests to OpenAI.
46
46
47
47
### API keys and endpoints
48
48
49
49
Get the keys and endpoint values from Azure OpenAI or OpenAI and add them as secrets for use in your application. Retrieve and save the values for later use to build the client.
50
50
51
-
For Azure OpenAI, see [this documentation](/azure/ai-services/openai/quickstart?pivots=programming-language-csharp&tabs=command-line%2Cpython#retrieve-key-and-endpoint) to retrieve the key and endpoint values. If you're planning to use managed identity to secure your app, you need only the `deploymentName` and `apiVersion` values.
51
+
For Azure OpenAI, see [this documentation](/azure/ai-services/openai/quickstart?pivots=programming-language-csharp&tabs=command-line%2Cpython#retrieve-key-and-endpoint) to retrieve the key and endpoint values. If you're planning to use a managed identity to secure your app, you need only the `deploymentName` and `apiVersion` values.
52
52
53
53
Otherwise, you need each of the following values:
54
54
@@ -59,15 +59,15 @@ For Azure OpenAI, use the following settings:
59
59
-`deploymentName`
60
60
-`apiVersion`
61
61
62
-
For OpenAI, see this documentation to retrieve the API keys. For our application, you need the following values:
62
+
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:
63
63
64
64
-`apiKey`
65
65
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.
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.
67
67
68
-
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.
68
+
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.
69
69
70
-
Then, go to the portal **Environment Variables** page in your resource and add the following app settings:
70
+
Then, go to the portal **Environment Variables** page in your resource and add the following app settings.
Before you can create the client, add the Azure OpenAI package. Add the following OpenAI package by using the node package manager.
107
+
Before you can create the client, add the Azure OpenAI package. Add the following OpenAI package by using the Node package manager.
108
108
109
109
For Azure OpenAI:
110
110
@@ -120,7 +120,7 @@ npm install openai
120
120
121
121
### Create OpenAI client
122
122
123
-
After the package and environment variables are set up, we can create the client that enables chat completion calls.
123
+
After the package and environment variables are set up, you can create the client that enables chat completion calls.
124
124
125
125
Add the following code to create the OpenAI client:
126
126
@@ -147,11 +147,11 @@ import OpenAI from 'openai';
147
147
});
148
148
```
149
149
150
-
### Secure your app by using managed identity
150
+
### Secure your app by using a managed identity
151
151
152
-
Although optional, we highly recommend that you secure your application by using [managed identity](../../overview-managed-identity.md) to authenticate your app to your Azure OpenAI resource. This process enables your application to access the Azure OpenAI resource without needing to manage API keys. Skip this step if you're not using Azure OpenAI.
152
+
Although optional, we highly recommend that you secure your application by using a [managed identity](../../overview-managed-identity.md) to authenticate your app to your Azure OpenAI resource. This process enables your application to access the Azure OpenAI resource without needing to manage API keys. Skip this step if you're not using Azure OpenAI.
153
153
154
-
To secure your application, complete the following tasks:
154
+
To secure your application, complete the following tasks.
155
155
156
156
Install the Azure identity package using the Node package manager.
157
157
@@ -179,18 +179,18 @@ After the credentials are added to the application, enable a managed identity in
179
179
180
180
1. In your web app resource, go to the **Identity** pane and turn on **System assigned**. Select **Save**.
181
181
1. After system-assigned identity is turned on, it will register the web app with Microsoft Entra ID and the web app can be granted permissions to access protected resources.
182
-
1. Go to your Azure OpenAI resource and go to the**Access control (IAM)**page on the left pane.
182
+
1. Go to your Azure OpenAI resource, and then go to **Access control (IAM)** on the left pane.
183
183
1. Find the **Grant access to this resource** card and select **Add role assignment**.
184
184
1. Search for the **Cognitive Services OpenAI User** role and select **Next**.
185
185
1. On the **Members** tab, find **Assign access to** and choose the **Managed identity** option.
186
-
1.Next, choose**+Select Members** and find your web app.
186
+
1.Choose**+Select Members** and find your web app.
187
187
1. Select **Review + assign**.
188
188
189
189
Your web app is now added as a cognitive service OpenAI user and can communicate to your Azure OpenAI resource.
190
190
191
191
### Set up a prompt and call to OpenAI
192
192
193
-
We can use chat completions to send our request message to OpenAI and return a response. Add your chat message prompt to the code to be passed to the chat completions method. Use the following code to set up chat completions:
193
+
You can use chat completions to send your request message to OpenAI and return a response. Add your chat message prompt to the code to be passed to the chat completions method. Use the following code to set up chat completions:
0 commit comments