Services - Check Name Availability

Checks whether or not the given search service name is available for use. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net).

POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Search/checkNameAvailability?api-version=2026-03-01-preview

URI Parameters

Name In Required Type Description
subscriptionId
path True

string (uuid)

The ID of the target subscription. The value must be an UUID.

api-version
query True

string

minLength: 1

The API version to use for this operation.

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.

Request Body

Name Required Type Description
name True

string

The search service name to validate. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length.

type True enum:

searchServices

The type of the resource whose name is to be validated. This value must always be 'searchServices'.

Responses

Name Type Description
200 OK

CheckNameAvailabilityOutput

The request has succeeded.

Other Status Codes

CloudError

An unexpected error response.

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

SearchCheckNameAvailability

Sample request

POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Search/checkNameAvailability?api-version=2026-03-01-preview

{
  "name": "mysearchservice",
  "type": "searchServices"
}

Sample response

{
  "nameAvailable": false,
  "reason": "AlreadyExists",
  "message": ""
}

Definitions

Name Description
CheckNameAvailabilityInput

Input of check name availability API.

CheckNameAvailabilityOutput

Output of check name availability API.

CloudError

Contains information about an API error.

CloudErrorBody

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

UnavailableNameReason

The reason why the name is not available. 'Invalid' indicates the name provided does not match the naming requirements (incorrect length, unsupported characters, etc.). 'AlreadyExists' indicates that the name is already in use and is therefore unavailable.

CheckNameAvailabilityInput

Input of check name availability API.

Name Type Description
name

string

The search service name to validate. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length.

type enum:

searchServices

The type of the resource whose name is to be validated. This value must always be 'searchServices'.

CheckNameAvailabilityOutput

Output of check name availability API.

Name Type Description
message

string

A message that explains why the name is invalid and provides resource naming requirements. Available only if 'Invalid' is returned in the 'reason' property.

nameAvailable

boolean

A value indicating whether the name is available.

reason

UnavailableNameReason

The reason why the name is not available. 'Invalid' indicates the name provided does not match the naming requirements (incorrect length, unsupported characters, etc.). 'AlreadyExists' indicates that the name is already in use and is therefore unavailable.

CloudError

Contains information about an API error.

Name Type Description
error

CloudErrorBody

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

message

string

A brief description of the error that hints at what went wrong (for details/debugging information refer to the 'error.message' property).

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

CloudErrorBody[]

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).

UnavailableNameReason

The reason why the name is not available. 'Invalid' indicates the name provided does not match the naming requirements (incorrect length, unsupported characters, etc.). 'AlreadyExists' indicates that the name is already in use and is therefore unavailable.

Value Description
Invalid

The search service name doesn't match naming requirements.

AlreadyExists

The search service name is already assigned to a different search service.