query_keys
Creates, updates, deletes, gets or lists a query_keys
resource.
Overview
Name | query_keys |
Type | Resource |
Id | azure.search.query_keys |
Fields
The following fields are returned by SELECT
queries:
- list_by_search_service
All query keys for the given search service were successfully retrieved and are in the response. You can use any of the query keys as the value of the 'api-key' parameter in the Azure AI Search Service REST API or SDK to perform read-only operations on your Search indexes such as querying and looking up documents by ID.
Name | Datatype | Description |
---|---|---|
name | string | The name of the query API key. Query names are optional, but assigning a name can help you remember how it's used. |
key | string | The value of the query API key. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
list_by_search_service | select | resourceGroupName , searchServiceName , subscriptionId | x-ms-client-request-id | Returns the list of query API keys for the given Azure AI Search service. |
create | insert | resourceGroupName , searchServiceName , name , subscriptionId | x-ms-client-request-id | Generates a new query key for the specified search service. You can create up to 50 query keys per service. |
delete | delete | resourceGroupName , searchServiceName , key , subscriptionId | x-ms-client-request-id | Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for regenerating a query key is to delete and then recreate it. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
key | string | The query key to be deleted. Query keys are identified by value, not by name. |
name | string | The name of the new query API key. |
resourceGroupName | string | The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. |
searchServiceName | string | The name of the Azure AI Search service associated with the specified resource group. |
subscriptionId | string | The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal. |
x-ms-client-request-id | string (uuid) | A client-generated GUID value that identifies this request. If specified, this will be included in response information as a way to track the request. |
SELECT
examples
- list_by_search_service
Returns the list of query API keys for the given Azure AI Search service.
SELECT
name,
key
FROM azure.search.query_keys
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND searchServiceName = '{{ searchServiceName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
AND x-ms-client-request-id = '{{ x-ms-client-request-id }}'
;
INSERT
examples
- create
- Manifest
Generates a new query key for the specified search service. You can create up to 50 query keys per service.
INSERT INTO azure.search.query_keys (
resourceGroupName,
searchServiceName,
name,
subscriptionId,
x-ms-client-request-id
)
SELECT
'{{ resourceGroupName }}',
'{{ searchServiceName }}',
'{{ name }}',
'{{ subscriptionId }}',
'{{ x-ms-client-request-id }}'
RETURNING
name,
key
;
# Description fields are for documentation purposes
- name: query_keys
props:
- name: resourceGroupName
value: string
description: Required parameter for the query_keys resource.
- name: searchServiceName
value: string
description: Required parameter for the query_keys resource.
- name: name
value: string
description: Required parameter for the query_keys resource.
- name: subscriptionId
value: string
description: Required parameter for the query_keys resource.
- name: x-ms-client-request-id
value: string (uuid)
description: A client-generated GUID value that identifies this request. If specified, this will be included in response information as a way to track the request.
DELETE
examples
- delete
Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for regenerating a query key is to delete and then recreate it.
DELETE FROM azure.search.query_keys
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND searchServiceName = '{{ searchServiceName }}' --required
AND key = '{{ key }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND x-ms-client-request-id = '{{ x-ms-client-request-id }}'
;