Managed Server Dns Aliases - Create Or Update

Creates a managed server DNS alias.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}?api-version=2021-11-01

URI Parameters

Name In Required Type Description
dnsAliasName
path True

string

managedInstanceName
path True

string

The name of the managed instance.

resourceGroupName
path True

string

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

subscriptionId
path True

string

The subscription ID that identifies an Azure subscription.

api-version
query True

string

The API version to use for the request.

Request Body

Name Type Description
createDnsRecord

boolean

Whether or not DNS record should be created for this alias.

Responses

Name Type Description
200 OK

ManagedServerDnsAlias

The managed server DNS alias already exists.

201 Created

ManagedServerDnsAlias

Successfully created a managed server DNS alias.

202 Accepted

Accepted

Other Status Codes

*** Error Responses: ***

  • 400 InvalidManagedServerDnsAliasAcquireRequest - The acquire managed server DNS alias request body is empty or invalid.

  • 400 ManagedServerDnsAliasAcquireRequestInvalidOldManagedServerDnsAliasResourceId - The old managed server DNS alias id in request body is empty or invalid (it should have the format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}).

  • 400 ManagedServerDnsAliasAcquireRequestOldManagedServerDnsAliasSubscriptionMismatch - The old managed server DNS subscription id in request body is different than the one in request URI.

  • 400 ManagedServerDnsAliasAcquireRequestOldManagedServerDnsAliasNameMismatch - The old managed server DNS alias name in request body is different than the one in request URI.

  • 400 ServerDnsAliasDoesNotExist - Server DNS Alias does not exist on a server.

  • 400 UnableToTurnOnTableAuditingForDbOnServerWithServerDnsAlias - Server Dns Aliases are not working correctly for database that has Table Auditing turned on

  • 400 UnableToCreateServerDnsAliasDueToTableAuditing - The Server DNS Alias cannot be created for server that has table auditing turned on.

  • 400 UnableToCreateServerDnsAliasDueToTableAuditingForDb - Server DNS Alias cannot be created for server '{0}' because database '{1}' has Table Auditing or Security Enabled Access feature enabled.

  • 400 LimitOfServerDnsAliasesPerServerExceeded - Creating new Server Dns Alias will exceed the allowed number of Server DNS Aliases per server.

  • 400 UnableToTurnOnTableAuditingForServerWithServerDnsAlias - Server Dns Aliases are not working correctly for server that has Table Auditing turned on

  • 400 NameAlreadyExists - The provided name already exists.

  • 400 CannotUseReservedDatabaseName - Cannot use reserved database name in this operation.

  • 400 TokenTooLong - The provided token is too long.

  • 400 InvalidServerDnsAliasNameForNamedInstance - Invalid Server DNS Alias name was supplied.

  • 400 UnableToResolveRemoteServer - The remote partner server name could not be resolved due to an invalid server name or DNS connectivity issues.

  • 400 InvalidServerName - Invalid server name specified.

  • 400 InvalidIdentifier - The identifier contains NULL or an invalid unicode character.

  • 400 InvalidServerDnsAliasName - Invalid Server DNS Alias name was supplied.

  • 400 ServerNotFound - The requested server was not found.

  • 404 SubscriptionDoesNotHaveServer - The requested server was not found

  • 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.

  • 404 ResourceNotFound - The requested resource was not found.

  • 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.

  • 404 ServerNotInSubscription - Specified server does not exist on the specified subscription.

  • 404 OperationIdNotFound - The operation with Id does not exist.

  • 409 ServerDnsAliasBusy - Server DNS Alias is busy with another operation.

  • 409 SubscriptionDisabled - Subscription is disabled.

  • 409 ManagedServerAliasDnsZoneMismatch - Managed Server Alias Dns Zone Mismatch

  • 409 ServerDnsAliasDnsRecordInUse - A duplicate DNS record exists for the requested endpoint.

  • 409 ServerDnsAliasAlreadyExists - Server DNS Alias already exists on a given server.

  • 409 ConflictingServerOperation - An operation is currently in progress for the server.

  • 409 OperationCancelled - The operation has been cancelled by user.

  • 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.

  • 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.

  • 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.

  • 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.

  • 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.

  • 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.

  • 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.

  • 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.

  • 504 RequestTimeout - Service request exceeded the allowed timeout.

Examples

Create managed server DNS alias

Sample request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/dns-mi/dnsAliases/dns-alias-mi?api-version=2021-11-01

{}

Sample response

{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/dns-mi/dnsAliases/dns-alias-mi",
  "name": "dns-alias-mi",
  "type": "Microsoft.Sql/managedInstances/dnsAliases",
  "properties": {
    "azureDnsRecord": "dns-alias-mi.abcd1234.database.windows.net"
  }
}
{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/dns-mi/dnsAliases/dns-alias-mi",
  "name": "dns-alias-mi",
  "type": "Microsoft.Sql/managedInstances/dnsAliases",
  "properties": {
    "azureDnsRecord": "dns-alias-mi.abcd1234.database.windows.net"
  }
}

Definitions

Name Description
ManagedServerDnsAlias

A managed server DNS alias.

ManagedServerDnsAliasCreation

A managed server dns alias creation request.

ManagedServerDnsAlias

A managed server DNS alias.

Name Type Description
id

string

Resource ID.

name

string

Resource name.

properties.azureDnsRecord

string

The fully qualified DNS record for managed server alias

properties.publicAzureDnsRecord

string

The fully qualified public DNS record for managed server alias

type

string

Resource type.

ManagedServerDnsAliasCreation

A managed server dns alias creation request.

Name Type Default value Description
createDnsRecord

boolean

True

Whether or not DNS record should be created for this alias.