通过


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

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 参数

名称 必需 类型 说明
resourceGroupName
path True

string

minLength: 1
maxLength: 90

资源组的名称。 此名称不区分大小写。

subscriptionId
path True

string (uuid)

目标订阅的 ID。 该值必须是 UUID。

api-version
query True

string

minLength: 1

用于此作的 API 版本。

$expand
query

string

要包含在响应中的子资源。

响应

名称 类型 说明
200 OK

ServerListResult

Azure 运营顺利完成。

Other Status Codes

ErrorResponse

意外的错误响应。

安全性

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"
      }
    }
  ]
}

定义

名称 说明
AdministratorType

服务器管理员的类型。

createdByType

创建资源的标识的类型。

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 identity configuration for a resource.

Server

一个Azure SQL 数据库服务器。

ServerCreateMode

服务器的创建模式,只有有效的值是 正常 和 恢复。

ServerExternalAdministrator

Active Directory 管理员的属性。

ServerListResult

服务器列表作的响应。

ServerNetworkAccessFlag

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

ServerPrivateEndpointConnection

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

ServerPublicNetworkAccessFlag

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

ServerWorkspaceFeature

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

systemData

与创建和上次修改资源相关的元数据。

UserIdentity

Azure Active Directory identity configuration for a resource.

AdministratorType

服务器管理员的类型。

说明
ActiveDirectory

活动目录

createdByType

创建资源的标识的类型。

说明
User
Application
ManagedIdentity
Key

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

附加信息。

type

string

附加信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

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

PrivateEndpointProperty

连接所属的专用终结点。

privateLinkServiceConnectionState

PrivateLinkServiceConnectionStateProperty

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

provisioningState

PrivateEndpointProvisioningState

专用终结点连接的状态。

PrivateEndpointProperty

名称 类型 说明
id

string

专用终结点的资源 ID。

PrivateEndpointProvisioningState

专用终结点连接的状态。

说明
Approving

批准

Ready

就绪

Dropping

下降

Failed

Failed

Rejecting

拒绝

PrivateLinkServiceConnectionStateActionsRequire

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

说明
None

没有

PrivateLinkServiceConnectionStateProperty

名称 类型 说明
actionsRequired

PrivateLinkServiceConnectionStateActionsRequire

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

description

string

专用链接服务连接说明。

status

PrivateLinkServiceConnectionStateStatus

专用链接服务连接状态。

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

IdentityType

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

userAssignedIdentities

<string,  UserIdentity>

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

Server

一个Azure SQL 数据库服务器。

名称 类型 说明
id

string (arm-id)

资源的完全限定资源 ID。 例如,“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}”

identity

ResourceIdentity

服务器的Azure Active Directory身份。

kind

string

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

location

string

资源所在的地理位置

name

string

资源的名称

properties.administratorLogin

string

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

properties.administratorLoginPassword

string (password)

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

properties.administrators

ServerExternalAdministrator

除了 azureADOnlyAuthentication 属性外,Azure Active Directory 管理员可以在服务器创建和服务器更新时使用。 若要更新 azureADOnlyAuthentication 属性,必须使用单个 API。

properties.createMode

ServerCreateMode

服务器的创建模式,只有有效的值是 正常 和 恢复。

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

integer (int32)

此服务器将保持软删除的天数。

properties.state

string

服务器的状态。

properties.version

string

服务器的版本。

properties.workspaceFeature

ServerWorkspaceFeature

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

systemData

systemData

Azure 资源管理器 包含 createdBy 和 modifiedBy 信息的元数据。

tags

object

资源标记。

type

string

资源类型。 例如,“Microsoft。计算/虚拟机“或”Microsoft“。存储/存储账户”

ServerCreateMode

服务器的创建模式,只有有效的值是 正常 和 恢复。

说明
Normal

正常

Restore

还原

ServerExternalAdministrator

Active Directory 管理员的属性。

名称 类型 说明
administratorType

AdministratorType

服务器管理员的类型。

azureADOnlyAuthentication

boolean

Azure Active Directory 仅启用认证。

login

string

服务器管理员的登录名。

principalType

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

PrivateEndpointConnectionProperties

专用终结点连接属性

ServerPublicNetworkAccessFlag

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

说明
Enabled

已启用

Disabled

已禁用

SecuredByPerimeter

SecuredByPerimeter

ServerWorkspaceFeature

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

说明
Connected

已连接

Disconnected

已断开连接

systemData

与创建和上次修改资源相关的元数据。

名称 类型 说明
createdAt

string (date-time)

资源创建时间戳(UTC)。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识的类型。

lastModifiedAt

string (date-time)

资源上次修改的时间戳 (UTC)

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

上次修改资源的标识的类型。

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.