Skip to content

Commit acf99b3

Browse files
committed
use includes in quickstarts
1 parent 3960975 commit acf99b3

18 files changed

+101
-640
lines changed

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

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -60,53 +60,10 @@ Install the OpenAI .NET client library with:
6060
dotnet add package Azure.AI.OpenAI --prerelease
6161
```
6262

63-
### Retrieve key and endpoint
63+
[!INCLUDE [get-key-endpoint](get-key-endpoint.md)]
6464

65-
To successfully make a call against Azure OpenAI, you need an **endpoint** and a **key**.
65+
[!INCLUDE [environment-variables](environment-variables.md)]
6666

67-
|Variable name | Value |
68-
|--------------------------|-------------|
69-
| `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/`.|
70-
| `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`.|
71-
72-
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.
73-
74-
:::image type="content" source="../media/quickstarts/endpoint.png" alt-text="Screenshot of the overview UI for an OpenAI Resource in the Azure portal with the endpoint and access keys location circled in red." lightbox="../media/quickstarts/endpoint.png":::
75-
76-
Create and assign persistent environment variables for your key and endpoint.
77-
78-
### Environment variables
79-
80-
# [Command Line](#tab/command-line)
81-
82-
```CMD
83-
setx AZURE_OPENAI_KEY "REPLACE_WITH_YOUR_KEY_VALUE_HERE"
84-
```
85-
86-
```CMD
87-
setx AZURE_OPENAI_ENDPOINT "REPLACE_WITH_YOUR_ENDPOINT_HERE"
88-
```
89-
90-
# [PowerShell](#tab/powershell)
91-
92-
```powershell
93-
[System.Environment]::SetEnvironmentVariable('AZURE_OPENAI_KEY', 'REPLACE_WITH_YOUR_KEY_VALUE_HERE', 'User')
94-
```
95-
96-
```powershell
97-
[System.Environment]::SetEnvironmentVariable('AZURE_OPENAI_ENDPOINT', 'REPLACE_WITH_YOUR_ENDPOINT_HERE', 'User')
98-
```
99-
100-
# [Bash](#tab/bash)
101-
102-
```Bash
103-
echo export AZURE_OPENAI_KEY="REPLACE_WITH_YOUR_KEY_VALUE_HERE" >> /etc/environment && source /etc/environment
104-
```
105-
106-
```Bash
107-
echo export AZURE_OPENAI_ENDPOINT="REPLACE_WITH_YOUR_ENDPOINT_HERE" >> /etc/environment && source /etc/environment
108-
```
109-
---
11067

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

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

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -69,53 +69,10 @@ mkdir "quickstart/src/main/java/com/azure/ai/openai/usage"
6969
</project>
7070
```
7171

72-
### Retrieve key and endpoint
72+
[!INCLUDE [get-key-endpoint](get-key-endpoint.md)]
7373

74-
To successfully make a call against Azure OpenAI, you need an **endpoint** and a **key**.
74+
[!INCLUDE [environment-variables](environment-variables.md)]
7575

76-
|Variable name | Value |
77-
|--------------------------|-------------|
78-
| `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 AI Studio** > **Playground** > **Code View**. An example endpoint is: `https://docs-test-001.openai.azure.com/`.|
79-
| `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`.|
80-
81-
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.
82-
83-
:::image type="content" source="../media/quickstarts/endpoint.png" alt-text="Screenshot of the overview UI for an OpenAI Resource in the Azure portal with the endpoint and access keys location circled in red." lightbox="../media/quickstarts/endpoint.png":::
84-
85-
Create and assign persistent environment variables for your key and endpoint.
86-
87-
### Environment variables
88-
89-
# [Command Line](#tab/command-line)
90-
91-
```CMD
92-
setx AZURE_OPENAI_KEY "REPLACE_WITH_YOUR_KEY_VALUE_HERE"
93-
```
94-
95-
```CMD
96-
setx AZURE_OPENAI_ENDPOINT "REPLACE_WITH_YOUR_ENDPOINT_HERE"
97-
```
98-
99-
# [PowerShell](#tab/powershell)
100-
101-
```powershell
102-
[System.Environment]::SetEnvironmentVariable('AZURE_OPENAI_KEY', 'REPLACE_WITH_YOUR_KEY_VALUE_HERE', 'User')
103-
```
104-
105-
```powershell
106-
[System.Environment]::SetEnvironmentVariable('AZURE_OPENAI_ENDPOINT', 'REPLACE_WITH_YOUR_ENDPOINT_HERE', 'User')
107-
```
108-
109-
# [Bash](#tab/bash)
110-
111-
```Bash
112-
echo export AZURE_OPENAI_KEY="REPLACE_WITH_YOUR_KEY_VALUE_HERE" >> /etc/environment && source /etc/environment
113-
```
114-
115-
```Bash
116-
echo export AZURE_OPENAI_ENDPOINT="REPLACE_WITH_YOUR_ENDPOINT_HERE" >> /etc/environment && source /etc/environment
117-
```
118-
---
11976

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

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

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -40,53 +40,10 @@ Install the Azure OpenAI client library for JavaScript with npm:
4040
npm install @azure/openai
4141
```
4242

43-
### Retrieve key and endpoint
43+
[!INCLUDE [get-key-endpoint](get-key-endpoint.md)]
4444

45-
To successfully make a call against Azure OpenAI, you need an **endpoint** and a **key**.
45+
[!INCLUDE [environment-variables](environment-variables.md)]
4646

47-
|Variable name | Value |
48-
|--------------------------|-------------|
49-
| `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/`.|
50-
| `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`.|
51-
52-
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.
53-
54-
:::image type="content" source="../media/quickstarts/endpoint.png" alt-text="Screenshot of the overview UI for an OpenAI Resource in the Azure portal with the endpoint and access keys location circled in red." lightbox="../media/quickstarts/endpoint.png":::
55-
56-
Create and assign persistent environment variables for your key and endpoint.
57-
58-
### Environment variables
59-
60-
# [Command Line](#tab/command-line)
61-
62-
```CMD
63-
setx AZURE_OPENAI_KEY "REPLACE_WITH_YOUR_KEY_VALUE_HERE"
64-
```
65-
66-
```CMD
67-
setx AZURE_OPENAI_ENDPOINT "REPLACE_WITH_YOUR_ENDPOINT_HERE"
68-
```
69-
70-
# [PowerShell](#tab/powershell)
71-
72-
```powershell
73-
[System.Environment]::SetEnvironmentVariable('AZURE_OPENAI_KEY', 'REPLACE_WITH_YOUR_KEY_VALUE_HERE', 'User')
74-
```
75-
76-
```powershell
77-
[System.Environment]::SetEnvironmentVariable('AZURE_OPENAI_ENDPOINT', 'REPLACE_WITH_YOUR_ENDPOINT_HERE', 'User')
78-
```
79-
80-
# [Bash](#tab/bash)
81-
82-
```Bash
83-
echo export AZURE_OPENAI_KEY="REPLACE_WITH_YOUR_KEY_VALUE_HERE" >> /etc/environment && source /etc/environment
84-
```
85-
86-
```Bash
87-
echo export AZURE_OPENAI_ENDPOINT="REPLACE_WITH_YOUR_ENDPOINT_HERE" >> /etc/environment && source /etc/environment
88-
```
89-
---
9047

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

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

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -40,53 +40,10 @@ pip install openai
4040
> [!NOTE]
4141
> This library is maintained by OpenAI and is currently in preview. Refer to the [release history](https://github.com/openai/openai-python/releases) or the [version.py commit history](https://github.com/openai/openai-python/commits/main/openai/version.py) to track the latest updates to the library.
4242
43-
### Retrieve key and endpoint
43+
[!INCLUDE [get-key-endpoint](get-key-endpoint.md)]
4444

45-
To successfully make a call against Azure OpenAI, you'll need an **endpoint** and a **key**.
45+
[!INCLUDE [environment-variables](environment-variables.md)]
4646

47-
|Variable name | Value |
48-
|--------------------------|-------------|
49-
| `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/`.|
50-
| `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`.|
51-
52-
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.
53-
54-
:::image type="content" source="../media/quickstarts/endpoint.png" alt-text="Screenshot of the overview UI for an OpenAI Resource in the Azure portal with the endpoint & access keys location circled in red." lightbox="../media/quickstarts/endpoint.png":::
55-
56-
Create and assign persistent environment variables for your key and endpoint.
57-
58-
### Environment variables
59-
60-
# [Command Line](#tab/command-line)
61-
62-
```CMD
63-
setx AZURE_OPENAI_KEY "REPLACE_WITH_YOUR_KEY_VALUE_HERE"
64-
```
65-
66-
```CMD
67-
setx AZURE_OPENAI_ENDPOINT "REPLACE_WITH_YOUR_ENDPOINT_HERE"
68-
```
69-
70-
# [PowerShell](#tab/powershell)
71-
72-
```powershell
73-
[System.Environment]::SetEnvironmentVariable('AZURE_OPENAI_KEY', 'REPLACE_WITH_YOUR_KEY_VALUE_HERE', 'User')
74-
```
75-
76-
```powershell
77-
[System.Environment]::SetEnvironmentVariable('AZURE_OPENAI_ENDPOINT', 'REPLACE_WITH_YOUR_ENDPOINT_HERE', 'User')
78-
```
79-
80-
# [Bash](#tab/bash)
81-
82-
```Bash
83-
echo export AZURE_OPENAI_KEY="REPLACE_WITH_YOUR_KEY_VALUE_HERE" >> /etc/environment && source /etc/environment
84-
```
85-
86-
```Bash
87-
echo export AZURE_OPENAI_ENDPOINT="REPLACE_WITH_YOUR_ENDPOINT_HERE" >> /etc/environment && source /etc/environment
88-
```
89-
---
9047

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

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

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -26,53 +26,10 @@ keywords:
2626

2727
## Set up
2828

29-
### Retrieve key and endpoint
29+
[!INCLUDE [get-key-endpoint](get-key-endpoint.md)]
3030

31-
To successfully make a call against Azure OpenAI, you'll need an **endpoint** and a **key**.
31+
[!INCLUDE [environment-variables](environment-variables.md)]
3232

33-
|Variable name | Value |
34-
|--------------------------|-------------|
35-
| `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/`.|
36-
| `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`.|
37-
38-
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.
39-
40-
:::image type="content" source="../media/quickstarts/endpoint.png" alt-text="Screenshot of the overview UI for an OpenAI Resource in the Azure portal with the endpoint & access keys location circled in red." lightbox="../media/quickstarts/endpoint.png":::
41-
42-
Create and assign persistent environment variables for your key and endpoint.
43-
44-
### Environment variables
45-
46-
# [Command Line](#tab/command-line)
47-
48-
```CMD
49-
setx AZURE_OPENAI_KEY "REPLACE_WITH_YOUR_KEY_VALUE_HERE"
50-
```
51-
52-
```CMD
53-
setx AZURE_OPENAI_ENDPOINT "REPLACE_WITH_YOUR_ENDPOINT_HERE"
54-
```
55-
56-
# [PowerShell](#tab/powershell)
57-
58-
```powershell
59-
[System.Environment]::SetEnvironmentVariable('AZURE_OPENAI_KEY', 'REPLACE_WITH_YOUR_KEY_VALUE_HERE', 'User')
60-
```
61-
62-
```powershell
63-
[System.Environment]::SetEnvironmentVariable('AZURE_OPENAI_ENDPOINT', 'REPLACE_WITH_YOUR_ENDPOINT_HERE', 'User')
64-
```
65-
66-
# [Bash](#tab/bash)
67-
68-
```Bash
69-
echo export AZURE_OPENAI_KEY="REPLACE_WITH_YOUR_KEY_VALUE_HERE" >> /etc/environment && source /etc/environment
70-
```
71-
72-
```Bash
73-
echo export AZURE_OPENAI_ENDPOINT="REPLACE_WITH_YOUR_ENDPOINT_HERE" >> /etc/environment && source /etc/environment
74-
```
75-
---
7633

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

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

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -30,53 +30,10 @@ Use this guide to get started generating images with the Azure OpenAI SDK for C#
3030
3131
## Set up
3232

33-
### Retrieve key and endpoint
33+
[!INCLUDE [get-key-endpoint](get-key-endpoint.md)]
3434

35-
To successfully make a call against Azure OpenAI, you'll need an **endpoint** and a **key**.
35+
[!INCLUDE [environment-variables](environment-variables.md)]
3636

37-
|Variable name | Value |
38-
|--------------------------|-------------|
39-
| `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/`.|
40-
| `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`.|
41-
42-
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.
43-
44-
:::image type="content" source="../media/quickstarts/endpoint.png" alt-text="Screenshot of the overview UI for an OpenAI Resource in the Azure portal with the endpoint & access keys location circled in red." lightbox="../media/quickstarts/endpoint.png":::
45-
46-
Create and assign persistent environment variables for your key and endpoint.
47-
48-
### Environment variables
49-
50-
# [Command Line](#tab/command-line)
51-
52-
```CMD
53-
setx AZURE_OPENAI_KEY "REPLACE_WITH_YOUR_KEY_VALUE_HERE"
54-
```
55-
56-
```CMD
57-
setx AZURE_OPENAI_ENDPOINT "REPLACE_WITH_YOUR_ENDPOINT_HERE"
58-
```
59-
60-
# [PowerShell](#tab/powershell)
61-
62-
```powershell
63-
[System.Environment]::SetEnvironmentVariable('AZURE_OPENAI_KEY', 'REPLACE_WITH_YOUR_KEY_VALUE_HERE', 'User')
64-
```
65-
66-
```powershell
67-
[System.Environment]::SetEnvironmentVariable('AZURE_OPENAI_ENDPOINT', 'REPLACE_WITH_YOUR_ENDPOINT_HERE', 'User')
68-
```
69-
70-
# [Bash](#tab/bash)
71-
72-
```Bash
73-
echo export AZURE_OPENAI_KEY="REPLACE_WITH_YOUR_KEY_VALUE_HERE" >> /etc/environment && source /etc/environment
74-
```
75-
76-
```Bash
77-
echo export AZURE_OPENAI_ENDPOINT="REPLACE_WITH_YOUR_ENDPOINT_HERE" >> /etc/environment && source /etc/environment
78-
```
79-
---
8037

8138
## Create a new .NET Core application
8239

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

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -27,50 +27,11 @@ Use this guide to get started generating images with the Azure OpenAI SDK for Go
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
2929
## Set up
30-
### Retrieve key and endpoint
3130

32-
To successfully make a call against Azure OpenAI, you'll need the following:
31+
[!INCLUDE [get-key-endpoint](get-key-endpoint.md)]
3332

34-
|Variable name | Value |
35-
|--------------------------|-------------|
36-
| `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 **Azure OpenAI Studio** > **Playground** > **Code View**. An example endpoint is: `https://docs-test-001.openai.azure.com/`.|
37-
| `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`.|
33+
[!INCLUDE [environment-variables](environment-variables.md)]
3834

39-
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.
40-
41-
42-
### Environment variables
43-
44-
# [Command Line](#tab/command-line)
45-
46-
```CMD
47-
setx AZURE_OPENAI_KEY "REPLACE_WITH_YOUR_KEY_VALUE_HERE"
48-
```
49-
50-
```CMD
51-
setx AZURE_OPENAI_ENDPOINT "REPLACE_WITH_YOUR_ENDPOINT_HERE"
52-
```
53-
54-
# [PowerShell](#tab/powershell)
55-
56-
```powershell
57-
[System.Environment]::SetEnvironmentVariable('AZURE_OPENAI_KEY', 'REPLACE_WITH_YOUR_KEY_VALUE_HERE', 'User')
58-
```
59-
60-
```powershell
61-
[System.Environment]::SetEnvironmentVariable('AZURE_OPENAI_ENDPOINT', 'REPLACE_WITH_YOUR_ENDPOINT_HERE', 'User')
62-
```
63-
64-
# [Bash](#tab/bash)
65-
66-
```Bash
67-
echo export AZURE_OPENAI_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-
---
7435

7536
## Create a new Go application
7637

0 commit comments

Comments
 (0)