Skip to content

Commit b9fdcd2

Browse files
committed
aoai freshness
1 parent 8895338 commit b9fdcd2

File tree

7 files changed

+30
-73
lines changed

7 files changed

+30
-73
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: azure-ai-openai
88
ms.topic: include
99
author: PatrickFarley
1010
ms.author: pafarley
11-
ms.date: 08/16/2023
11+
ms.date: 06/26/2024
1212
---
1313

1414
Use this guide to get started generating images with the Azure OpenAI SDK for C#.
@@ -24,9 +24,9 @@ Use this guide to get started generating images with the Azure OpenAI SDK for C#
2424
- An Azure OpenAI resource created in the East US region. For more information, see [Create a resource and deploy a model with Azure OpenAI](../how-to/create-resource.md).
2525

2626
> [!NOTE]
27-
> Currently, you must submit an application to access Azure OpenAI Service. To apply for access, complete [this form](https://aka.ms/oai/access). If you need assistance, open an issue on this repo to contact Microsoft.
27+
> Currently, you must submit an application to access Azure OpenAI Service. To apply for access, complete the form at [https://aka.ms/oai/access](https://aka.ms/oai/access?azure-portal=true). If you need assistance, open an issue on this repo to contact Microsoft.
2828
29-
## Set up
29+
## Setup
3030

3131
[!INCLUDE [get-key-endpoint](get-key-endpoint.md)]
3232

@@ -67,7 +67,7 @@ dotnet add package Azure.AI.OpenAI --version 1.0.0-beta.6
6767

6868
## Generate images with DALL-E
6969

70-
From the project directory, open the *program.cs* file and replace with the following code:
70+
From the project directory, open the *program.cs* file and replace the contents with the following code:
7171

7272
```csharp
7373
using System;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ Use this guide to get started generating images with the Azure OpenAI SDK for Go
2222
- An Azure OpenAI resource created in the East US region. For more information, see [Create a resource and deploy a model with Azure OpenAI](../how-to/create-resource.md).
2323

2424
> [!NOTE]
25-
> Currently, you must submit an application to access Azure OpenAI Service. To apply for access, complete [this form](https://aka.ms/oai/access). If you need assistance, open an issue on this repo to contact Microsoft.
25+
> Currently, you must submit an application to access Azure OpenAI Service. To apply for access, complete the form at <a href="https://aka.ms/oai/access" target="_blank">https://aka.ms/oai/access</a>. If you need assistance, open an issue on this repo to contact Microsoft.
2626
27-
## Set up
27+
## Setup
2828

2929
[!INCLUDE [get-key-endpoint](get-key-endpoint.md)]
3030

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ Use this guide to get started generating images with the Azure OpenAI SDK for Ja
2525
- An Azure OpenAI resource created in the East US region. For more information, see [Create a resource and deploy a model with Azure OpenAI](../how-to/create-resource.md).
2626

2727
> [!NOTE]
28-
> Currently, you must submit an application to access Azure OpenAI Service. To apply for access, complete [this form](https://aka.ms/oai/access). If you need assistance, open an issue on this repo to contact Microsoft.
28+
> Currently, you must submit an application to access Azure OpenAI Service. To apply for access, complete the form at [https://aka.ms/oai/access](https://aka.ms/oai/access?azure-portal=true). If you need assistance, open an issue on this repo to contact Microsoft.
2929
30-
## Set up
30+
## Setup
3131

3232
[!INCLUDE [get-key-endpoint](get-key-endpoint.md)]
3333

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Use this guide to get started generating images with the Azure OpenAI SDK for Ja
2626
> [!NOTE]
2727
> Currently, you must submit an application to access Azure OpenAI Service. To apply for access, complete [this form](https://aka.ms/oai/access). If you need assistance, open an issue on this repo to contact Microsoft.
2828
29-
## Set up
29+
## Setup
3030

3131
[!INCLUDE [get-key-endpoint](get-key-endpoint.md)]
3232

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

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -24,54 +24,11 @@ Use this guide to get started calling the Azure OpenAI Service image generation
2424
> [!NOTE]
2525
> Currently, you must submit an application to access Azure OpenAI Service. To apply for access, complete [this form](https://aka.ms/oai/access). If you need assistance, open an issue on this repo to contact Microsoft.
2626
27-
## Retrieve key and endpoint
27+
## Setup
2828

29-
To successfully call the Azure OpenAI APIs, you need the following information about your Azure OpenAI resource:
29+
[!INCLUDE [get-key-endpoint](get-key-endpoint.md)]
3030

31-
| Variable | Name | Value |
32-
| ------------ | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
33-
| **Endpoint** | `api_base` | The endpoint value is located under **Keys and Endpoint** for your resource in the Azure portal. Alternatively, you can find the value in **Azure OpenAI Studio** > **Playground** > **Code View**. An example endpoint is: `https://docs-test-001.openai.azure.com/`. |
34-
| **Key** | `api_key` | The key value is also located under **Keys and Endpoint** for your resource in the Azure portal. Azure generates two keys for your resource. You can use either value. |
35-
36-
Go to your resource in the Azure portal. On the navigation pane, select **Keys and Endpoint** under **Resource Management**. Copy the **Endpoint** value and an access key value. You can use either the **KEY 1** or **KEY 2** value. Always having two keys allows you to securely rotate and regenerate keys without causing a service disruption.
37-
38-
:::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":::
39-
40-
Create and assign persistent environment variables for your key and endpoint.
41-
42-
### Environment variables
43-
44-
# [PowerShell](#tab/powershell)
45-
46-
```powershell
47-
$Env:AZURE_OPENAI_API_KEY = 'YOUR_KEY_VALUE'
48-
```
49-
50-
```powershell
51-
$Env:AZURE_OPENAI_ENDPOINT = 'YOUR_ENDPOINT'
52-
```
53-
54-
# [Command Line](#tab/command-line)
55-
56-
```CMD
57-
setx AZURE_OPENAI_API_KEY "REPLACE_WITH_YOUR_KEY_VALUE_HERE"
58-
```
59-
60-
```CMD
61-
setx AZURE_OPENAI_ENDPOINT "REPLACE_WITH_YOUR_ENDPOINT_HERE"
62-
```
63-
64-
# [Bash](#tab/bash)
65-
66-
```Bash
67-
echo export AZURE_OPENAI_API_KEY="REPLACE_WITH_YOUR_KEY_VALUE_HERE" >> /etc/environment && source /etc/environment
68-
```
69-
70-
```Bash
71-
echo export AZURE_OPENAI_ENDPOINT="REPLACE_WITH_YOUR_ENDPOINT_HERE" >> /etc/environment && source /etc/environment
72-
```
73-
74-
---
31+
[!INCLUDE [environment-variables](environment-variables.md)]
7532

7633
> [!div class="nextstepaction"]
7734
> [I ran into an issue with the setup.](https://microsoft.qualtrics.com/jfe/form/SV_0Cl5zkG3CnDjq6O?PLanguage=POWERSHELL&Pillar=AOAI&Product=Chatgpt&Page=quickstart&Section=Set-up)

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,24 @@ Use this guide to get started generating images with the Azure OpenAI SDK for Py
2020
#### [DALL-E 3](#tab/dalle3)
2121

2222
- An Azure subscription. <a href="https://azure.microsoft.com/free/ai-services" target="_blank">Create one for free</a>.
23-
- Access granted to DALL-E in the desired Azure subscription.
23+
- Access granted to DALL-E in the desired Azure subscription. You can apply for access to Azure OpenAI Service by completing the form at [https://aka.ms/oai/access](https://aka.ms/oai/access?azure-portal=true).
2424
- <a href="https://www.python.org/" target="_blank">Python 3.8 or later version</a>.
2525
- An Azure OpenAI resource created in the `EastUS`, `AustraliaEast`, or `SwedenCentral` region.
2626
- Then, you need to deploy a `dalle3` model with your Azure resource. For more information, see [Create a resource and deploy a model with Azure OpenAI](../how-to/create-resource.md).
2727

2828
#### [DALL-E 2 (preview)](#tab/dalle2)
2929

3030
- An Azure subscription. <a href="https://azure.microsoft.com/free/ai-services" target="_blank">Create one for free</a>.
31-
- Access granted to DALL-E in the desired Azure subscription.
31+
- Access granted to DALL-E in the desired Azure subscription. You can apply for access to Azure OpenAI Service by completing the form at [https://aka.ms/oai/access](https://aka.ms/oai/access?azure-portal=true).
3232
- <a href="https://www.python.org/" target="_blank">Python 3.8 or later version</a>.
3333
- An Azure OpenAI resource created in the `EastUS` region. For more information, see [Create a resource and deploy a model with Azure OpenAI](../how-to/create-resource.md).
3434

3535
---
3636

3737
> [!NOTE]
38-
> Currently, you must submit an application to access Azure OpenAI Service. To apply for access, complete [this form](https://aka.ms/oai/access). If you need assistance, open an issue on this repo to contact Microsoft.
38+
> Currently, you must submit an application to access Azure OpenAI Service. To apply for access, complete the form at [https://aka.ms/oai/access](https://aka.ms/oai/access?azure-portal=true). If you need assistance, open an issue on this repo to contact Microsoft.
3939
40-
## Set up
40+
## Setup
4141

4242
### Retrieve key and endpoint
4343

@@ -57,14 +57,11 @@ Create and assign persistent environment variables for your key and endpoint.
5757
[!INCLUDE [environment-variables](environment-variables.md)]
5858

5959

60-
## Create a new Python application
61-
62-
Open a command prompt and browse to your project folder. Create a new python file, _quickstart.py_.
6360

6461
## Install the Python SDK
6562

6663

67-
Install the OpenAI Python SDK by using the following command:
64+
Open a command prompt and browse to your project folder. Install the OpenAI Python SDK by using the following command:
6865

6966
#### [DALL-E 3](#tab/dalle3)
7067

@@ -89,9 +86,10 @@ pip install requests
8986
pip install pillow
9087
```
9188

89+
9290
## Generate images with DALL-E
9391

94-
Open _quickstart.py in your preferred editor or IDE.
92+
Create a new python file, _quickstart.py_. Open it in your preferred editor or IDE.
9593

9694
Replace the contents of _quickstart.py_ with the following code.
9795

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Use this guide to get started calling the Azure OpenAI Service image generation
1919

2020
- An Azure subscription. <a href="https://azure.microsoft.com/free/ai-services" target="_blank">Create one for free</a>.
2121
- Access granted to DALL-E in the desired Azure subscription.
22+
Currently, access to this service is granted only by application. You can apply for access to Azure OpenAI by completing the form at <a href="https://aka.ms/oai/access" target="_blank">https://aka.ms/oai/access</a>. Existing Azure OpenAI customers need to re-enter the form to get access to DALL-E. Open an issue on this repo to contact us if you have an issue.
2223
- <a href="https://www.python.org/" target="_blank">Python 3.8 or later version</a>.
2324
- The following Python libraries installed: `os`, `requests`, `json`.
2425
- An Azure OpenAI resource created in the `EastUS`, `AustraliaEast`, or `SwedenCentral` region.
@@ -28,16 +29,18 @@ Use this guide to get started calling the Azure OpenAI Service image generation
2829

2930
- An Azure subscription. <a href="https://azure.microsoft.com/free/ai-services" target="_blank">Create one for free</a>.
3031
- Access granted to DALL-E in the desired Azure subscription.
32+
Currently, access to this service is granted only by application. You can apply for access to Azure OpenAI by completing the form at <a href="https://aka.ms/oai/access" target="_blank">https://aka.ms/oai/access</a>. Existing Azure OpenAI customers need to re-enter the form to get access to DALL-E. Open an issue on this repo to contact us if you have an issue.
3133
- <a href="https://www.python.org/" target="_blank">Python 3.8 or later version</a>.
3234
- The following Python libraries installed: `os`, `requests`, `json`.
3335
- An Azure OpenAI resource created in the East US region. For more information, see [Create a resource and deploy a model with Azure OpenAI](../how-to/create-resource.md).
3436

3537
---
3638

3739
> [!NOTE]
38-
> Currently, you must submit an application to access Azure OpenAI Service. To apply for access, complete [this form](https://aka.ms/oai/access). If you need assistance, open an issue on this repo to contact Microsoft.
40+
> Currently, you must submit an application to access Azure OpenAI Service. To apply for access, complete the form at <a href="https://aka.ms/oai/access" target="_blank">https://aka.ms/oai/access</a>. If you need assistance, open an issue on this repo to contact Microsoft.
3941
40-
## Retrieve key and endpoint
42+
## Setup
43+
### Retrieve key and endpoint
4144

4245
To successfully call the Azure OpenAI APIs, you need the following information about your Azure OpenAI resource:
4346

@@ -50,14 +53,13 @@ Go to your resource in the Azure portal. On the navigation pane, select **Keys a
5053

5154
:::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":::
5255

56+
[!INCLUDE [environment-variables](environment-variables.md)]
5357

5458
## Create a new Python application
5559

5660
Create a new Python file named _quickstart.py_. Open the new file in your preferred editor or IDE.
5761

58-
1. Replace the contents of _quickstart.py_ with the following code. Enter your endpoint URL and key in the appropriate fields. Change the value of `prompt` to your preferred text.
59-
60-
62+
1. Replace the contents of _quickstart.py_ with the following code. Change the value of `prompt` to your preferred text.
6163

6264
#### [DALL-E 3](#tab/dalle3)
6365

@@ -67,8 +69,8 @@ Create a new Python file named _quickstart.py_. Open the new file in your prefer
6769
import requests
6870
import time
6971
import os
70-
api_base = '<your_endpoint>' # Enter your endpoint here
71-
api_key = '<your_key>' # Enter your API key here
72+
api_base = os.environ['AZURE_OPENAI_ENDPOINT'] # Enter your endpoint here
73+
api_key = os.environ['AZURE_OPENAI_API_KEY'] # Enter your API key here
7274

7375
api_version = '2024-02-01'
7476
url = f"{api_base}/openai/deployments/<dalle3>/images/generations?api-version={api_version}"
@@ -97,8 +99,8 @@ Create a new Python file named _quickstart.py_. Open the new file in your prefer
9799
import time
98100
import os
99101

100-
api_base = '<your_endpoint>' # Enter your endpoint here
101-
api_key = '<your_key>' # Enter your API key here
102+
api_base = os.environ['AZURE_OPENAI_ENDPOINT'] # Enter your endpoint here
103+
api_key = os.environ['AZURE_OPENAI_API_KEY'] # Enter your API key here
102104

103105
# Assign the API version (DALL-E is currently supported for the 2023-06-01-preview API version only)
104106
api_version = '2023-06-01-preview'

0 commit comments

Comments
 (0)