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

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

NameAccessible byRequired ParamsDescription
list_by_search_serviceSELECTresourceGroupName, searchServiceName, subscriptionIdReturns the list of query API keys for the given Azure AI Search service.
createINSERTname, resourceGroupName, searchServiceName, subscriptionIdGenerates a new query key for the specified search service. You can create up to 50 query keys per service.
deleteDELETEkey, resourceGroupName, searchServiceName, subscriptionIdDeletes 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.

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 resourceGroupName = '{{ resourceGroupName }}'
AND searchServiceName = '{{ searchServiceName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

Use the following StackQL query and manifest file to create a new query_keys resource.

/*+ create */
INSERT INTO azure.search.query_keys (
name,
resourceGroupName,
searchServiceName,
subscriptionId
)
SELECT
'{{ name }}',
'{{ resourceGroupName }}',
'{{ searchServiceName }}',
'{{ subscriptionId }}'
;

DELETE example

Deletes the specified query_keys resource.

/*+ delete */
DELETE FROM azure.search.query_keys
WHERE key = '{{ key }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND searchServiceName = '{{ searchServiceName }}'
AND subscriptionId = '{{ subscriptionId }}';