Query Keys - List By Search Service

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

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/listQueryKeys?api-version=2020-08-01

URI Parameters

Name In Required Type Description
resourceGroupName
path True
  • 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
path True
  • string

The name of the Azure Cognitive Search service associated with the specified resource group.

subscriptionId
path True
  • string

The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal.

api-version
query True
  • string

The API version to use for each request.

Request Header

Name Required Type Description
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.

Responses

Name Type Description
200 OK

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 Cognitive Search Service REST API or SDK to perform read-only operations on your Search indexes such as querying and looking up documents by ID.

Other Status Codes

HTTP 404 (Not Found): The subscription, resource group, or search service could not be found. HTTP 409 (Conflict): The specified subscription is disabled.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

SearchListQueryKeysBySearchService

Sample Request

POST https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/listQueryKeys?api-version=2020-08-01

Sample Response

{
  "value": [
    {
      "name": "Query key for browser-based clients",
      "key": "<a query API key>"
    },
    {
      "name": "Query key for mobile clients",
      "key": "<another query API key>"
    }
  ]
}

Definitions

CloudError

Contains information about an API error.

CloudErrorBody

Describes a particular API error with an error code and a message.

ListQueryKeysResult

Response containing the query API keys for a given Azure Cognitive Search service.

QueryKey

Describes an API key for a given Azure Cognitive Search service that has permissions for query operations only.

CloudError

Contains information about an API error.

Name Type Description
error

Describes a particular API error with an error code and a message.

CloudErrorBody

Describes a particular API error with an error code and a message.

Name Type Description
code
  • string

An error code that describes the error condition more precisely than an HTTP status code. Can be used to programmatically handle specific error cases.

details

Contains nested errors that are related to this error.

message
  • string

A message that describes the error in detail and provides debugging information.

target
  • string

The target of the particular error (for example, the name of the property in error).

ListQueryKeysResult

Response containing the query API keys for a given Azure Cognitive Search service.

Name Type Description
nextLink
  • string

Request URL that can be used to query next page of query keys. Returned when the total number of requested query keys exceed maximum page size.

value

The query keys for the Azure Cognitive Search service.

QueryKey

Describes an API key for a given Azure Cognitive Search service that has permissions for query operations only.

Name Type Description
key
  • string

The value of the query API key.

name
  • string

The name of the query API key; may be empty.