Skip to content

Commit a8af884

Browse files
committed
more steps
1 parent 6617f4d commit a8af884

File tree

5 files changed

+47
-26
lines changed

5 files changed

+47
-26
lines changed

articles/ai-services/openai/how-to/use-your-data-securely.md

Lines changed: 47 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -163,27 +163,36 @@ So far you have already setup each resource work independently. Next you will ne
163163

164164
See the [Azure RBAC documentation](/azure/role-based-access-control/role-assignments-portal) for instructions on setting these roles in the Azure portal. You can use the [available script onGitHub](https://github.com/microsoft/sample-app-aoai-chatGPT/blob/main/scripts/role_assignment.sh) to add the role assignments programmatically. You need to have the `Owner` role on these resources to do role assignments.
165165

166-
# Using API
167-
## Local test setup
166+
## Using the API
167+
168+
169+
### Local test setup
170+
168171
Make sure your login credential has `Cognitive Services OpenAI Contributor` role on your Azure OpenAI resource.
169-
![image.png](/.attachments/image-bd6bee15-d7bd-4963-9200-9a600cd715e8.png)
170172

171-
Also, make sure your dev box IP is whitelisted in IP rules, so you can call the Azure OpenAI data plane API.
172-
![image.png](/.attachments/image-1cfa9917-05a6-4682-877c-1ab40187b26e.png)
173+
:::image type="content" source="../media/use-your-data/api-local-test-setup-credential.png" alt-text="A screenshot showing roles for accounts in the Azure portal." lightbox="../media/use-your-data/api-local-test-setup-credential.png":::
174+
175+
Also, make sure that the IP your development machine is whitelisted in the IP rules, so you can call the Azure OpenAI API.
176+
177+
:::image type="content" source="../media/use-your-data/ip-rules-azure-portal.png" alt-text="A screenshot showing roles for accounts in the Azure portal." lightbox="../media/use-your-data/ip-rules-azure-portal.png":::
173178

174179
## Ingestion API
175-
Official document: https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#start-an-ingestion-job
180+
181+
182+
See the [ingestion API reference article](/azure/ai-services/openai/reference#start-an-ingestion-job) for details on the request and response objects used by the ingestion API.
176183

177184
Additional notes:
178-
* JOB_NAME in the API path will be used as the index name in Azure AI Search.
179-
* Use `Authorization` header rather than api-key.
180-
* Explicitly set `storageEndpoint` header, this is required if the `storageConnectionString` is in key-less format - starts with `ResourceId=`.
181-
* Use `ResourceId=` format as `storageConnectionString`. This indicate Azure OpenAI and Azure AI Search to use managed identity to authenticate Storage Account, which is required to bypass network restriction.
182-
* NOT to set `searchServiceAdminKey` header. The system-assigned identity of the Azure OpenAI resource will be used to authenticate Azure AI Search.
183-
* NOT to set `embeddingEndpoint` or `embeddingKey`. Instead, to enable text vectorization, use `embeddingDeploymentName` header.
184185

186+
* `JOB_NAME` in the API path will be used as the index name in Azure AI Search.
187+
* Use the `Authorization` header rather than api-key.
188+
* Explicitly set `storageEndpoint` header, this is required if the `storageConnectionString` is in keyless format. It starts with `ResourceId=`.
189+
* Use `ResourceId=` format for `storageConnectionString`. This indicates that Azure OpenAI and Azure AI Search will use managed identity to authenticate the storage account, which is required to bypass network restrictions.
190+
* **Do not** set the `searchServiceAdminKey` header. The system-assigned identity of the Azure OpenAI resource will be used to authenticate Azure AI Search.
191+
* **Do not** set `embeddingEndpoint` or `embeddingKey`. Instead, use the `embeddingDeploymentName` header to enable text vectorization.
192+
193+
194+
**Submit job example**
185195

186-
Submit job example:
187196
```bash
188197
accessToken=$(az account get-access-token --resource https://cognitiveservices.azure.com/ --query "accessToken" --output tsv)
189198
curl -i -X PUT https://wednesday-tip-vnet.openai.azure.com/openai/extensions/on-your-data/ingestion-jobs/vpn1025a?api-version=2023-10-01-preview \
@@ -200,7 +209,9 @@ curl -i -X PUT https://wednesday-tip-vnet.openai.azure.com/openai/extensions/on-
200209
}
201210
'
202211
```
203-
Get job status example:
212+
213+
**Get job status example**
214+
204215
```bash
205216
accessToken=$(az account get-access-token --resource https://cognitiveservices.azure.com/ --query "accessToken" --output tsv)
206217
curl -i -X GET https://wednesday-tip-vnet.openai.azure.com/openai/extensions/on-your-data/ingestion-jobs/vpn1025a?api-version=2023-10-01-preview \
@@ -209,13 +220,16 @@ curl -i -X GET https://wednesday-tip-vnet.openai.azure.com/openai/extensions/on-
209220
```
210221

211222
## Inference API
212-
Official document: https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#completions-extensions
213223

214-
Notes:
215-
* NOT to set `dataSources[0].parameters.key`. The service will use system assigned managed identity to authenticate the Azure AI Search.
216-
* NOT to set `embeddingEndpoint` or `embeddingKey`. Instead, to enable vector search (with `queryType` set properly), use `embeddingDeploymentName`.
224+
See the [inference API reference article](/azure/ai-services/openai/reference#completions-extensions) for details on the request and response objects used by the inference API.
225+
226+
Additional notes:
227+
228+
* **Do not** set `dataSources[0].parameters.key`. The service will use system assigned managed identity to authenticate the Azure AI Search.
229+
* **Do not** set `embeddingEndpoint` or `embeddingKey`. Instead, to enable vector search (with `queryType` set properly), use `embeddingDeploymentName`.
217230

218231
Example:
232+
219233
```bash
220234
accessToken=$(az account get-access-token --resource https://cognitiveservices.azure.com/ --query "accessToken" --output tsv)
221235
curl -i -X POST https://wednesday-test-usnc.openai.azure.com/openai/deployments/turbo/extensions/chat/completions?api-version=2023-10-01-preview \
@@ -245,12 +259,19 @@ curl -i -X POST https://wednesday-test-usnc.openai.azure.com/openai/deployments/
245259
'
246260
```
247261

248-
# Studio
249-
You should be able to use all Studio features, including both ingestion and inference.
262+
# Azure OpenAI Studio
263+
264+
You should be able to use all Azure OpenAI Studio features, including both ingestion and inference.
265+
266+
# Web app
267+
The web app published from the Studio will communicate with Azure OpenAI. If Azure OpenAI is network restricted, the web app need to be setup correctly for outbound networking.
268+
269+
1. Set Azure OpenAI allow inbound traffic from your virtual network.
270+
271+
:::image type="content" source="../media/use-your-data/web-app-configure-inbound-traffic.png" alt-text="A screenshot showing inbound traffic configuration for the web app." lightbox="../media/use-your-data/web-app-configure-inbound-traffic.png":::
272+
273+
1. Configure the web app for outbound virtual network integration
274+
275+
:::image type="content" source="../media/use-your-data/web-app-configure-outbound-traffic.png" alt-text="A screenshot showing outbound traffic configuration for the web app." lightbox="../media/use-your-data/web-app-configure-outbound-traffic.png":::
276+
250277

251-
# Web App
252-
The web app published from the Studio will talk to Azure OpenAI. If Azure OpenAI is network restricted, web app need to be setup correctly for the outbound networking.
253-
Step 1: Azure OpenAI allow inbound traffic from selected virtual network
254-
![image.png](/.attachments/image-197e82de-16b3-43bd-9b92-feb7b7b65999.png)
255-
Step 2: Web app configure outbound virtual network integration
256-
![image.png](/.attachments/image-c2065895-7d6e-4cec-abf1-024575144dfa.png)
166 KB
Loading
143 KB
Loading
158 KB
Loading
81 KB
Loading

0 commit comments

Comments
 (0)