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:

The admin keys were successfully retrieved and are in the response. You can use either the primary or secondary key as the value of the 'api-key' parameter in the Azure AI Search service REST API or SDK to perform any operations on your search service, including privileged operations. Privileged operations include managing resources like indexes and data sources as well as uploading, modifying, or deleting data in your indexes.

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
getselectresourceGroupName, searchServiceName, subscriptionIdx-ms-client-request-idGets the primary and secondary admin API keys for the specified Azure AI Search service.
regenerateexecresourceGroupName, searchServiceName, keyKind, subscriptionIdx-ms-client-request-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
keyKindstringSpecifies which key to regenerate. Valid values include 'primary' and 'secondary'.
resourceGroupNamestringThe name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal.
searchServiceNamestringThe name of the Azure AI Search service associated with the specified resource group.
subscriptionIdstringThe 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-idstring (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

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

SELECT
primaryKey,
secondaryKey
FROM azure.search.admin_keys
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND searchServiceName = '{{ searchServiceName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
AND x-ms-client-request-id = '{{ x-ms-client-request-id }}'
;

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 
@resourceGroupName='{{ resourceGroupName }}' --required,
@searchServiceName='{{ searchServiceName }}' --required,
@keyKind='{{ keyKind }}' --required,
@subscriptionId='{{ subscriptionId }}' --required,
@x-ms-client-request-id='{{ x-ms-client-request-id }}'
;