你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Servers - Update

更新服务器。

PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}?api-version=2023-08-01

URI 参数

名称 必需 类型 说明
resourceGroupName
path True

string

包含资源的资源组的名称。 可以从 Azure 资源管理器 API 或门户获取此值。

serverName
path True

string

服务器的名称。

subscriptionId
path True

string

标识 Azure 订阅的订阅 ID。

api-version
query True

string

要用于请求的 API 版本。

请求正文

名称 类型 说明
identity

ResourceIdentity

服务器标识

properties.administratorLogin

string

服务器的管理员用户名。 创建后,无法更改它。

properties.administratorLoginPassword

string

管理员登录密码(创建服务器时需要)。

properties.administrators

ServerExternalAdministrator

服务器的 Azure Active Directory 管理员。 这只能在服务器创建时使用。 如果用于服务器更新,将忽略它,否则将导致错误。 对于各个 API 的更新,需要使用这些 API。

properties.federatedClientId

string (uuid)

用于跨租户 CMK 方案的客户端 ID

properties.isIPv6Enabled

ServerNetworkAccessFlag

是否为此服务器启用 IPv6 支持。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”

properties.keyId

string

要用于加密的密钥的 CMK URI。

properties.minimalTlsVersion

MinimalTlsVersion

最低 TLS 版本。 允许的值:“None”、“1.0”、“1.1”、“1.2”、“1.3”

properties.primaryUserAssignedIdentityId

string

默认情况下要使用的用户分配标识的资源 ID。

properties.publicNetworkAccess

ServerPublicNetworkAccessFlag

是否允许对此服务器使用公共终结点访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”或“SecuredByPerimeter”

properties.restrictOutboundNetworkAccess

ServerNetworkAccessFlag

是否限制此服务器的出站网络访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”

properties.version

string

服务器的版本。

tags

object

资源标记。

响应

名称 类型 说明
200 OK

Server

已成功更新服务器。

202 Accepted

接受

标头

Location: string

Other Status Codes

ErrorResponse

错误响应: ***

  • 400 ManagedInstanceStoppingOrStopped - 实例处于停止/停止状态时提交的冲突作

  • 400 ManagedInstanceStarting - 实例处于启动状态时提交的冲突作

  • 400 NameAlreadyExistsSoftDeleted - 请求的服务器名称由处于软删除状态的服务器获取。 清除或恢复服务器以取消阻止。

  • 400 MissingIdentityId - 当标识类型设置为 UserAssigned 时,不会提供用户分配的标识

  • 400 InvalidPrimaryIdentityId - 用户为 PrimaryUserIdentityId 提供值,但 IdentityId 参数中未列出相同的值

  • 400 PECsNotExistingToDenyPublicNetworkAccess - 无法将拒绝公用网络访问设置为“是”,因为没有启用专用终结点访问服务器。 请设置专用终结点并重试作(https://docs.microsoft.com/azure/sql-database/sql-database-private-endpoint-overview#how-to-set-up-private-link-for-azure-sql-database)。

  • 400 NameAlreadyExists - 提供的名称已存在。

  • 400 UmiMissingAkvPermissions - 用户提供的 PrimaryUserAssignedIdentityId 无权访问提供的 KeyId

  • 400 MissingPrimaryIdentity - 用户提供的 PrimaryUserAssignedIdentityId 无权访问提供的 KeyId

  • 400 ProvisioningDisabled - 按原样显示资源作授权者的错误消息,无需更改

  • 400 PrimaryIdentityMissingPermissionForKeyId - KeyId 由用户在创建期间提供,但在 API 调用中未提供 PrimaryUserAssignedIdentityId

  • 400 InvalidIdentityTypeForKeyId - KeyId 在创建过程中由用户提供,但标识类型未设置为“UserAssigned”

  • 400 InvalidLoginName - 提供的登录名无效。

  • 400 InvalidUsername - 提供的用户名包含无效字符。

  • 400 Ipv6FeatureNotEnabled - 用户尝试在服务器上启用 Ipv6 支持,而无需在订阅上启用功能标志,或者功能支持当前已在该区域禁用。

  • 400 PasswordTooShort - 提供的密码太短

  • 400 AadOnlyAuthenticationIsEnabled - 已启用 Azure Active Directory 仅身份验证。 请与系统管理员联系。

  • 400 RegionDoesNotSupportVersion - 用户尝试在不支持该服务器版本的位置创建指定版本的服务器。

  • 400 PasswordTooLong - 提供的密码太长。

  • 400 PasswordNotComplex - 提供的密码不够复杂。

  • 400 InvalidParameterValue - 为参数提供无效值。

  • 400 InvalidLocation - 指定了无效位置。

  • 400 InvalidServerName - 指定的服务器名称无效。

  • 400 InvalidIdentifier - 标识符包含 NULL 或无效的 unicode 字符。

  • 400 TokenTooLong - 提供的令牌太长。

  • 400 CMKOperationNotAllowed - 当服务器没有 Azure Key Vault 访问时,用户尝试在服务器上执行作。

  • 400 ServerNotFound - 找不到请求的服务器。

  • 400 RegionDoesNotAllowProvisioning - 所选位置不接受新的 Windows Azure SQL 数据库服务器。 这可能会在以后更改。

  • 400 InvalidMinimalTlsVersion - 最低 TLS 版本无效。

  • 400 InvalidExternalAdministratorLogin - 无效或缺少外部管理员登录名。

  • 400 InvalidExternalAdministratorSid - 无效或缺少外部管理员对象 ID。

  • 400 InvalidExternalAdministratorTenantId - 无效或缺少外部管理员租户 ID。

  • 400 ExternalAdministratorPrincipalType - 无效或缺少外部管理员主体类型。 请从用户、应用程序或组中进行选择。

  • 400 MissingExternalAdministratorWithAadOnlyAuth - 若要使用仅限 Azure AD 的身份验证,请提供外部管理员的详细信息。

  • 400 ExternalAdministratorLoginSameAsSqlAdmin - Azure Active Directory 管理员和服务器管理员帐户的名称必须不同。 请提供不同的值。

  • 400 ServerAdministratorNameAlreadyExists - 用户尝试设置外部管理员,并且主体名称已存在于“master”数据库中。

  • 404 ServerNotInSubscriptionResourceGroup - 指定的服务器在指定的资源组和订阅中不存在。

  • 404 SubscriptionDoesNotHaveServer - 找不到请求的服务器

  • 404 OperationIdNotFound - ID作不存在。

  • 404 SubscriptionNotFound - 找不到请求的订阅。

  • 409 CannotCancelOperation - 管理作处于无法取消的状态。

  • 409 OperationCancelled -作已被用户取消。

  • 409 OperationInterrupted - 无法完成资源上的作,因为它被同一资源上的另一个作中断。

  • 409 UpsertLogicalServerRequestAlreadyInProgress - 正在进行的逻辑服务器请求正在进行中,请稍后再次尝试你的请求。

  • 409 ServerDisabled - 服务器已禁用。

  • 409 ConflictingServerOperation - 服务器当前正在进行作。

  • 409 SubscriptionDisabled - 已禁用订阅。

  • 409 ServerQuotaExceeded - 无法将服务器添加到订阅,因为它将超过配额。

  • 409 ServerAlreadyExists - 重复服务器名称。

  • 429 SubscriptionTooManyCreateUpdateRequests - 请求超出可用资源可以处理的最大请求数。

  • 429 SubscriptionTooManyRequests - 请求超出可用资源可以处理的最大请求数。

  • 429 SubscriptionTooManyCreateUpdateRequests - 请求超出可用资源可以处理的最大请求数。

  • 429 SubscriptionTooManyRequests - 请求超出可用资源可以处理的最大请求数。

  • 429 ConflictingSubscriptionOperation - 订阅当前正在进行作。

  • 500 OperationTimedOut -作超时并自动回滚。 请重试该作。

  • 503 TooManyRequests - 请求超出可用资源可以处理的最大请求数。

  • 503 TooManyRequests - 请求超出可用资源可以处理的最大请求数。

示例

Update a server

示例请求

PATCH https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645?api-version=2023-08-01

{
  "properties": {
    "administratorLogin": "dummylogin",
    "administratorLoginPassword": "placeholder",
    "publicNetworkAccess": "Disabled",
    "restrictOutboundNetworkAccess": "Enabled",
    "isIPv6Enabled": "Enabled"
  }
}

示例响应

{
  "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",
    "publicNetworkAccess": "Disabled",
    "restrictOutboundNetworkAccess": "Enabled",
    "isIPv6Enabled": "Enabled",
    "privateEndpointConnections": [
      {
        "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444",
        "properties": {
          "provisioningState": "Ready",
          "privateEndpoint": {
            "id": "/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"
          },
          "privateLinkServiceConnectionState": {
            "status": "Approved",
            "description": "Auto-approved",
            "actionsRequired": "None"
          }
        }
      }
    ]
  }
}
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Sql/locations/japaneast/serverOperationResults/00000000-0000-0000-0000-000000000000?api-version=2023-05-01

定义

名称 说明
AdministratorType

服务器管理员的类型。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

ExternalGovernanceStatus

外部治理的状态。

IdentityType

标识类型。 将此设置为“SystemAssigned”,以便自动为资源创建和分配 Azure Active Directory 主体。

MinimalTlsVersion

最低 TLS 版本。 允许的值:“None”、“1.0”、“1.1”、“1.2”、“1.3”

PrincipalType

服务器管理员的主体类型。

PrivateEndpointConnectionProperties

专用终结点连接的属性。

PrivateEndpointProperty
PrivateEndpointProvisioningState

专用终结点连接的状态。

PrivateLinkServiceConnectionStateActionsRequire

专用链接服务连接所需的作。

PrivateLinkServiceConnectionStateProperty
PrivateLinkServiceConnectionStateStatus

专用链接服务连接状态。

ResourceIdentity

资源的 Azure Active Directory 标识配置。

Server

Azure SQL 数据库服务器。

ServerExternalAdministrator

Active Directory 管理员的属性。

ServerNetworkAccessFlag

是否限制此服务器的出站网络访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”

ServerPrivateEndpointConnection

服务器下的专用终结点连接

ServerPublicNetworkAccessFlag

是否允许对此服务器使用公共终结点访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”或“SecuredByPerimeter”

ServerUpdate

Azure SQL 数据库服务器的更新请求。

ServerWorkspaceFeature

现有服务器是否创建了工作区,以及是否允许从工作区进行连接

UserIdentity

资源的 Azure Active Directory 标识配置。

AdministratorType

服务器管理员的类型。

说明
ActiveDirectory

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

ExternalGovernanceStatus

外部治理的状态。

说明
Disabled
Enabled

IdentityType

标识类型。 将此设置为“SystemAssigned”,以便自动为资源创建和分配 Azure Active Directory 主体。

说明
None
SystemAssigned
SystemAssigned,UserAssigned
UserAssigned

MinimalTlsVersion

最低 TLS 版本。 允许的值:“None”、“1.0”、“1.1”、“1.2”、“1.3”

说明
1.0
1.1
1.2
1.3
None

PrincipalType

服务器管理员的主体类型。

说明
Application
Group
User

PrivateEndpointConnectionProperties

专用终结点连接的属性。

名称 类型 说明
groupIds

string[]

组 ID。

privateEndpoint

PrivateEndpointProperty

连接所属的专用终结点。

privateLinkServiceConnectionState

PrivateLinkServiceConnectionStateProperty

专用终结点连接的连接状态。

provisioningState

PrivateEndpointProvisioningState

专用终结点连接的状态。

PrivateEndpointProperty

名称 类型 说明
id

string

专用终结点的资源 ID。

PrivateEndpointProvisioningState

专用终结点连接的状态。

说明
Approving
Dropping
Failed
Ready
Rejecting

PrivateLinkServiceConnectionStateActionsRequire

专用链接服务连接所需的作。

说明
None

PrivateLinkServiceConnectionStateProperty

名称 类型 说明
actionsRequired

PrivateLinkServiceConnectionStateActionsRequire

专用链接服务连接所需的作。

description

string

专用链接服务连接说明。

status

PrivateLinkServiceConnectionStateStatus

专用链接服务连接状态。

PrivateLinkServiceConnectionStateStatus

专用链接服务连接状态。

说明
Approved
Disconnected
Pending
Rejected

ResourceIdentity

资源的 Azure Active Directory 标识配置。

名称 类型 说明
principalId

string (uuid)

Azure Active Directory 主体 ID。

tenantId

string (uuid)

Azure Active Directory 租户 ID。

type

IdentityType

标识类型。 将此设置为“SystemAssigned”,以便自动为资源创建和分配 Azure Active Directory 主体。

userAssignedIdentities

<string,  UserIdentity>

要使用的用户分配标识的资源 ID

Server

Azure SQL 数据库服务器。

名称 类型 说明
id

string

资源 ID。

identity

ResourceIdentity

服务器的 Azure Active Directory 标识。

kind

string

SQL Server 的类型。 这是用于 Azure 门户体验的元数据。

location

string

资源位置。

name

string

资源名称。

properties.administratorLogin

string

服务器的管理员用户名。 创建后,无法更改它。

properties.administratorLoginPassword

string

管理员登录密码(创建服务器时需要)。

properties.administrators

ServerExternalAdministrator

服务器的 Azure Active Directory 管理员。 这只能在服务器创建时使用。 如果用于服务器更新,将忽略它,否则将导致错误。 对于各个 API 的更新,需要使用这些 API。

properties.externalGovernanceStatus

ExternalGovernanceStatus

外部治理的状态。

properties.federatedClientId

string (uuid)

用于跨租户 CMK 方案的客户端 ID

properties.fullyQualifiedDomainName

string

服务器的完全限定域名。

properties.isIPv6Enabled

ServerNetworkAccessFlag

是否为此服务器启用 IPv6 支持。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”

properties.keyId

string

要用于加密的密钥的 CMK URI。

properties.minimalTlsVersion

MinimalTlsVersion

最低 TLS 版本。 允许的值:“None”、“1.0”、“1.1”、“1.2”、“1.3”

properties.primaryUserAssignedIdentityId

string

默认情况下要使用的用户分配标识的资源 ID。

properties.privateEndpointConnections

ServerPrivateEndpointConnection[]

服务器上的专用终结点连接列表

properties.publicNetworkAccess

ServerPublicNetworkAccessFlag

是否允许对此服务器使用公共终结点访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”或“SecuredByPerimeter”

properties.restrictOutboundNetworkAccess

ServerNetworkAccessFlag

是否限制此服务器的出站网络访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”

properties.state

string

服务器的状态。

properties.version

string

服务器的版本。

properties.workspaceFeature

ServerWorkspaceFeature

现有服务器是否创建了工作区,以及是否允许从工作区进行连接

tags

object

资源标记。

type

string

资源类型。

ServerExternalAdministrator

Active Directory 管理员的属性。

名称 类型 说明
administratorType

AdministratorType

服务器管理员的类型。

azureADOnlyAuthentication

boolean

仅启用 Azure Active Directory 身份验证。

login

string

服务器管理员的登录名。

principalType

PrincipalType

服务器管理员的主体类型。

sid

string (uuid)

服务器管理员的 SID (对象 ID)。

tenantId

string (uuid)

管理员的租户 ID。

ServerNetworkAccessFlag

是否限制此服务器的出站网络访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”

说明
Disabled
Enabled

ServerPrivateEndpointConnection

服务器下的专用终结点连接

名称 类型 说明
id

string

资源 ID。

properties

PrivateEndpointConnectionProperties

专用终结点连接属性

ServerPublicNetworkAccessFlag

是否允许对此服务器使用公共终结点访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”或“SecuredByPerimeter”

说明
Disabled
Enabled
SecuredByPerimeter

ServerUpdate

Azure SQL 数据库服务器的更新请求。

名称 类型 说明
identity

ResourceIdentity

服务器标识

properties.administratorLogin

string

服务器的管理员用户名。 创建后,无法更改它。

properties.administratorLoginPassword

string

管理员登录密码(创建服务器时需要)。

properties.administrators

ServerExternalAdministrator

服务器的 Azure Active Directory 管理员。 这只能在服务器创建时使用。 如果用于服务器更新,将忽略它,否则将导致错误。 对于各个 API 的更新,需要使用这些 API。

properties.externalGovernanceStatus

ExternalGovernanceStatus

外部治理的状态。

properties.federatedClientId

string (uuid)

用于跨租户 CMK 方案的客户端 ID

properties.fullyQualifiedDomainName

string

服务器的完全限定域名。

properties.isIPv6Enabled

ServerNetworkAccessFlag

是否为此服务器启用 IPv6 支持。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”

properties.keyId

string

要用于加密的密钥的 CMK URI。

properties.minimalTlsVersion

MinimalTlsVersion

最低 TLS 版本。 允许的值:“None”、“1.0”、“1.1”、“1.2”、“1.3”

properties.primaryUserAssignedIdentityId

string

默认情况下要使用的用户分配标识的资源 ID。

properties.privateEndpointConnections

ServerPrivateEndpointConnection[]

服务器上的专用终结点连接列表

properties.publicNetworkAccess

ServerPublicNetworkAccessFlag

是否允许对此服务器使用公共终结点访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”或“SecuredByPerimeter”

properties.restrictOutboundNetworkAccess

ServerNetworkAccessFlag

是否限制此服务器的出站网络访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”

properties.state

string

服务器的状态。

properties.version

string

服务器的版本。

properties.workspaceFeature

ServerWorkspaceFeature

现有服务器是否创建了工作区,以及是否允许从工作区进行连接

tags

object

资源标记。

ServerWorkspaceFeature

现有服务器是否创建了工作区,以及是否允许从工作区进行连接

说明
Connected
Disconnected

UserIdentity

资源的 Azure Active Directory 标识配置。

名称 类型 说明
clientId

string (uuid)

Azure Active Directory 客户端 ID。

principalId

string (uuid)

Azure Active Directory 主体 ID。