---
title: "Check name validity and availability"
method: POST
path: "/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/checkNameAvailability"
tags: ["Standard operation", "POST"]
---

# Check name validity and availability

`POST /subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/checkNameAvailability`

## Request

- Base URL: `https://management.azure.com`
- URL: `https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/checkNameAvailability`
- Auth: OAuth 2
  - Implicit: `https://login.microsoftonline.com/common/oauth2/authorize`
  - Scopes: `user_impersonation`

This method checks whether a proposed top-level resource name is valid and available.

## Parameters

- `../../../../../../common-types/resource-management/v5/types.json#/components/parameters/ApiVersionParameter` (unresolved $ref)
- `../../../../../../common-types/resource-management/v5/types.json#/components/parameters/SubscriptionIdParameter` (unresolved $ref)
- `../../../../../../common-types/resource-management/v5/types.json#/components/parameters/LocationParameter` (unresolved $ref)

## Request body

- NameAvailabilityRequest: A resource type and proposed name
  - `name` string: The proposed resource name
  - `type` string: The resource type chain (e.g. virtualMachines/extensions)

## Response `200`

The request has succeeded.

- NameAvailabilityResponse: Indicates whether a proposed resource name is available
  - `nameAvailable` boolean: If true, the name is valid and available. If false, 'reason' describes why not.
  - `reason` 'AlreadyExists' | 'Invalid': The reason why the name is not available, if nameAvailable is false
  - `message` string: The localized reason why the name is not available, if nameAvailable is false

## Other responses

- `default`: An unexpected error response.

---

[API](https://skmtc.dev/azure/apis/azure-database-migration-service-classic-resource-provider.md) - [All operations](https://skmtc.dev/azure/apis/azure-database-migration-service-classic-resource-provider/llms.txt) - [OpenAPI document](https://skmtc.dev/azure/apis/azure-database-migration-service-classic-resource-provider/revisions/a034b56d69ce?raw)
