Check Endpoint Name Availability - Check Endpoint Name Availability

Check the availability of a resource name. This is needed for resources where name is globally unique, such as a afdx endpoint.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/checkEndpointNameAvailability?api-version=2023-05-01

URI Parameters

Name In Required Type Description
resourceGroupName
path True

string

Name of the Resource group within the Azure subscription.

Regex pattern: ^[-\w\._\(\)]+$

subscriptionId
path True

string

Azure Subscription ID.

api-version
query True

string

Version of the API to be used with the client request. Current version is 2023-05-01.

Request Body

Name Required Type Description
name True

string

The resource name to validate.

type True

ResourceType

The type of the resource whose name is to be validated.

autoGeneratedDomainNameLabelScope

AutoGeneratedDomainNameLabelScope

Indicates the endpoint name reuse scope. The default value is TenantReuse.

Responses

Name Type Description
200 OK

CheckEndpointNameAvailabilityOutput

OK. The request has succeeded.

Other Status Codes

AfdErrorResponse

Azure Front Door 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

CheckEndpointNameAvailability

Sample Request

POST https://management.azure.com/subscriptions/subid/resourceGroups/myResourceGroup/providers/Microsoft.Cdn/checkEndpointNameAvailability?api-version=2023-05-01

{
  "name": "sampleName",
  "type": "Microsoft.Cdn/Profiles/AfdEndpoints",
  "autoGeneratedDomainNameLabelScope": "TenantReuse"
}

Sample Response

{
  "nameAvailable": false,
  "reason": "Name is already in use",
  "message": "Name not available",
  "availableHostname": ""
}

Definitions

Name Description
AfdErrorResponse

Error response

AutoGeneratedDomainNameLabelScope

Indicates the endpoint name reuse scope. The default value is TenantReuse.

CheckEndpointNameAvailabilityInput

Input of CheckNameAvailability API.

CheckEndpointNameAvailabilityOutput

Output of check name availability API.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ResourceType

Type of CDN resource used in CheckNameAvailability.

AfdErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

AutoGeneratedDomainNameLabelScope

Indicates the endpoint name reuse scope. The default value is TenantReuse.

Name Type Description
NoReuse

string

ResourceGroupReuse

string

SubscriptionReuse

string

TenantReuse

string

CheckEndpointNameAvailabilityInput

Input of CheckNameAvailability API.

Name Type Description
autoGeneratedDomainNameLabelScope

AutoGeneratedDomainNameLabelScope

Indicates the endpoint name reuse scope. The default value is TenantReuse.

name

string

The resource name to validate.

type

ResourceType

The type of the resource whose name is to be validated.

CheckEndpointNameAvailabilityOutput

Output of check name availability API.

Name Type Description
availableHostname

string

Returns the available hostname generated based on the AutoGeneratedDomainNameLabelScope when the name is available, otherwise it returns empty string

message

string

The detailed error message describing why the name is not available.

nameAvailable

boolean

Indicates whether the name is available.

reason

string

The reason why the name is not available.

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ResourceType

Type of CDN resource used in CheckNameAvailability.

Name Type Description
Microsoft.Cdn/Profiles/AfdEndpoints

string

Microsoft.Cdn/Profiles/Endpoints

string