Skip to main content

admin_keys

Creates, updates, deletes, gets or lists an admin_keys resource.

Overview

Nameadmin_keys
TypeResource
Idazure.search.admin_keys

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
primaryKeystringThe primary admin API key of the search service.
secondaryKeystringThe secondary admin API key of the search service.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, search_service_name, subscription_idGets the primary and secondary admin API keys for the specified Azure AI Search service.
regenerateexecresource_group_name, search_service_name, key_kind, subscription_idRegenerates either the primary or secondary admin API key. You can only regenerate one key at a time.

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_kindstringSpecifies which key to regenerate. Valid values include 'primary' and 'secondary'. Known values are: "primary" and "secondary". 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

Gets the primary and secondary admin API keys for the specified Azure AI Search service.

SELECT
primaryKey,
secondaryKey
FROM azure.search.admin_keys
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND search_service_name = '{{ search_service_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

Lifecycle Methods

Regenerates either the primary or secondary admin API key. You can only regenerate one key at a time.

EXEC azure.search.admin_keys.regenerate 
@resource_group_name='{{ resource_group_name }}' --required,
@search_service_name='{{ search_service_name }}' --required,
@key_kind='{{ key_kind }}' --required,
@subscription_id='{{ subscription_id }}' --required
;