你当前正在访问 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=2021-11-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 管理员。

properties.federatedClientId

string

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

properties.keyId

string

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

properties.minimalTlsVersion

string

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

properties.primaryUserAssignedIdentityId

string

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

properties.publicNetworkAccess

ServerNetworkAccessFlag

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

properties.restrictOutboundNetworkAccess

ServerNetworkAccessFlag

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

properties.version

string

服务器的版本。

tags

object

资源标记。

响应

名称 类型 说明
200 OK

Server

已成功更新服务器。

202 Accepted

已接受

Other Status Codes

错误响应:***

  • 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 RegionDoesNotAllowProvisioning - 所选位置不接受新的 Windows Azure SQL 数据库服务器。 这可能会在以后更改。

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

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

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

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

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

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

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

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

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

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

  • 404 OperationIdNotFound - ID 为 的操作不存在。

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

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

  • 409 操作中断 - 无法完成对资源的操作,因为同一资源上的另一个操作中断了该操作。

  • 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

Sample Request

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

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

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",
    "publicNetworkAccess": "Disabled",
    "restrictOutboundNetworkAccess": "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"
          }
        }
      }
    ]
  }
}

定义

名称 说明
AdministratorType

服务器管理员的类型。

IdentityType

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

PrincipalType

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

PrivateEndpointConnectionProperties

专用终结点连接的属性。

PrivateEndpointProperty
PrivateEndpointProvisioningState

专用终结点连接的状态。

PrivateLinkServiceConnectionStateActionsRequire

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

PrivateLinkServiceConnectionStateProperty
PrivateLinkServiceConnectionStateStatus

专用链接服务连接状态。

ResourceIdentity

资源的 Azure Active Directory 标识配置。

Server

Azure SQL数据库服务器。

ServerExternalAdministrator

Active Directory 管理员的属性。

ServerNetworkAccessFlag

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

ServerPrivateEndpointConnection

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

ServerUpdate

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

ServerWorkspaceFeature

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

UserIdentity

资源的 Azure Active Directory 标识配置。

AdministratorType

服务器管理员的类型。

名称 类型 说明
ActiveDirectory

string

IdentityType

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

名称 类型 说明
None

string

SystemAssigned

string

SystemAssigned,UserAssigned

string

UserAssigned

string

PrincipalType

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

名称 类型 说明
Application

string

Group

string

User

string

PrivateEndpointConnectionProperties

专用终结点连接的属性。

名称 类型 说明
groupIds

string[]

组 ID。

privateEndpoint

PrivateEndpointProperty

连接所属的专用终结点。

privateLinkServiceConnectionState

PrivateLinkServiceConnectionStateProperty

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

provisioningState

PrivateEndpointProvisioningState

专用终结点连接的状态。

PrivateEndpointProperty

名称 类型 说明
id

string

专用终结点的资源 ID。

PrivateEndpointProvisioningState

专用终结点连接的状态。

名称 类型 说明
Approving

string

Dropping

string

Failed

string

Ready

string

Rejecting

string

PrivateLinkServiceConnectionStateActionsRequire

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

名称 类型 说明
None

string

PrivateLinkServiceConnectionStateProperty

名称 类型 说明
actionsRequired

PrivateLinkServiceConnectionStateActionsRequire

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

description

string

专用链接服务连接说明。

status

PrivateLinkServiceConnectionStateStatus

专用链接服务连接状态。

PrivateLinkServiceConnectionStateStatus

专用链接服务连接状态。

名称 类型 说明
Approved

string

Disconnected

string

Pending

string

Rejected

string

ResourceIdentity

资源的 Azure Active Directory 标识配置。

名称 类型 说明
principalId

string

Azure Active Directory 主体 ID。

tenantId

string

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 管理员。

properties.federatedClientId

string

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

properties.fullyQualifiedDomainName

string

服务器的完全限定域名。

properties.keyId

string

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

properties.minimalTlsVersion

string

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

properties.primaryUserAssignedIdentityId

string

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

properties.privateEndpointConnections

ServerPrivateEndpointConnection[]

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

properties.publicNetworkAccess

ServerNetworkAccessFlag

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

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

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

tenantId

string

管理员的租户 ID。

ServerNetworkAccessFlag

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

名称 类型 说明
Disabled

string

Enabled

string

ServerPrivateEndpointConnection

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

名称 类型 说明
id

string

资源 ID。

properties

PrivateEndpointConnectionProperties

专用终结点连接属性

ServerUpdate

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

名称 类型 说明
identity

ResourceIdentity

服务器标识

properties.administratorLogin

string

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

properties.administratorLoginPassword

string

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

properties.administrators

ServerExternalAdministrator

服务器的 Azure Active Directory 管理员。

properties.federatedClientId

string

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

properties.fullyQualifiedDomainName

string

服务器的完全限定域名。

properties.keyId

string

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

properties.minimalTlsVersion

string

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

properties.primaryUserAssignedIdentityId

string

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

properties.privateEndpointConnections

ServerPrivateEndpointConnection[]

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

properties.publicNetworkAccess

ServerNetworkAccessFlag

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

properties.restrictOutboundNetworkAccess

ServerNetworkAccessFlag

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

properties.state

string

服务器的状态。

properties.version

string

服务器的版本。

properties.workspaceFeature

ServerWorkspaceFeature

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

tags

object

资源标记。

ServerWorkspaceFeature

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

名称 类型 说明
Connected

string

Disconnected

string

UserIdentity

资源的 Azure Active Directory 标识配置。

名称 类型 说明
clientId

string

Azure Active Directory 客户端 ID。

principalId

string

Azure Active Directory 主体 ID。