Servers - Create Or Update
创建或更新服务器。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}?api-version=2023-08-01
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
resource
|
path | True |
string |
包含资源的资源组的名称。 可以从 Azure 资源管理器 API 或门户获取此值。 |
|
server
|
path | True |
string |
服务器的名称。 |
|
subscription
|
path | True |
string |
标识 Azure 订阅的订阅 ID。 |
|
api-version
|
query | True |
string |
要用于请求的 API 版本。 |
请求正文
| 名称 | 必需 | 类型 | 说明 |
|---|---|---|---|
| location | True |
string |
资源位置。 |
| identity |
服务器的 Azure Active Directory 标识。 |
||
| properties.administratorLogin |
string |
服务器的管理员用户名。 创建后,无法更改它。 |
|
| properties.administratorLoginPassword |
string |
管理员登录密码(创建服务器时需要)。 |
|
| properties.administrators |
服务器的 Azure Active Directory 管理员。 这只能在服务器创建时使用。 如果用于服务器更新,将忽略它,否则将导致错误。 对于各个 API 的更新,需要使用这些 API。 |
||
| properties.federatedClientId |
string (uuid) |
用于跨租户 CMK 方案的客户端 ID |
|
| properties.isIPv6Enabled |
是否为此服务器启用 IPv6 支持。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled” |
||
| properties.keyId |
string |
要用于加密的密钥的 CMK URI。 |
|
| properties.minimalTlsVersion |
最低 TLS 版本。 允许的值:“None”、“1.0”、“1.1”、“1.2”、“1.3” |
||
| properties.primaryUserAssignedIdentityId |
string |
默认情况下要使用的用户分配标识的资源 ID。 |
|
| properties.publicNetworkAccess |
是否允许对此服务器使用公共终结点访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”或“SecuredByPerimeter” |
||
| properties.restrictOutboundNetworkAccess |
是否限制此服务器的出站网络访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled” |
||
| properties.version |
string |
服务器的版本。 |
|
| tags |
object |
资源标记。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
已成功更新服务器。 |
|
| 201 Created |
已成功创建服务器。 |
|
| 202 Accepted |
接受 标头 Location: string |
|
| Other Status Codes |
错误响应: ***
|
示例
Create server
示例请求
PUT 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",
"administrators": {
"principalType": "User",
"login": "bob@contoso.com",
"sid": "00000011-1111-2222-2222-123456789111",
"tenantId": "00000011-1111-2222-2222-123456789111",
"azureADOnlyAuthentication": true
},
"publicNetworkAccess": "Enabled",
"restrictOutboundNetworkAccess": "Enabled",
"isIPv6Enabled": "Enabled"
},
"location": "Japan East"
}
示例响应
{
"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": "Enabled",
"restrictOutboundNetworkAccess": "Enabled",
"isIPv6Enabled": "Enabled",
"administrators": {
"principalType": "User",
"login": "bob@contoso.com",
"sid": "00000011-1111-2222-2222-123456789111",
"tenantId": "00000011-1111-2222-2222-123456789111",
"azureADOnlyAuthentication": true
},
"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"
}
}
}
]
}
}
{
"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",
"publicNetworkAccess": "Enabled",
"restrictOutboundNetworkAccess": "Enabled",
"isIPv6Enabled": "Enabled",
"version": "12.0",
"state": "Ready",
"administrators": {
"principalType": "User",
"login": "bob@contoso.com",
"sid": "00000011-1111-2222-2222-123456789111",
"tenantId": "00000011-1111-2222-2222-123456789111",
"azureADOnlyAuthentication": true
},
"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"
}
}
}
]
}
}
定义
| 名称 | 说明 |
|---|---|
|
Administrator |
服务器管理员的类型。 |
|
Error |
资源管理错误附加信息。 |
|
Error |
错误详细信息。 |
|
Error |
错误响应 |
|
External |
外部治理的状态。 |
|
Identity |
标识类型。 将此设置为“SystemAssigned”,以便自动为资源创建和分配 Azure Active Directory 主体。 |
|
Minimal |
最低 TLS 版本。 允许的值:“None”、“1.0”、“1.1”、“1.2”、“1.3” |
|
Principal |
服务器管理员的主体类型。 |
|
Private |
专用终结点连接的属性。 |
|
Private |
|
|
Private |
专用终结点连接的状态。 |
|
Private |
专用链接服务连接所需的作。 |
|
Private |
|
|
Private |
专用链接服务连接状态。 |
|
Resource |
资源的 Azure Active Directory 标识配置。 |
| Server |
Azure SQL 数据库服务器。 |
|
Server |
Active Directory 管理员的属性。 |
|
Server |
是否限制此服务器的出站网络访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled” |
|
Server |
服务器下的专用终结点连接 |
|
Server |
是否允许对此服务器使用公共终结点访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”或“SecuredByPerimeter” |
|
Server |
现有服务器是否创建了工作区,以及是否允许从工作区进行连接 |
|
User |
资源的 Azure Active Directory 标识配置。 |
AdministratorType
服务器管理员的类型。
| 值 | 说明 |
|---|---|
| ActiveDirectory |
ErrorAdditionalInfo
资源管理错误附加信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| info |
object |
其他信息。 |
| type |
string |
其他信息类型。 |
ErrorDetail
错误详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| additionalInfo |
错误附加信息。 |
|
| code |
string |
错误代码。 |
| details |
错误详细信息。 |
|
| message |
string |
错误消息。 |
| target |
string |
错误目标。 |
ErrorResponse
错误响应
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误对象。 |
ExternalGovernanceStatus
外部治理的状态。
| 值 | 说明 |
|---|---|
| Enabled | |
| Disabled |
IdentityType
标识类型。 将此设置为“SystemAssigned”,以便自动为资源创建和分配 Azure Active Directory 主体。
| 值 | 说明 |
|---|---|
| None | |
| SystemAssigned | |
| UserAssigned | |
| SystemAssigned,UserAssigned |
MinimalTlsVersion
最低 TLS 版本。 允许的值:“None”、“1.0”、“1.1”、“1.2”、“1.3”
| 值 | 说明 |
|---|---|
| None | |
| 1.0 | |
| 1.1 | |
| 1.2 | |
| 1.3 |
PrincipalType
服务器管理员的主体类型。
| 值 | 说明 |
|---|---|
| User | |
| Group | |
| Application |
PrivateEndpointConnectionProperties
专用终结点连接的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| groupIds |
string[] |
组 ID。 |
| privateEndpoint |
连接所属的专用终结点。 |
|
| privateLinkServiceConnectionState |
专用终结点连接的连接状态。 |
|
| provisioningState |
专用终结点连接的状态。 |
PrivateEndpointProperty
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
专用终结点的资源 ID。 |
PrivateEndpointProvisioningState
专用终结点连接的状态。
| 值 | 说明 |
|---|---|
| Approving | |
| Ready | |
| Dropping | |
| Failed | |
| Rejecting |
PrivateLinkServiceConnectionStateActionsRequire
专用链接服务连接所需的作。
| 值 | 说明 |
|---|---|
| None |
PrivateLinkServiceConnectionStateProperty
| 名称 | 类型 | 说明 |
|---|---|---|
| actionsRequired |
专用链接服务连接所需的作。 |
|
| description |
string |
专用链接服务连接说明。 |
| status |
专用链接服务连接状态。 |
PrivateLinkServiceConnectionStateStatus
专用链接服务连接状态。
| 值 | 说明 |
|---|---|
| Approved | |
| Pending | |
| Rejected | |
| Disconnected |
ResourceIdentity
资源的 Azure Active Directory 标识配置。
| 名称 | 类型 | 说明 |
|---|---|---|
| principalId |
string (uuid) |
Azure Active Directory 主体 ID。 |
| tenantId |
string (uuid) |
Azure Active Directory 租户 ID。 |
| type |
标识类型。 将此设置为“SystemAssigned”,以便自动为资源创建和分配 Azure Active Directory 主体。 |
|
| userAssignedIdentities |
<string,
User |
要使用的用户分配标识的资源 ID |
Server
Azure SQL 数据库服务器。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
资源 ID。 |
| identity |
服务器的 Azure Active Directory 标识。 |
|
| kind |
string |
SQL Server 的类型。 这是用于 Azure 门户体验的元数据。 |
| location |
string |
资源位置。 |
| name |
string |
资源名称。 |
| properties.administratorLogin |
string |
服务器的管理员用户名。 创建后,无法更改它。 |
| properties.administratorLoginPassword |
string |
管理员登录密码(创建服务器时需要)。 |
| properties.administrators |
服务器的 Azure Active Directory 管理员。 这只能在服务器创建时使用。 如果用于服务器更新,将忽略它,否则将导致错误。 对于各个 API 的更新,需要使用这些 API。 |
|
| properties.externalGovernanceStatus |
外部治理的状态。 |
|
| properties.federatedClientId |
string (uuid) |
用于跨租户 CMK 方案的客户端 ID |
| properties.fullyQualifiedDomainName |
string |
服务器的完全限定域名。 |
| properties.isIPv6Enabled |
是否为此服务器启用 IPv6 支持。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled” |
|
| properties.keyId |
string |
要用于加密的密钥的 CMK URI。 |
| properties.minimalTlsVersion |
最低 TLS 版本。 允许的值:“None”、“1.0”、“1.1”、“1.2”、“1.3” |
|
| properties.primaryUserAssignedIdentityId |
string |
默认情况下要使用的用户分配标识的资源 ID。 |
| properties.privateEndpointConnections |
服务器上的专用终结点连接列表 |
|
| properties.publicNetworkAccess |
是否允许对此服务器使用公共终结点访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”或“SecuredByPerimeter” |
|
| properties.restrictOutboundNetworkAccess |
是否限制此服务器的出站网络访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled” |
|
| properties.state |
string |
服务器的状态。 |
| properties.version |
string |
服务器的版本。 |
| properties.workspaceFeature |
现有服务器是否创建了工作区,以及是否允许从工作区进行连接 |
|
| tags |
object |
资源标记。 |
| type |
string |
资源类型。 |
ServerExternalAdministrator
Active Directory 管理员的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| administratorType |
服务器管理员的类型。 |
|
| azureADOnlyAuthentication |
boolean |
仅启用 Azure Active Directory 身份验证。 |
| login |
string |
服务器管理员的登录名。 |
| principalType |
服务器管理员的主体类型。 |
|
| sid |
string (uuid) |
服务器管理员的 SID (对象 ID)。 |
| tenantId |
string (uuid) |
管理员的租户 ID。 |
ServerNetworkAccessFlag
是否限制此服务器的出站网络访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”
| 值 | 说明 |
|---|---|
| Enabled | |
| Disabled |
ServerPrivateEndpointConnection
服务器下的专用终结点连接
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
资源 ID。 |
| properties |
专用终结点连接属性 |
ServerPublicNetworkAccessFlag
是否允许对此服务器使用公共终结点访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”或“SecuredByPerimeter”
| 值 | 说明 |
|---|---|
| Enabled | |
| Disabled | |
| SecuredByPerimeter |
ServerWorkspaceFeature
现有服务器是否创建了工作区,以及是否允许从工作区进行连接
| 值 | 说明 |
|---|---|
| Connected | |
| Disconnected |
UserIdentity
资源的 Azure Active Directory 标识配置。
| 名称 | 类型 | 说明 |
|---|---|---|
| clientId |
string (uuid) |
Azure Active Directory 客户端 ID。 |
| principalId |
string (uuid) |
Azure Active Directory 主体 ID。 |