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/search/search-security-api-keys.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,11 +53,11 @@ In Cognitive Search, most tasks can be performed in Azure portal, including obje
53
53
54
54
### [**PowerShell**](#tab/azure-ps-use)
55
55
56
-
Set an admin key in the request header using the following syntax:
56
+
Set API keys in the request header using the following syntax:
57
57
58
58
```azurepowershell
59
59
$headers = @{
60
-
'api-key' = '<YOUR-ADMIN-API-KEY>'
60
+
'api-key' = '<YOUR-ADMIN-OR-QUERY-API-KEY>'
61
61
'Content-Type' = 'application/json'
62
62
'Accept' = 'application/json' }
63
63
```
@@ -66,11 +66,11 @@ A script example showing API key usage for various operations can be found at [Q
66
66
67
67
### [**REST API**](#tab/rest-use)
68
68
69
-
Set an admin key in the request header using the syntax `api-key=<your-admin-api-key>`. Admin keys are used for most operations, including create, delete, and update. Admin keys are also used on requests issued to the search service itself, such as listing objects or requesting service statistics. see [Connect to Azure Cognitive Search using REST APIs](search-get-started-rest.md#connect-to-azure-cognitive-search) for a more detailed example.
69
+
Set an admin key in the request header using the syntax `api-key` set to yourkey. Admin keys are used for most operations, including create, delete, and update. Admin keys are also used on requests issued to the search service itself, such as listing objects or requesting service statistics. see [Connect to Azure Cognitive Search using REST APIs](search-get-started-rest.md#connect-to-azure-cognitive-search) for a more detailed example.
70
70
71
71
:::image type="content" source="media/search-security-api-keys/rest-headers.png" alt-text="Screenshot of the Headers section of a request in Postman." border="true":::
72
72
73
-
Query keys are used for search, suggestion, or lookup operation that target the `index/docs` collection. For a query key, use the same syntax `api-key=<your-query-api-key>` on a POST request. Or, put the key on the URI if the request is a GET: `GET /indexes/hotels/docs?search=*&$orderby=lastRenovationDate desc&api-version=2020-06-30&api-key=[query key]`
73
+
Query keys are used for search, suggestion, or lookup operations that target the `index/docs` collection. For a query key, use the same syntax `api-key=<your-query-api-key>` on a POST request. Or, put the key on the URI if the request is a GET: `GET /indexes/hotels/docs?search=*&$orderby=lastRenovationDate desc&api-version=2020-06-30&api-key=[query key]`
0 commit comments