Skip to content

Commit 98969f3

Browse files
committed
openai
1 parent a5ba093 commit 98969f3

24 files changed

+51
-34
lines changed

articles/ai-services/openai/how-to/migration-javascript.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ const apiKey = new AzureKeyCredential("your API key");
5252

5353
Authenticating `AzureOpenAI` with an API key involves setting the `AZURE_OPENAI_API_KEY` environment variable or setting the `apiKey` string property in the options object when creating the `AzureOpenAI` client.
5454

55+
[!INCLUDE [Azure key vault](~/reusable-content/ce-skilling/azure/includes/ai-services/security/azure-key-vault.md)]
56+
5557
## Constructing the client
5658

5759
# [OpenAI JavaScript (new)](#tab/javascript-new)

articles/ai-services/openai/how-to/switching-endpoints.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ procedureSection:
2323
- title: |
2424
Authentication
2525
summary: |
26-
We recommend using environment variables. If you haven't done this before, our [Python quickstarts](../quickstart.md) walks you through this configuration.
26+
We recommend using Microsoft Entra ID or Azure Key Vault. You can use environment variables for testing outside of your production environment. If you haven't done this before, our [Python quickstarts](../quickstart.md) walks you through this configuration.
2727
2828
### API key
2929
code: |

articles/ai-services/openai/how-to/use-web-app.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ To enable Microsoft Entra ID for intra-service authentication for your web app,
9090

9191
You can enable managed identity for the Azure OpenAI resource and the Azure App Service by navigating to "Identity" and turning on the system assigned managed identity in the Azure portal for each resource.
9292

93-
9493
:::image type="content" source="../media/use-your-data/openai-managed-identity.png" alt-text="Screenshot that shows the application identity configuration in the Azure portal." lightbox="../media/use-your-data/openai-managed-identity.png":::
9594

9695
> [!NOTE]

articles/ai-services/openai/includes/assistants-javascript.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,12 @@ Go to your resource in the Azure portal. The **Keys and Endpoint** can be found
5858

5959
:::image type="content" source="../media/quickstarts/endpoint.png" alt-text="Screenshot of the overview blade for an OpenAI Resource in the Azure portal with the endpoint & access keys location circled in red." lightbox="../media/quickstarts/endpoint.png":::
6060

61-
Create and assign persistent environment variables for your key and endpoint.
62-
6361
[!INCLUDE [environment-variables](environment-variables.md)]
6462

6563
Add additional environment variables for the deployment name and API version:
6664
* `AZURE_OPENAI_DEPLOYMENT_NAME`: Your deployment name as shown in the Azure portal.
6765
* `OPENAI_API_VERSION`: Learn more about [API Versions](/azure/ai-services/openai/concepts/model-versions).
6866

69-
Create and assign persistent environment variables for your key and endpoint.
70-
7167
# [Command Line](#tab/command-line)
7268

7369
```cmd

articles/ai-services/openai/includes/assistants-python.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ Go to your resource in the Azure portal. The **Keys and Endpoint** can be found
6363

6464
:::image type="content" source="../media/quickstarts/endpoint.png" alt-text="Screenshot of the overview blade for an Azure OpenAI resource in the Azure portal with the endpoint & access keys location circled in red." lightbox="../media/quickstarts/endpoint.png":::
6565

66-
Create and assign persistent environment variables for your key and endpoint.
67-
6866
[!INCLUDE [environment-variables](environment-variables.md)]
6967

7068
## Create an assistant

articles/ai-services/openai/includes/assistants-rest.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ Go to your resource in the Azure portal. The **Endpoint and Keys** can be found
3535

3636
:::image type="content" source="../media/quickstarts/endpoint.png" alt-text="Screenshot of the overview blade for an Azure OpenAI resource in the Azure portal with the endpoint & access keys location circled in red." lightbox="../media/quickstarts/endpoint.png":::
3737

38-
Create and assign persistent environment variables for your key and endpoint.
39-
4038
[!INCLUDE [environment-variables](environment-variables.md)]
4139

4240
## REST API

articles/ai-services/openai/includes/batch/batch-python.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ For this article we'll create a file named `test.jsonl` and will copy the conten
6969

7070
Once your input file is prepared, you first need to upload the file to then be able to kick off a batch job. File upload can be done both programmatically or via the Studio. This example uses environment variables in place of the key and endpoint values. If you're unfamiliar with using environment variables with Python refer to one of our [quickstarts](../../chatgpt-quickstart.md) where the process of setting up the environment variables in explained step-by-step.
7171

72+
[!INCLUDE [Azure key vault](~/reusable-content/ce-skilling/azure/includes/ai-services/security/azure-key-vault.md)]
73+
7274
```python
7375
import os
7476
from openai import AzureOpenAI

articles/ai-services/openai/includes/batch/batch-rest.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ For this article we'll create a file named `test.jsonl` and will copy the conten
5858

5959
Once your input file is prepared, you first need to upload the file to then be able to kick off a batch job. File upload can be done both programmatically or via the Studio. This example uses environment variables in place of the key and endpoint values. If you're unfamiliar with using environment variables with Python refer to one of our [quickstarts](../../chatgpt-quickstart.md) where the process of setting up the environment variables in explained step-by-step.
6060

61+
[!INCLUDE [Azure key vault](~/reusable-content/ce-skilling/azure/includes/ai-services/security/azure-key-vault.md)]
62+
6163
```http
6264
curl -X POST https://YOUR_RESOURCE_NAME.openai.azure.com/openai/files?api-version=2024-07-01-preview \
6365
-H "Content-Type: multipart/form-data" \

articles/ai-services/openai/includes/chatgpt-powershell.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,17 @@ To successfully make a call against Azure OpenAI, you'll need an **endpoint** an
2727
| Variable name | Value |
2828
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2929
| `ENDPOINT` | This value can be found in the **Keys & Endpoint** section when examining your resource from the Azure portal. Alternatively, you can find the value in the **Azure OpenAI Studio** > **Playground** > **Code View**. An example endpoint is: `https://docs-test-001.openai.azure.com/`. |
30-
| `API-KEY` | This value can be found in the **Keys & Endpoint** section when examining your resource from the Azure portal. You can use either `KEY1` or `KEY2`. |
30+
| `API-KEY` | This value can be found in the **Keys & Endpoint** section when examining your resource from the Azure portal. You can use either `KEY1` or `KEY2`. |
3131

3232
Go to your resource in the Azure portal. The **Endpoint and Keys** can be found in the **Resource Management** section. Copy your endpoint and access key as you'll need both for authenticating your API calls. You can use either `KEY1` or `KEY2`. Always having two keys allows you to securely rotate and regenerate keys without causing a service disruption.
3333

3434
:::image type="content" source="../media/quickstarts/endpoint.png" alt-text="Screenshot of the overview UI for an Azure OpenAI resource in the Azure portal with the endpoint & access keys location circled in red." lightbox="../media/quickstarts/endpoint.png":::
3535

36+
### Environment variables
37+
3638
Create and assign persistent environment variables for your key and endpoint.
3739

38-
### Environment variables
40+
[!INCLUDE [Azure key vault](~/reusable-content/ce-skilling/azure/includes/ai-services/security/azure-key-vault.md)]
3941

4042
# [PowerShell](#tab/powershell)
4143

articles/ai-services/openai/includes/dall-e-python.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,8 @@ Go to your resource in the Azure portal. On the navigation pane, select **Keys a
4848

4949
:::image type="content" source="../media/quickstarts/endpoint.png" alt-text="Screenshot that shows the Keys and Endpoint page for an Azure OpenAI resource in the Azure portal." lightbox="../media/quickstarts/endpoint.png":::
5050

51-
Create and assign persistent environment variables for your key and endpoint.
52-
5351
[!INCLUDE [environment-variables](environment-variables.md)]
5452

55-
56-
5753
## Install the Python SDK
5854

5955

0 commit comments

Comments
 (0)