Servers - Create Or Update

Creates or updates a server.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}?api-version=2015-05-01-preview

URI Parameters

Name In Required Type Description
subscriptionId
path True
  • string

The subscription ID that identifies an Azure subscription.

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.

serverName
path True
  • string

The name of the server.

api-version
query True
  • string

The API version to use for the request.

Request Body

Name Required Type Description
identity

The Azure Active Directory identity of the server.

location True
  • string

Resource location.

properties.administratorLogin
  • string

Administrator username for the server. Once created it cannot be changed.

properties.administratorLoginPassword
  • string

The administrator login password (required for server creation).

properties.version
  • string

The version of the server.

tags
  • <string, string>

Resource tags.

Responses

Name Type Description
200 OK

Successfully updated the server.

201 Created

Successfully created the server.

202 Accepted

Accepted

Other Status Codes

*** Error Responses: ***

  • 400 NameAlreadyExists - The provided name already exists.

  • 400 RegionDoesNotSupportVersion - A user attempted to create a server of a specified version in a location where that server version isn't supported.

  • 400 ServerNotFound - The requested server was not found.

  • 400 InvalidUsername - Supplied user name contains invalid characters.

  • 400 InvalidParameterValue - An invalid value was given to a parameter.

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

  • 400 TokenTooLong - The provided token is too long.

  • 400 InvalidLoginName - The provided login name is invalid.

  • 400 PasswordTooShort - The provided password is too short

  • 400 PasswordTooLong - The provided password is too long.

  • 400 PasswordNotComplex - The provided password is not complex enough.

  • 400 SubscriptionNotFound - The requested subscription was not found.

  • 400 InvalidLocation - An invalid location was specified.

  • 400 InvalidServerName - Invalid server name specified.

  • 400 RegionDoesNotAllowProvisioning - The selected location is not accepting new Windows Azure SQL Database servers. This may change at a later time.

  • 404 SubscriptionDoesNotHaveServer - The requested server was not found

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

  • 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.

  • 409 ServerAlreadyExists - Duplicate server name.

  • 409 SubscriptionDisabled - Subscription is disabled.

  • 409 ServerDisabled - Server is disabled.

  • 409 ServerQuotaExceeded - Server cannot be added to a subscription because it will exceed quota.

  • 429 ConflictingSubscriptionOperation - An operation is currently in progress for the subscription.

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

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

Examples

Create server with all properties
Create server with minimal properties

Create server with all properties

Sample Request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645?api-version=2015-05-01-preview
{
  "tags": {
    "tagKey1": "TagValue1"
  },
  "location": "Japan East",
  "properties": {
    "fullyQualifiedDomainName": "sqlcrudtest-4645.database.windows.net",
    "administratorLogin": "dummylogin",
    "administratorLoginPassword": "Un53cuRE!",
    "version": "12.0",
    "state": "Ready"
  }
}

Sample Response

{
  "tags": {
    "tagKey1": "TagValue1"
  },
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645",
  "name": "sqlcrudtest-4645",
  "type": "Microsoft.Sql/servers",
  "location": "japaneast",
  "kind": "v12.0",
  "properties": {
    "fullyQualifiedDomainName": "sqlcrudtest-4645.database.windows.net",
    "administratorLogin": "dummylogin",
    "version": "12.0",
    "state": "Ready"
  }
}
{
  "tags": {
    "tagKey1": "TagValue1"
  },
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645",
  "name": "sqlcrudtest-4645",
  "type": "Microsoft.Sql/servers",
  "location": "japaneast",
  "kind": "v12.0",
  "properties": {
    "fullyQualifiedDomainName": "sqlcrudtest-4645.database.windows.net",
    "administratorLogin": "dummylogin",
    "version": "12.0",
    "state": "Ready"
  }
}

Create server with minimal properties

Sample Request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645?api-version=2015-05-01-preview
{
  "properties": {
    "administratorLogin": "dummylogin",
    "administratorLoginPassword": "Un53cuRE!"
  },
  "location": "Japan East"
}

Sample Response

{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645",
  "name": "sqlcrudtest-4645",
  "type": "Microsoft.Sql/servers",
  "location": "japaneast",
  "kind": "v12.0",
  "properties": {
    "fullyQualifiedDomainName": "sqlcrudtest-4645.database.windows.net",
    "administratorLogin": "dummylogin",
    "version": "12.0",
    "state": "Ready"
  }
}
{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645",
  "name": "sqlcrudtest-4645",
  "type": "Microsoft.Sql/servers",
  "location": "japaneast",
  "kind": "v12.0",
  "properties": {
    "fullyQualifiedDomainName": "sqlcrudtest-4645.database.windows.net",
    "administratorLogin": "dummylogin",
    "version": "12.0",
    "state": "Ready"
  }
}

Definitions

IdentityType

The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource.

ResourceIdentity

Azure Active Directory identity configuration for a resource.

Server

An Azure SQL Database server.

IdentityType

The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource.

Name Type Description
SystemAssigned
  • string

ResourceIdentity

Azure Active Directory identity configuration for a resource.

Name Type Description
principalId
  • string

The Azure Active Directory principal id.

tenantId
  • string

The Azure Active Directory tenant id.

type

The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource.

Server

An Azure SQL Database server.

Name Type Description
id
  • string

Resource ID.

identity

The Azure Active Directory identity of the server.

kind
  • string

Kind of sql server. This is metadata used for the Azure portal experience.

location
  • string

Resource location.

name
  • string

Resource name.

properties.administratorLogin
  • string

Administrator username for the server. Once created it cannot be changed.

properties.administratorLoginPassword
  • string

The administrator login password (required for server creation).

properties.fullyQualifiedDomainName
  • string

The fully qualified domain name of the server.

properties.state
  • string

The state of the server.

properties.version
  • string

The version of the server.

tags
  • <string, string>

Resource tags.

type
  • string

Resource type.