Managed Hsms - Check Mhsm Name Availability

Checks that the managed hsm name is valid and is not already in use.

POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/checkMhsmNameAvailability?api-version=2022-07-01

URI Parameters

Name In Required Type Description
subscriptionId
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 managed hsm name.

Responses

Name Type Description
200 OK

CheckMhsmNameAvailabilityResult

OK -- Operation to check the mhsm name availability was successful.

Other Status Codes

CloudError

Error response describing why the operation failed.

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

Validate a managed hsm name

Sample request

POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/checkMhsmNameAvailability?api-version=2022-07-01

{
  "name": "sample-mhsm"
}

Sample response

{
  "nameAvailable": true
}

Definitions

Name Description
CheckMhsmNameAvailabilityParameters

The parameters used to check the availability of the managed hsm name.

CheckMhsmNameAvailabilityResult

The CheckMhsmNameAvailability operation response.

CloudError

An error response from Key Vault resource provider

CloudErrorBody

An error response from Key Vault resource provider

Reason

The reason that a managed hsm name could not be used. The reason element is only returned if NameAvailable is false.

CheckMhsmNameAvailabilityParameters

The parameters used to check the availability of the managed hsm name.

Name Type Description
name

string

The managed hsm name.

CheckMhsmNameAvailabilityResult

The CheckMhsmNameAvailability 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

Reason

The reason that a managed hsm 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

CloudErrorBody

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 managed hsm name could not be used. The reason element is only returned if NameAvailable is false.

Name Type Description
AccountNameInvalid

string

AlreadyExists

string