Skip to content

Commit 38b2bb2

Browse files
authored
Merge pull request #267332 from MicrosoftDocs/main
2/26/2024 PM Publish
2 parents ce6a328 + d96bbcf commit 38b2bb2

File tree

84 files changed

+4914
-1022
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+4914
-1022
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"redirections": [
3+
{
4+
"source_path_from_root": "/articles/virtual-machines/security-recommendations.md",
5+
"redirect_url": "/security/benchmark/azure/baselines/virtual-machines-windows-virtual-machines-security-baseline",
6+
"redirect_document_id": false
7+
}
8+
]
9+
}
166 KB
Loading

articles/ai-services/openai/concepts/use-your-data.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,9 @@ You can send a streaming request using the `stream` parameter, allowing data to
361361
{
362362
"type": "AzureCognitiveSearch",
363363
"parameters": {
364-
"endpoint": "'$SearchEndpoint'",
365-
"key": "'$SearchKey'",
366-
"indexName": "'$SearchIndex'"
364+
"endpoint": "'$AZURE_AI_SEARCH_ENDPOINT'",
365+
"key": "'$AZURE_AI_SEARCH_API_KEY'",
366+
"indexName": "'$AZURE_AI_SEARCH_INDEX'"
367367
}
368368
}
369369
],
@@ -386,9 +386,9 @@ When you chat with a model, providing a history of the chat will help the model
386386
{
387387
"type": "AzureCognitiveSearch",
388388
"parameters": {
389-
"endpoint": "'$SearchEndpoint'",
390-
"key": "'$SearchKey'",
391-
"indexName": "'$SearchIndex'"
389+
"endpoint": "'$AZURE_AI_SEARCH_ENDPOINT'",
390+
"key": "'$AZURE_AI_SEARCH_API_KEY'",
391+
"indexName": "'$AZURE_AI_SEARCH_INDEX'"
392392
}
393393
}
394394
],

articles/ai-services/openai/encrypt-data-at-rest.md

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: mrbullwinkle
66
manager: nitinme
77
ms.service: azure-ai-openai
88
ms.topic: conceptual
9-
ms.date: 11/14/2022
9+
ms.date: 2/21/2024
1010
ms.author: mbullwin
1111
---
1212

@@ -22,37 +22,66 @@ Azure OpenAI is part of Azure AI services. Azure AI services data is encrypted a
2222

2323
By default, your subscription uses Microsoft-managed encryption keys. There's also the option to manage your subscription with your own keys called customer-managed keys (CMK). CMK offers greater flexibility to create, rotate, disable, and revoke access controls. You can also audit the encryption keys used to protect your data.
2424

25-
## Customer-managed keys with Azure Key Vault
25+
## Use customer-managed keys with Azure Key Vault
2626

2727
Customer-managed keys (CMK), also known as Bring your own key (BYOK), offer greater flexibility to create, rotate, disable, and revoke access controls. You can also audit the encryption keys used to protect your data.
2828

2929
You must use Azure Key Vault to store your customer-managed keys. You can either create your own keys and store them in a key vault, or you can use the Azure Key Vault APIs to generate keys. The Azure AI services resource and the key vault must be in the same region and in the same Microsoft Entra tenant, but they can be in different subscriptions. For more information about Azure Key Vault, see [What is Azure Key Vault?](../../key-vault/general/overview.md).
3030

31-
To enable customer-managed keys, you must also enable both the **Soft Delete** and **Do Not Purge** properties on the key vault.
31+
To enable customer-managed keys, the key vault containing your keys must meet these requirements:
3232

33-
Only RSA keys of size 2048 are supported with Azure AI services encryption. For more information about keys, see **Key Vault keys** in [About Azure Key Vault keys, secrets and certificates](../../key-vault/general/about-keys-secrets-certificates.md).
33+
- You must enable both the **Soft Delete** and **Do Not Purge** properties on the key vault.
34+
- If you use the [Key Vault firewall](/azure/key-vault/general/access-behind-firewall), you must allow trusted Microsoft services to access the key vault.
35+
- The key vault must use [legacy access policies](/azure/key-vault/general/assign-access-policy).
36+
- You must grant the Azure OpenAI resource's system-assigned managed identity the following permissions on your key vault: *get key*, *wrap key*, *unwrap key*.
3437

35-
## Enable customer-managed keys for your resource
38+
Only RSA and RSA-HSM keys of size 2048 are supported with Azure AI services encryption. For more information about keys, see **Key Vault keys** in [About Azure Key Vault keys, secrets and certificates](../../key-vault/general/about-keys-secrets-certificates.md).
39+
40+
### Enable your Azure OpenAI resource's managed identity
41+
42+
1. Go to your Azure AI services resource.
43+
1. On the left, under **Resource Management**, select **Identity**.
44+
1. Switch the system-assigned managed identity status to **On**.
45+
1. Save your changes, and confirm that you want to enable the system-assigned managed identity.
46+
47+
### Configure your key vault's access permissions
48+
49+
1. In the Azure portal, go to your key vault.
50+
1. On the left, select **Access policies**.
51+
52+
If you see a message advising you that access policies aren't available, [reconfigure your key vault to use legacy access policies](/azure/key-vault/general/assign-access-policy) before continuing.
53+
1. Select **Create**.
54+
1. Under **Key permissions**, select **Get**, **Wrap Key**, and **Unwrap Key**. Leave the remaining checkboxes unselected.
55+
56+
:::image type="content" source="../media/cognitive-services-encryption/key-vault-access-policy.png" alt-text="Screenshot of the Azure portal page for a key vault access policy. The permissions selected are Get Key, Wrap Key, and Unwrap Key.":::
57+
58+
1. Select **Next**.
59+
1. Search for the name of your Azure OpenAI resource and select its managed identity.
60+
1. Select **Next**.
61+
1. Select **Next** to skip configuring any application settings.
62+
1. Select **Create**.
63+
64+
### Enable customer-managed keys on your Azure OpenAI resource
3665

3766
To enable customer-managed keys in the Azure portal, follow these steps:
3867

3968
1. Go to your Azure AI services resource.
40-
1. On the left, select **Encryption**.
69+
1. On the left, under **Resource Management**, select **Encryption**.
4170
1. Under **Encryption type**, select **Customer Managed Keys**, as shown in the following screenshot.
4271

43-
> [!div class="mx-imgBorder"]
44-
> ![Screenshot of create a resource user experience](./media/encryption/encryption.png)
72+
> [!div class="mx-imgBorder"]
73+
> ![Screenshot of create a resource user experience.](./media/encryption/encryption.png)
4574
46-
## Specify a key
75+
### Specify a key
4776

4877
After you enable customer-managed keys, you can specify a key to associate with the Azure AI services resource.
4978

50-
### Specify a key as a URI
79+
#### Specify a key as a URI
5180

5281
To specify a key as a URI, follow these steps:
5382

5483
1. In the Azure portal, go to your key vault.
55-
1. Under **Settings**, select **Keys**.
84+
1. Under **Objects**, select **Keys**.
5685
1. Select the desired key, and then select the key to view its versions. Select a key version to view the settings for that version.
5786
1. Copy the **Key Identifier** value, which provides the URI.
5887

@@ -67,9 +96,9 @@ To specify a key as a URI, follow these steps:
6796
1. Under **Subscription**, select the subscription that contains the key vault.
6897
1. Save your changes.
6998

70-
### Specify a key from a key vault
99+
#### Select a key from a key vault
71100

72-
To specify a key from a key vault, first make sure that you have a key vault that contains a key. Then follow these steps:
101+
To select a key from a key vault, first make sure that you have a key vault that contains a key. Then follow these steps:
73102

74103
1. Go to your Azure AI services resource, and then select **Encryption**.
75104
1. Under **Encryption key**, select **Select from Key Vault**.

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
title: How to migrate to OpenAI Python v1.x
33
titleSuffix: Azure OpenAI Service
4-
description: Learn about migrating to the latest release of the OpenAI Python library with Azure OpenAI
4+
description: Learn about migrating to the latest release of the OpenAI Python library with Azure OpenAI.
55
author: mrbullwinkle
66
ms.author: mbullwin
77
ms.service: azure-ai-openai
88
ms.custom: devx-track-python
99
ms.topic: how-to
10-
ms.date: 11/15/2023
10+
ms.date: 02/26/2024
1111
manager: nitinme
1212
---
1313

@@ -17,7 +17,7 @@ OpenAI has just released a new version of the [OpenAI Python API library](https:
1717

1818
## Updates
1919

20-
- This is a completely new version of the OpenAI Python API library.
20+
- This is a new version of the OpenAI Python API library.
2121
- Starting on November 6, 2023 `pip install openai` and `pip install openai --upgrade` will install `version 1.x` of the OpenAI Python library.
2222
- Upgrading from `version 0.28.1` to `version 1.x` is a breaking change, you'll need to test and update your code.
2323
- Auto-retry with backoff if there's an error
@@ -259,7 +259,7 @@ print(completion.model_dump_json(indent=2))
259259

260260
## Use your data
261261

262-
For the full configuration steps that are required to make these code examples work, please consult the [use your data quickstart](../use-your-data-quickstart.md).
262+
For the full configuration steps that are required to make these code examples work, consult the [use your data quickstart](../use-your-data-quickstart.md).
263263
# [OpenAI Python 0.28.1](#tab/python)
264264

265265
```python
@@ -270,10 +270,10 @@ import requests
270270

271271
dotenv.load_dotenv()
272272

273-
openai.api_base = os.environ.get("AOAIEndpoint")
273+
openai.api_base = os.environ.get("AZURE_OPENAI_ENDPOINT")
274274
openai.api_version = "2023-08-01-preview"
275275
openai.api_type = 'azure'
276-
openai.api_key = os.environ.get("AOAIKey")
276+
openai.api_key = os.environ.get("AZURE_OPENAI_API_KEY")
277277

278278
def setup_byod(deployment_id: str) -> None:
279279
"""Sets up the OpenAI Python SDK to use your own data for the chat endpoint.
@@ -299,19 +299,19 @@ def setup_byod(deployment_id: str) -> None:
299299

300300
openai.requestssession = session
301301

302-
aoai_deployment_id = os.environ.get("AOAIDeploymentId")
302+
aoai_deployment_id = os.environ.get("AZURE_OPEN_AI_DEPLOYMENT_ID")
303303
setup_byod(aoai_deployment_id)
304304

305305
completion = openai.ChatCompletion.create(
306306
messages=[{"role": "user", "content": "What are the differences between Azure Machine Learning and Azure AI services?"}],
307-
deployment_id=os.environ.get("AOAIDeploymentId"),
307+
deployment_id=os.environ.get("AZURE_OPEN_AI_DEPLOYMENT_ID"),
308308
dataSources=[ # camelCase is intentional, as this is the format the API expects
309309
{
310310
"type": "AzureCognitiveSearch",
311311
"parameters": {
312-
"endpoint": os.environ.get("SearchEndpoint"),
313-
"key": os.environ.get("SearchKey"),
314-
"indexName": os.environ.get("SearchIndex"),
312+
"endpoint": os.environ.get("AZURE_AI_SEARCH_ENDPOINT"),
313+
"key": os.environ.get("AZURE_AI_SEARCH_API_KEY"),
314+
"indexName": os.environ.get("AZURE_AI_SEARCH_INDEX"),
315315
}
316316
}
317317
]
@@ -328,9 +328,9 @@ import dotenv
328328

329329
dotenv.load_dotenv()
330330

331-
endpoint = os.environ.get("AOAIEndpoint")
332-
api_key = os.environ.get("AOAIKey")
333-
deployment = os.environ.get("AOAIDeploymentId")
331+
endpoint = os.environ.get("AZURE_OPENAI_ENDPOINT")
332+
api_key = os.environ.get("AZURE_OPENAI_API_KEY")
333+
deployment = os.environ.get("AZURE_OPEN_AI_DEPLOYMENT_ID")
334334

335335
client = openai.AzureOpenAI(
336336
base_url=f"{endpoint}/openai/deployments/{deployment}/extensions",
@@ -351,9 +351,9 @@ completion = client.chat.completions.create(
351351
{
352352
"type": "AzureCognitiveSearch",
353353
"parameters": {
354-
"endpoint": os.environ["SearchEndpoint"],
355-
"key": os.environ["SearchKey"],
356-
"indexName": os.environ["SearchIndex"]
354+
"endpoint": os.environ["AZURE_AI_SEARCH_ENDPOINT"],
355+
"key": os.environ["AZURE_AI_SEARCH_API_KEY"],
356+
"indexName": os.environ["AZURE_AI_SEARCH_INDEX"]
357357
}
358358
}
359359
]

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.service: azure-ai-openai
77
ms.topic: how-to
88
author: aahill
99
ms.author: aahi
10-
ms.date: 02/09/2024
10+
ms.date: 02/23/2024
1111
recommendations: false
1212
---
1313

@@ -43,6 +43,8 @@ When customizing the app, we recommend:
4343

4444
- When you rotate API keys for your Azure OpenAI or Azure AI Search resource, be sure to update the app settings for each of your deployed apps to use the new keys.
4545

46+
Sample source code for Azure OpenAI On Your Data web app is available on [GitHub](https://github.com/microsoft/sample-app-aoai-chatGPT). Source code is provided "as is" and as a sample only. Customers are responsible for all customization and implementation of their web apps using Azure OpenAI On Your Data.
47+
4648
### Updating the web app
4749

4850
We recommend pulling changes from the `main` branch for the web app's source code frequently to ensure you have the latest bug fixes, API version, and improvements.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ When using the API, pass the `filter` parameter in each API request. For example
9090
{
9191
"type": "AzureCognitiveSearch",
9292
"parameters": {
93-
"endpoint": "'$SearchEndpoint'",
94-
"key": "'$SearchKey'",
95-
"indexName": "'$SearchIndex'",
93+
"endpoint": "'$AZURE_AI_SEARCH_ENDPOINT'",
94+
"key": "'$AZURE_AI_SEARCH_API_KEY'",
95+
"indexName": "'$AZURE_AI_SEARCH_INDEX'",
9696
"filter": "my_group_ids/any(g:search.in(g, 'group_id1, group_id2'))"
9797
}
9898
}

articles/ai-services/openai/includes/use-your-data-common-variables.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,82 +14,82 @@ To successfully make a call against Azure OpenAI, you need the following variabl
1414

1515
|Variable name | Value |
1616
|--------------------------|-------------|
17-
| `AOAIEndpoint` | This value can be found in the **Keys & Endpoint** section when examining your Azure OpenAI resource from the Azure portal. Alternatively, you can find the value in **Azure AI studio** > **Chat playground** > **Code view**. An example endpoint is: `https://my-resoruce.openai.azure.com`.|
18-
| `AOAIKey` | This value can be found in **Resource management** > **Keys & Endpoint** section when examining your Azure OpenAI resource from the Azure portal. You can use either `KEY1` or `KEY2`. Always having two keys allows you to securely rotate and regenerate keys without causing a service disruption. |
19-
| `AOAIDeploymentId` | This value corresponds to the custom name you chose for your deployment when you deployed a model. This value can be found under **Resource Management** > **Deployments** in the Azure portal or alternatively under **Management** > **Deployments** in Azure AI studio.|
20-
| `SearchEndpoint` | This value can be found in the **Overview** section when examining your Azure AI Search resource from the Azure portal. |
21-
| `SearchKey` | This value can be found in the **Settings** > **Keys** section when examining your Azure AI Search resource from the Azure portal. You can use either the primary admin key or secondary admin key. Always having two keys allows you to securely rotate and regenerate keys without causing a service disruption. |
22-
| `SearchIndex` | This value corresponds to the name of the index you created to store your data. You can find it in the **Overview** section when examining your Azure AI Search resource from the Azure portal. |
17+
| `AZURE_OPENAI_ENDPOINT` | This value can be found in the **Keys & Endpoint** section when examining your Azure OpenAI resource from the Azure portal. Alternatively, you can find the value in **Azure AI studio** > **Chat playground** > **Code view**. An example endpoint is: `https://my-resoruce.openai.azure.com`.|
18+
| `AZURE_OPENAI_API_KEY` | This value can be found in **Resource management** > **Keys & Endpoint** section when examining your Azure OpenAI resource from the Azure portal. You can use either `KEY1` or `KEY2`. Always having two keys allows you to securely rotate and regenerate keys without causing a service disruption. |
19+
| `AZURE_OPEN_AI_DEPLOYMENT_ID` | This value corresponds to the custom name you chose for your deployment when you deployed a model. This value can be found under **Resource Management** > **Deployments** in the Azure portal or alternatively under **Management** > **Deployments** in Azure AI studio.|
20+
| `AZURE_AI_SEARCH_ENDPOINT` | This value can be found in the **Overview** section when examining your Azure AI Search resource from the Azure portal. |
21+
| `AZURE_AI_SEARCH_API_KEY` | This value can be found in the **Settings** > **Keys** section when examining your Azure AI Search resource from the Azure portal. You can use either the primary admin key or secondary admin key. Always having two keys allows you to securely rotate and regenerate keys without causing a service disruption. |
22+
| `AZURE_AI_SEARCH_INDEX` | This value corresponds to the name of the index you created to store your data. You can find it in the **Overview** section when examining your Azure AI Search resource from the Azure portal. |
2323

2424
### Environment variables
2525

2626
# [Command Line](#tab/command-line)
2727

2828
```CMD
29-
setx AOAIEndpoint REPLACE_WITH_YOUR_AOAI_ENDPOINT_VALUE_HERE
29+
setx AZURE_OPENAI_ENDPOINT REPLACE_WITH_YOUR_AOAI_ENDPOINT_VALUE_HERE
3030
```
3131
```CMD
32-
setx AOAIKey REPLACE_WITH_YOUR_AOAI_KEY_VALUE_HERE
32+
setx AZURE_OPENAI_API_KEY REPLACE_WITH_YOUR_AOAI_KEY_VALUE_HERE
3333
```
3434
```CMD
35-
setx AOAIDeploymentId REPLACE_WITH_YOUR_AOAI_DEPLOYMENT_VALUE_HERE
35+
setx AZURE_OPENAI_DEPLOYMENT_ID REPLACE_WITH_YOUR_AOAI_DEPLOYMENT_VALUE_HERE
3636
```
3737
```CMD
38-
setx SearchEndpoint REPLACE_WITH_YOUR_AZURE_SEARCH_RESOURCE_VALUE_HERE
38+
setx AZURE_AI_SEARCH_ENDPOINT REPLACE_WITH_YOUR_AZURE_SEARCH_RESOURCE_VALUE_HERE
3939
```
4040
```CMD
41-
setx SearchKey REPLACE_WITH_YOUR_AZURE_SEARCH_RESOURCE_KEY_VALUE_HERE
41+
setx AZURE_AI_SEARCH_API_KEY REPLACE_WITH_YOUR_AZURE_SEARCH_RESOURCE_KEY_VALUE_HERE
4242
```
4343
```CMD
44-
setx SearchIndex REPLACE_WITH_YOUR_INDEX_NAME_HERE
44+
setx AZURE_AI_SEARCH_INDEX REPLACE_WITH_YOUR_INDEX_NAME_HERE
4545
```
4646

4747

4848
# [PowerShell](#tab/powershell)
4949

5050
```powershell
51-
[System.Environment]::SetEnvironmentVariable('AOAIEndpoint', 'REPLACE_WITH_YOUR_AOAI_ENDPOINT_VALUE_HERE', 'User')
51+
[System.Environment]::SetEnvironmentVariable('AZURE_OPENAI_ENDPOINT', 'REPLACE_WITH_YOUR_AOAI_ENDPOINT_VALUE_HERE', 'User')
5252
```
5353

5454
```powershell
55-
[System.Environment]::SetEnvironmentVariable('AOAIKey', 'REPLACE_WITH_YOUR_AOAI_KEY_VALUE_HERE', 'User')
55+
[System.Environment]::SetEnvironmentVariable('AZURE_OPENAI_API_KEY', 'REPLACE_WITH_YOUR_AOAI_KEY_VALUE_HERE', 'User')
5656
```
5757

5858
```powershell
59-
[System.Environment]::SetEnvironmentVariable('AOAIDeploymentId', 'REPLACE_WITH_YOUR_AOAI_DEPLOYMENT_VALUE_HERE', 'User')
59+
[System.Environment]::SetEnvironmentVariable('AZURE_OPEN_AI_DEPLOYMENT_ID', 'REPLACE_WITH_YOUR_AOAI_DEPLOYMENT_VALUE_HERE', 'User')
6060
```
6161

6262
```powershell
63-
[System.Environment]::SetEnvironmentVariable('SearchEndpoint', 'REPLACE_WITH_YOUR_AZURE_SEARCH_RESOURCE_VALUE_HERE', 'User')
63+
[System.Environment]::SetEnvironmentVariable('AZURE_AI_SEARCH_ENDPOINT', 'REPLACE_WITH_YOUR_AZURE_SEARCH_RESOURCE_VALUE_HERE', 'User')
6464
```
6565

6666
```powershell
67-
[System.Environment]::SetEnvironmentVariable('SearchKey', 'REPLACE_WITH_YOUR_AZURE_SEARCH_RESOURCE_KEY_VALUE_HERE', 'User')
67+
[System.Environment]::SetEnvironmentVariable('AZURE_AI_SEARCH_API_KEY', 'REPLACE_WITH_YOUR_AZURE_SEARCH_RESOURCE_KEY_VALUE_HERE', 'User')
6868
```
6969

7070
```powershell
71-
[System.Environment]::SetEnvironmentVariable('SearchIndex', 'REPLACE_WITH_YOUR_INDEX_NAME_HERE', 'User')
71+
[System.Environment]::SetEnvironmentVariable('AZURE_AI_SEARCH_INDEX', 'REPLACE_WITH_YOUR_INDEX_NAME_HERE', 'User')
7272
```
7373

7474
# [Bash](#tab/bash)
7575

7676
```Bash
77-
export AOAIEndpoint=REPLACE_WITH_YOUR_AOAI_ENDPOINT_VALUE_HERE
77+
export AZURE_OPENAI_ENDPOINT=REPLACE_WITH_YOUR_AOAI_ENDPOINT_VALUE_HERE
7878
```
7979
```Bash
80-
export AOAIKey=REPLACE_WITH_YOUR_AOAI_KEY_VALUE_HERE
80+
export AZURE_OPENAI_API_KEY=REPLACE_WITH_YOUR_AOAI_KEY_VALUE_HERE
8181
```
8282
```Bash
83-
export AOAIDeploymentId=REPLACE_WITH_YOUR_AOAI_DEPLOYMENT_VALUE_HERE
83+
export AZURE_OPEN_AI_DEPLOYMENT_ID=REPLACE_WITH_YOUR_AOAI_DEPLOYMENT_VALUE_HERE
8484
```
8585
```Bash
86-
export SearchEndpoint=REPLACE_WITH_YOUR_AZURE_SEARCH_RESOURCE_VALUE_HERE
86+
export AZURE_AI_SEARCH_ENDPOINT=REPLACE_WITH_YOUR_AZURE_SEARCH_RESOURCE_VALUE_HERE
8787
```
8888
```Bash
89-
export SearchKey=REPLACE_WITH_YOUR_AZURE_SEARCH_RESOURCE_KEY_VALUE_HERE
89+
export AZURE_AI_SEARCH_API_KEY=REPLACE_WITH_YOUR_AZURE_SEARCH_RESOURCE_KEY_VALUE_HERE
9090
```
9191
```Bash
92-
export SearchIndex=REPLACE_WITH_YOUR_INDEX_NAME_HERE
92+
export AZURE_AI_SEARCH_INDEX=REPLACE_WITH_YOUR_INDEX_NAME_HERE
9393
```
9494

9595
---

0 commit comments

Comments
 (0)