Partager via


Storage Accounts - Check Name Availability

Checks that the storage account name is valid and is not already in use.

POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability?api-version=2023-05-01

URI Parameters

Name In Required Type Description
subscriptionId
path True

string

The ID of the target subscription.

api-version
query True

string

The API version to use for this operation.

Request Body

Name Required Type Description
name True

string

The storage account name.

type True

Type

The type of resource, Microsoft.Storage/storageAccounts

Responses

Name Type Description
200 OK

CheckNameAvailabilityResult

OK -- Operation to check the storage account name availability was successful.

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

StorageAccountCheckNameAvailability

Sample request

POST https://management.azure.com/subscriptions/{subscription-id}/providers/Microsoft.Storage/checkNameAvailability?api-version=2023-05-01

{
  "name": "sto3363",
  "type": "Microsoft.Storage/storageAccounts"
}

Sample response

{
  "nameAvailable": true
}

Definitions

Name Description
CheckNameAvailabilityResult

The CheckNameAvailability operation response.

Reason

Gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is false.

StorageAccountCheckNameAvailabilityParameters

The parameters used to check the availability of the storage account name.

Type

The type of resource, Microsoft.Storage/storageAccounts

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 is invalid and cannot be used.

reason

Reason

Gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is false.

Reason

Gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is false.

Name Type Description
AccountNameInvalid

string

AlreadyExists

string

StorageAccountCheckNameAvailabilityParameters

The parameters used to check the availability of the storage account name.

Name Type Description
name

string

The storage account name.

type

Type

The type of resource, Microsoft.Storage/storageAccounts

Type

The type of resource, Microsoft.Storage/storageAccounts

Name Type Description
Microsoft.Storage/storageAccounts

string