Vaults - Check Name Availability
Checks that the vault name is valid and is not already in use.
POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/checkNameAvailability?api-version=2022-07-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
subscription
|
path | True |
string |
Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
api-version
|
query | True |
string |
Client Api Version. |
Request Body
Name | Required | Type | Description |
---|---|---|---|
name | True |
string |
The vault name. |
type | True |
The type of resource, Microsoft.KeyVault/vaults |
Responses
Name | Type | Description |
---|---|---|
200 OK |
OK -- Operation to check the vault name availability was successful. |
|
Other Status Codes |
Error response describing why the operation failed. |
Examples
Validate a vault name
Sample Request
Sample Response
{
"nameAvailable": true
}
Definitions
Name | Description |
---|---|
Check |
The CheckNameAvailability operation response. |
Cloud |
An error response from Key Vault resource provider |
Cloud |
An error response from Key Vault resource provider |
Reason |
The reason that a vault name could not be used. The Reason element is only returned if NameAvailable is false. |
Type |
The type of resource, Microsoft.KeyVault/vaults |
Vault |
The parameters used to check the availability of the vault name. |
CheckNameAvailabilityResult
The CheckNameAvailability operation response.
Name | Type | Description |
---|---|---|
message |
string |
An error message explaining the Reason value in more detail. |
nameAvailable |
boolean |
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 |
The reason that a vault name could not be used. The Reason element is only returned if NameAvailable is false. |
CloudError
An error response from Key Vault resource provider
Name | Type | Description |
---|---|---|
error |
An error response from Key Vault resource provider |
CloudErrorBody
An error response from Key Vault resource provider
Name | Type | Description |
---|---|---|
code |
string |
Error code. This is a mnemonic that can be consumed programmatically. |
message |
string |
User friendly error message. The message is typically localized and may vary with service version. |
Reason
The reason that a vault name could not be used. The Reason element is only returned if NameAvailable is false.
Name | Type | Description |
---|---|---|
AccountNameInvalid |
string |
|
AlreadyExists |
string |
Type
The type of resource, Microsoft.KeyVault/vaults
Name | Type | Description |
---|---|---|
Microsoft.KeyVault/vaults |
string |
VaultCheckNameAvailabilityParameters
The parameters used to check the availability of the vault name.
Name | Type | Description |
---|---|---|
name |
string |
The vault name. |
type |
The type of resource, Microsoft.KeyVault/vaults |