Skip to main content

query_keys

Creates, updates, deletes, gets or lists a query_keys resource.

Overview

Namequery_keys
TypeResource
Idazure.search.query_keys

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the query API key. Query names are optional, but assigning a name can help you remember how it's used.
keystringThe value of the query API key.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_by_search_serviceselectresource_group_name, search_service_name, subscription_idReturns the list of query API keys for the given Azure AI Search service.
createinsertresource_group_name, search_service_name, name, subscription_idGenerates a new query key for the specified search service. You can create up to 50 query keys per service.
deletedeleteresource_group_name, search_service_name, key_name, subscription_idDeletes 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. Returns 200 (OK) on successful deletion, 204 (No Content) if the service exists but the query keys not found, or 404 (Not Found) if the service is not found. NOTE: The behavior of returning 404 is inconsistent with ARM guidelines. Clients should expect a 204 response in future versions and avoid new dependencies on the 404 response.

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.

NameDatatypeDescription
key_namestringThe query key to be deleted. Query keys are identified by value, not by name. Required.
namestringThe name of the new query API key. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
search_service_namestringThe name of the Azure AI Search service associated with the specified resource group. Required.
subscription_idstring

SELECT examples

Returns the list of query API keys for the given Azure AI Search service.

SELECT
name,
key
FROM azure.search.query_keys
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND search_service_name = '{{ search_service_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

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 (
resource_group_name,
search_service_name,
name,
subscription_id
)
SELECT
'{{ resource_group_name }}',
'{{ search_service_name }}',
'{{ name }}',
'{{ subscription_id }}'
RETURNING
name,
key
;

DELETE examples

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. Returns 200 (OK) on successful deletion, 204 (No Content) if the service exists but the query keys not found, or 404 (Not Found) if the service is not found. NOTE: The behavior of returning 404 is inconsistent with ARM guidelines. Clients should expect a 204 response in future versions and avoid new dependencies on the 404 response.

DELETE FROM azure.search.query_keys
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND search_service_name = '{{ search_service_name }}' --required
AND key_name = '{{ key_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;