Servers - List By Resource Group
获取资源组中的服务器列表。
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers?api-version=2025-01-01
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers?api-version=2025-01-01&$expand={$expand}
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
资源组的名称。 此名称不区分大小写。 |
|
subscription
|
path | True |
string (uuid) |
目标订阅的 ID。 该值必须是 UUID。 |
|
api-version
|
query | True |
string minLength: 1 |
用于此作的 API 版本。 |
|
$expand
|
query |
string |
要包含在响应中的子资源。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
Azure 运营顺利完成。 |
|
| Other Status Codes |
意外的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow.
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
| List servers by resource group |
| List servers by resource group with $expand=administrators/activedirectory |
List servers by resource group
示例请求
GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers?api-version=2025-01-01
示例响应
{
"value": [
{
"name": "sqlcrudtest-4645",
"type": "Microsoft.Sql/servers",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645",
"kind": "v12.0",
"location": "japaneast",
"properties": {
"administratorLogin": "dummylogin",
"externalGovernanceStatus": "Enabled",
"fullyQualifiedDomainName": "sqlcrudtest-4645.database.windows.net",
"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": {
"privateEndpoint": {
"id": "/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"
},
"privateLinkServiceConnectionState": {
"description": "Auto-approved",
"actionsRequired": "None",
"status": "Approved"
},
"provisioningState": "Ready"
}
}
],
"publicNetworkAccess": "Enabled",
"restrictOutboundNetworkAccess": "Enabled",
"retentionDays": 7,
"state": "Ready",
"version": "12.0",
"workspaceFeature": "Connected"
}
},
{
"name": "sqlcrudtest-6661",
"type": "Microsoft.Sql/servers",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-6661",
"kind": "v12.0",
"location": "japaneast",
"properties": {
"administratorLogin": "dummylogin",
"externalGovernanceStatus": "Enabled",
"fullyQualifiedDomainName": "sqlcrudtest-6661.database.windows.net",
"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": {
"privateEndpoint": {
"id": "/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"
},
"privateLinkServiceConnectionState": {
"description": "Auto-approved",
"actionsRequired": "None",
"status": "Approved"
},
"provisioningState": "Ready"
}
}
],
"publicNetworkAccess": "Enabled",
"restrictOutboundNetworkAccess": "Enabled",
"retentionDays": 7,
"state": "Ready",
"version": "12.0",
"workspaceFeature": "Connected"
}
}
]
}
List servers by resource group with $expand=administrators/activedirectory
示例请求
GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers?api-version=2025-01-01
示例响应
{
"value": [
{
"name": "sqlcrudtest-4645",
"type": "Microsoft.Sql/servers",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645",
"kind": "v12.0",
"location": "japaneast",
"properties": {
"administratorLogin": "dummylogin",
"administrators": {
"azureADOnlyAuthentication": true,
"login": "bob@contoso.com",
"principalType": "User",
"sid": "00000011-1111-2222-2222-123456789111",
"tenantId": "00000011-1111-2222-2222-123456789111"
},
"externalGovernanceStatus": "Enabled",
"fullyQualifiedDomainName": "sqlcrudtest-4645.database.windows.net",
"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": {
"privateEndpoint": {
"id": "/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"
},
"privateLinkServiceConnectionState": {
"description": "Auto-approved",
"actionsRequired": "None",
"status": "Approved"
},
"provisioningState": "Ready"
}
}
],
"publicNetworkAccess": "Enabled",
"restrictOutboundNetworkAccess": "Enabled",
"retentionDays": 7,
"state": "Ready",
"version": "12.0",
"workspaceFeature": "Connected"
}
},
{
"name": "sqlcrudtest-6661",
"type": "Microsoft.Sql/servers",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-6661",
"kind": "v12.0",
"location": "japaneast",
"properties": {
"administratorLogin": "dummylogin",
"administrators": {
"azureADOnlyAuthentication": true,
"login": "bob@contoso.com",
"principalType": "User",
"sid": "00000011-1111-2222-2222-123456789111",
"tenantId": "00000011-1111-2222-2222-123456789111"
},
"externalGovernanceStatus": "Enabled",
"fullyQualifiedDomainName": "sqlcrudtest-6661.database.windows.net",
"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": {
"privateEndpoint": {
"id": "/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"
},
"privateLinkServiceConnectionState": {
"description": "Auto-approved",
"actionsRequired": "None",
"status": "Approved"
},
"provisioningState": "Ready"
}
}
],
"publicNetworkAccess": "Enabled",
"restrictOutboundNetworkAccess": "Enabled",
"retentionDays": 7,
"state": "Ready",
"version": "12.0",
"workspaceFeature": "Connected"
}
}
]
}
定义
| 名称 | 说明 |
|---|---|
|
Administrator |
服务器管理员的类型。 |
|
created |
创建资源的标识的类型。 |
|
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 identity configuration for a resource. |
| Server |
一个Azure SQL 数据库服务器。 |
|
Server |
服务器的创建模式,只有有效的值是 正常 和 恢复。 |
|
Server |
Active Directory 管理员的属性。 |
|
Server |
服务器列表作的响应。 |
|
Server |
是否限制此服务器的出站网络访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled” |
|
Server |
服务器下的专用终结点连接 |
|
Server |
是否允许对此服务器使用公共终结点访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”或“SecuredByPerimeter” |
|
Server |
现有服务器是否创建了工作区,以及是否允许从工作区进行连接 |
|
system |
与创建和上次修改资源相关的元数据。 |
|
User |
Azure Active Directory identity configuration for a resource. |
AdministratorType
服务器管理员的类型。
| 值 | 说明 |
|---|---|
| ActiveDirectory |
活动目录 |
createdByType
创建资源的标识的类型。
| 值 | 说明 |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
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 |
UserAssigned |
| SystemAssigned,UserAssigned |
SystemAssigned,UserAssigned |
MinimalTlsVersion
最低 TLS 版本。 允许的值:“None”、“1.0”、“1.1”、“1.2”、“1.3”
| 值 | 说明 |
|---|---|
| None |
没有 |
| 1.0 |
1.0 |
| 1.1 |
1.1 |
| 1.2 |
1.2 |
| 1.3 |
1.3 |
PrincipalType
服务器管理员的主体类型。
| 值 | 说明 |
|---|---|
| User |
用户 |
| Group |
组 |
| Application |
应用程序 |
PrivateEndpointConnectionProperties
专用终结点连接的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| groupIds |
string[] |
组 ID。 |
| privateEndpoint |
连接所属的专用终结点。 |
|
| privateLinkServiceConnectionState |
专用终结点连接的连接状态。 |
|
| provisioningState |
专用终结点连接的状态。 |
PrivateEndpointProperty
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
专用终结点的资源 ID。 |
PrivateEndpointProvisioningState
专用终结点连接的状态。
| 值 | 说明 |
|---|---|
| Approving |
批准 |
| Ready |
就绪 |
| Dropping |
下降 |
| Failed |
Failed |
| Rejecting |
拒绝 |
PrivateLinkServiceConnectionStateActionsRequire
专用链接服务连接所需的作。
| 值 | 说明 |
|---|---|
| None |
没有 |
PrivateLinkServiceConnectionStateProperty
| 名称 | 类型 | 说明 |
|---|---|---|
| actionsRequired |
专用链接服务连接所需的作。 |
|
| description |
string |
专用链接服务连接说明。 |
| status |
专用链接服务连接状态。 |
PrivateLinkServiceConnectionStateStatus
专用链接服务连接状态。
| 值 | 说明 |
|---|---|
| Approved |
已批准 |
| Pending |
待处理 |
| Rejected |
Rejected |
| Disconnected |
已断开连接 |
ResourceIdentity
Azure Active Directory identity configuration for a resource.
| 名称 | 类型 | 说明 |
|---|---|---|
| principalId |
string (uuid) |
The Azure Active Directory principal id. |
| tenantId |
string (uuid) |
The Azure Active Directory tenant id. |
| type |
标识类型。 将此设置为“SystemAssigned”,以便自动创建并分配该资源的 Azure Active Directory 主体。 |
|
| userAssignedIdentities |
<string,
User |
要使用的用户分配标识的资源 ID |
Server
一个Azure SQL 数据库服务器。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string (arm-id) |
资源的完全限定资源 ID。 例如,“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}” |
| identity |
服务器的Azure Active Directory身份。 |
|
| kind |
string |
SQL Server 的类型。 这是用于Azure门户体验的元数据。 |
| location |
string |
资源所在的地理位置 |
| name |
string |
资源的名称 |
| properties.administratorLogin |
string |
服务器的管理员用户名。 创建后,无法更改它。 |
| properties.administratorLoginPassword |
string (password) |
管理员登录密码(创建服务器时需要)。 |
| properties.administrators |
除了 azureADOnlyAuthentication 属性外,Azure Active Directory 管理员可以在服务器创建和服务器更新时使用。 若要更新 azureADOnlyAuthentication 属性,必须使用单个 API。 |
|
| properties.createMode |
服务器的创建模式,只有有效的值是 正常 和 恢复。 |
|
| 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.retentionDays |
integer (int32) |
此服务器将保持软删除的天数。 |
| properties.state |
string |
服务器的状态。 |
| properties.version |
string |
服务器的版本。 |
| properties.workspaceFeature |
现有服务器是否创建了工作区,以及是否允许从工作区进行连接 |
|
| systemData |
Azure 资源管理器 包含 createdBy 和 modifiedBy 信息的元数据。 |
|
| tags |
object |
资源标记。 |
| type |
string |
资源类型。 例如,“Microsoft。计算/虚拟机“或”Microsoft“。存储/存储账户” |
ServerCreateMode
服务器的创建模式,只有有效的值是 正常 和 恢复。
| 值 | 说明 |
|---|---|
| Normal |
正常 |
| Restore |
还原 |
ServerExternalAdministrator
Active Directory 管理员的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| administratorType |
服务器管理员的类型。 |
|
| azureADOnlyAuthentication |
boolean |
Azure Active Directory 仅启用认证。 |
| login |
string |
服务器管理员的登录名。 |
| principalType |
服务器管理员的主体类型。 |
|
| sid |
string (uuid) |
服务器管理员的 SID (对象 ID)。 |
| tenantId |
string (uuid) |
管理员的租户 ID。 |
ServerListResult
服务器列表作的响应。
| 名称 | 类型 | 说明 |
|---|---|---|
| nextLink |
string (uri) |
指向下一页项的链接 |
| value |
Server[] |
此页面上的服务器项 |
ServerNetworkAccessFlag
是否限制此服务器的出站网络访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”
| 值 | 说明 |
|---|---|
| Enabled |
已启用 |
| Disabled |
已禁用 |
ServerPrivateEndpointConnection
服务器下的专用终结点连接
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
资源 ID。 |
| properties |
专用终结点连接属性 |
ServerPublicNetworkAccessFlag
是否允许对此服务器使用公共终结点访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”或“SecuredByPerimeter”
| 值 | 说明 |
|---|---|
| Enabled |
已启用 |
| Disabled |
已禁用 |
| SecuredByPerimeter |
SecuredByPerimeter |
ServerWorkspaceFeature
现有服务器是否创建了工作区,以及是否允许从工作区进行连接
| 值 | 说明 |
|---|---|
| Connected |
已连接 |
| Disconnected |
已断开连接 |
systemData
与创建和上次修改资源相关的元数据。
| 名称 | 类型 | 说明 |
|---|---|---|
| createdAt |
string (date-time) |
资源创建时间戳(UTC)。 |
| createdBy |
string |
创建资源的标识。 |
| createdByType |
创建资源的标识的类型。 |
|
| lastModifiedAt |
string (date-time) |
资源上次修改的时间戳 (UTC) |
| lastModifiedBy |
string |
上次修改资源的标识。 |
| lastModifiedByType |
上次修改资源的标识的类型。 |
UserIdentity
Azure Active Directory identity configuration for a resource.
| 名称 | 类型 | 说明 |
|---|---|---|
| clientId |
string (uuid) |
The Azure Active Directory client id. |
| principalId |
string (uuid) |
The Azure Active Directory principal id. |