Iot Hub Resource - Check Name Availability

Check if an IoT hub name is available.

POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkNameAvailability?api-version=2023-06-30

URI Parameters

Name In Required Type Description
subscriptionId
path True

string

The subscription identifier.

api-version
query True

string

The version of the API.

Request Body

Name Required Type Description
name True

string

The name of the IoT hub to check.

Responses

Name Type Description
200 OK

IotHubNameAvailabilityInfo

This is a synchronous operation. The body contains a JSON-serialized response that specifies whether the IoT hub name is available. If the name is not available, the body contains the reason.

Other Status Codes

ErrorDetails

DefaultErrorResponse

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

IotHubResource_CheckNameAvailability

Sample request

POST https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/providers/Microsoft.Devices/checkNameAvailability?api-version=2023-06-30

{
  "name": "test-request"
}

Sample response

{
  "nameAvailable": true,
  "reason": "Invalid",
  "message": ""
}

Definitions

Name Description
ErrorDetails

Error details.

IotHubNameAvailabilityInfo

The properties indicating whether a given IoT hub name is available.

IotHubNameUnavailabilityReason

The reason for unavailability.

OperationInputs

Input values.

ErrorDetails

Error details.

Name Type Description
code

string

The error code.

details

string

The error details.

httpStatusCode

string

The HTTP status code.

message

string

The error message.

IotHubNameAvailabilityInfo

The properties indicating whether a given IoT hub name is available.

Name Type Description
message

string

The detailed reason message.

nameAvailable

boolean

The value which indicates whether the provided name is available.

reason

IotHubNameUnavailabilityReason

The reason for unavailability.

IotHubNameUnavailabilityReason

The reason for unavailability.

Name Type Description
AlreadyExists

string

Invalid

string

OperationInputs

Input values.

Name Type Description
name

string

The name of the IoT hub to check.