You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/ai-services/authentication.md
+10-18Lines changed: 10 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,12 @@
2
2
title: Authentication in Azure AI services
3
3
titleSuffix: Azure AI services
4
4
description: "There are three ways to authenticate a request to an Azure AI services resource: a resource key, a bearer token, or a multi-service subscription. In this article, you'll learn about each method, and how to make a request."
5
-
#services: cognitive-services
6
5
author: mgreenegit
7
6
manager: nitinme
8
7
ms.service: azure-ai-services
9
8
ms.custom: devx-track-azurepowershell
10
9
ms.topic: how-to
11
-
ms.date: 08/30/2023
10
+
ms.date: 8/1/2024
12
11
ms.author: migreene
13
12
---
14
13
@@ -22,9 +21,9 @@ Each request to an Azure AI service must include an authentication header. This
22
21
23
22
## Prerequisites
24
23
25
-
Before you make a request, you need an Azure account and an Azure AI services subscription. If you already have an account, go ahead and skip to the next section. If you don't have an account, we have a guide to get you set up in minutes: [Create a multi-service resource](multi-service-resource.md?pivots=azportal).
24
+
Before you make a request, you need an Azure account and an Azure AI services subscription. If you already have an account, go ahead and skip to the next section. If you don't have an account, we have a guide to get you set up in minutes: [Create an Azure AI services resource](multi-service-resource.md?pivots=azportal).
26
25
27
-
You can get your resource key from the [Azure portal](multi-service-resource.md?pivots=azportal#get-the-keys-for-your-resource) after [creating your account](https://azure.microsoft.com/free/cognitive-services/).
26
+
Go to your resource in the Azure portal. The **Keys & Endpoint** section 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.
28
27
29
28
## Authentication headers
30
29
@@ -33,14 +32,14 @@ Let's quickly review the authentication headers available for use with Azure AI
33
32
| Header | Description |
34
33
|--------|-------------|
35
34
| Ocp-Apim-Subscription-Key | Use this header to authenticate with a resource key for a specific service or a multi-service resource key. |
36
-
| Ocp-Apim-Subscription-Region | This header is only required when using a multi-service resource key with the [Translator service](./Translator/reference/v3-0-reference.md). Use this header to specify the resource region. |
35
+
| Ocp-Apim-Subscription-Region | This header is only required when using a multi-service resource key with the [Azure AI Translator service](./Translator/reference/v3-0-reference.md). Use this header to specify the resource region. |
37
36
| Authorization | Use this header if you are using an access token. The steps to perform a token exchange are detailed in the following sections. The value provided follows this format: `Bearer <TOKEN>`. |
38
37
39
38
## Authenticate with a single-service resource key
40
39
41
-
The first option is to authenticate a request with a resource key for a specific service, like Translator. The keys are available in the Azure portal for each resource that you've created. To use a resource key to authenticate a request, it must be passed along as the `Ocp-Apim-Subscription-Key` header.
40
+
The first option is to authenticate a request with a resource key for a specific service, like Azure AI Translator. The keys are available in the Azure portal for each resource that you've created. Go to your resource in the Azure portal. The **Keys & Endpoint** section 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.
42
41
43
-
These sample requests demonstrate how to use the `Ocp-Apim-Subscription-Key` header. Keep in mind, when using this sample you'll need to include a valid resource key.
42
+
To use a resource key to authenticate a request, it must be passed along as the `Ocp-Apim-Subscription-Key` header. This is a sample call to the Azure AI Translator service:
44
43
45
44
This is a sample call to the Translator service:
46
45
```cURL
@@ -50,23 +49,19 @@ curl -X POST 'https://api.cognitive.microsofttranslator.com/translate?api-versio
50
49
--data-raw '[{ "text": "How much for the cup of coffee?" }]' | json_pp
51
50
```
52
51
53
-
The following video demonstrates using an Azure AI services key.
54
-
55
52
## Authenticate with a multi-service resource key
56
53
57
54
You can use a [multi-service](./multi-service-resource.md) resource key to authenticate requests. The main difference is that the multi-service resource key isn't tied to a specific service, rather, a single key can be used to authenticate requests for multiple Azure AI services. See [Azure AI services pricing](https://azure.microsoft.com/pricing/details/cognitive-services/) for information about regional availability, supported features, and pricing.
58
55
59
56
The resource key is provided in each request as the `Ocp-Apim-Subscription-Key` header.
60
57
61
-
[](https://www.youtube.com/watch?v=psHtA1p7Cas&feature=youtu.be)
62
-
63
58
### Supported regions
64
59
65
-
When using the [multi-service](./multi-service-resource.md) resource key to make a request to `api.cognitive.microsoft.com`, you must include the region in the URL. For example: `westus.api.cognitive.microsoft.com`.
60
+
When using the [Azure AI services multi-service](./multi-service-resource.md) resource key to make a request to `api.cognitive.microsoft.com`, you must include the region in the URL. For example: `westus.api.cognitive.microsoft.com`.
66
61
67
62
When using a multi-service resource key with [Azure AI Translator](./translator/index.yml), you must specify the resource region with the `Ocp-Apim-Subscription-Region` header.
68
63
69
-
Multi-service authentication is supported in these regions:
64
+
Multi-service resource authentication is supported in these regions:
70
65
71
66
-`australiaeast`
72
67
-`brazilsouth`
@@ -93,7 +88,7 @@ Multi-service authentication is supported in these regions:
93
88
94
89
### Sample requests
95
90
96
-
This is a sample call to the Translator service:
91
+
This is a sample call to the Azure AI Translator service:
97
92
98
93
```cURL
99
94
curl -X POST 'https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&from=en&to=de' \
@@ -111,9 +106,6 @@ Some Azure AI services accept, and in some cases require, an access token. Curre
111
106
* Speech Services: Speech to text API
112
107
* Speech Services: Text to speech API
113
108
114
-
>[!NOTE]
115
-
> QnA Maker also uses the Authorization header, but requires an endpoint key. For more information, see [QnA Maker: Get answer from knowledge base](./qnamaker/quickstarts/get-answer-from-knowledge-base-using-url-tool.md).
116
-
117
109
>[!WARNING]
118
110
> The services that support access tokens may change over time, please check the API reference for a service before using this authentication method.
119
111
@@ -151,7 +143,7 @@ These multi-service regions support token exchange:
151
143
-`westus`
152
144
-`westus2`
153
145
154
-
After you get an access token, you'll need to pass it in each request as the `Authorization` header. This is a sample call to the Translator service:
146
+
After you get an access token, you'll need to pass it in each request as the `Authorization` header. This is a sample call to the Azure AI Translator service:
155
147
156
148
```cURL
157
149
curl -X POST 'https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&from=en&to=de' \
Copy file name to clipboardExpand all lines: articles/ai-services/autoscale.md
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,6 @@ Yes, you can disable the autoscale feature through Azure portal or CLI and retur
67
67
68
68
Autoscale feature is available for the following services:
69
69
70
-
*[Azure AI services multi-key](./multi-service-resource.md?pivots=azportal)
71
70
*[Azure AI Vision](computer-vision/index.yml)
72
71
*[Language](language-service/overview.md) (only available for sentiment analysis, key phrase extraction, named entity recognition, and text analytics for health)
Copy file name to clipboardExpand all lines: articles/ai-services/cognitive-services-container-support.md
+1-8Lines changed: 1 addition & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,11 +74,7 @@ Azure AI containers provide the following set of Docker containers, each of whic
74
74
|[Azure AI Vision][cv-containers]|**Read OCR** ([image](https://mcr.microsoft.com/product/azure-cognitive-services/vision/read/about)) | The Read OCR container allows you to extract printed and handwritten text from images and documents with support for JPEG, PNG, BMP, PDF, and TIFF file formats. For more information, see the [Read API documentation](./computer-vision/overview-ocr.md). | Generally Available. <br>This container can also [run in disconnected environments](containers/disconnected-containers.md). |
75
75
|[Spatial Analysis][spa-containers]|**Spatial analysis** ([image](https://mcr.microsoft.com/product/azure-cognitive-services/vision/spatial-analysis/about)) | Analyzes real-time streaming video to understand spatial relationships between people, their movement, and interactions with objects in physical environments. | Preview |
76
76
77
-
<!--
78
-
|[Personalizer](./personalizer/what-is-personalizer.md) |F0, S0|**Personalizer** ([image](https://go.microsoft.com/fwlink/?linkid=2083928&clcid=0x409))|Azure AI Personalizer is a cloud-based API service that allows you to choose the best experience to show to your users, learning from their real-time behavior.|
79
-
-->
80
-
81
-
Additionally, some containers are supported in the Azure AI services [multi-service resource](multi-service-resource.md?pivots=azportal) offering. You can create one single Azure AI services All-In-One resource and use the same billing key across supported services for the following services:
77
+
Additionally, some containers are supported in the [Azure AI services multi-service resource](multi-service-resource.md?pivots=azportal) offering. You can create one single Azure AI services resource and use the same billing key across supported services for the following services:
82
78
83
79
* Azure AI Vision
84
80
* LUIS
@@ -117,9 +113,6 @@ Install and explore the functionality provided by containers in Azure AI service
Copy file name to clipboardExpand all lines: articles/ai-services/cognitive-services-data-loss-prevention.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,7 @@ Azure AI services data loss prevention capabilities allow customers to configure
15
15
16
16
## Prerequisites
17
17
18
-
- Before you make a request, you need an Azure account and an Azure AI services subscription. If you already have an account, go ahead and skip to the next section. If you don't have an account, we have a guide to get you set up in minutes: [Create a multi-service resource](multi-service-resource.md?pivots=azportal).
19
-
- You can get your subscription key from the [Azure portal](multi-service-resource.md?pivots=azportal#get-the-keys-for-your-resource) after [creating your account](https://azure.microsoft.com/free/cognitive-services/).
18
+
Before you make a request, you need an Azure account and an Azure AI services subscription. If you already have an account, go ahead and skip to the next section. If you don't have an account, we have a guide to get you set up in minutes: [Create an Azure AI services multi-service resource](multi-service-resource.md?pivots=azportal).
20
19
21
20
## Enabling data loss prevention
22
21
@@ -43,14 +42,14 @@ There are two parts to enable data loss prevention. First, the resource property
0 commit comments