Location - Check Name Availability
Checks whether the Batch account name is available in the specified region.
POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/checkNameAvailability?api-version=2024-07-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
location
|
path | True |
string |
The desired region for the name check. |
subscription
|
path | True |
string |
The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) |
api-version
|
query | True |
string |
The API version to be used with the HTTP request. |
Request Body
Name | Required | Type | Description |
---|---|---|---|
name | True |
string |
The name to check for availability |
type | True |
The resource type. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Success. Returns details about whether a Batch account name is available. |
|
Other Status Codes |
Error response describing why the operation failed. |
Security
azure_auth
Microsoft Entra OAuth 2.0 auth code flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | impersonate your user account |
Examples
Location |
Location |
LocationCheckNameAvailability_AlreadyExists
Sample request
Sample response
{
"nameAvailable": false,
"reason": "AlreadyExists",
"message": "An account named 'existingaccountname' is already in use."
}
LocationCheckNameAvailability_Available
Sample request
Sample response
{
"nameAvailable": true
}
Definitions
Name | Description |
---|---|
Check |
Parameters for a check name availability request. |
Check |
The CheckNameAvailability operation response. |
Cloud |
An error response from the Batch service. |
Cloud |
An error response from the Batch service. |
Name |
Gets the reason that a Batch account name could not be used. The Reason element is only returned if NameAvailable is false. |
Resource |
The resource type. |
CheckNameAvailabilityParameters
Parameters for a check name availability request.
Name | Type | Description |
---|---|---|
name |
string |
The name to check for availability |
type |
The resource type. |
CheckNameAvailabilityResult
The CheckNameAvailability operation response.
Name | Type | Description |
---|---|---|
message |
string |
Gets an error message explaining the Reason value in more detail. |
nameAvailable |
boolean |
Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or invalid and cannot be used. |
reason |
Gets the reason that a Batch account name could not be used. The Reason element is only returned if NameAvailable is false. |
CloudError
An error response from the Batch service.
Name | Type | Description |
---|---|---|
error |
The body of the error response. |
CloudErrorBody
An error response from the Batch service.
Name | Type | Description |
---|---|---|
code |
string |
An identifier for the error. Codes are invariant and are intended to be consumed programmatically. |
details |
A list of additional details about the error. |
|
message |
string |
A message describing the error, intended to be suitable for display in a user interface. |
target |
string |
The target of the particular error. For example, the name of the property in error. |
NameAvailabilityReason
Gets the reason that a Batch account name could not be used. The Reason element is only returned if NameAvailable is false.
Value | Description |
---|---|
Invalid |
The requested name is invalid. |
AlreadyExists |
The requested name is already in use. |
ResourceType
The resource type.
Value | Description |
---|---|
Microsoft.Batch/batchAccounts |
The Batch account resource type. |