共用方式為


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 參數

名稱 位於 必要 類型 Description
resourceGroupName
path True

string

minLength: 1
maxLength: 90

資源群組的名稱。 名稱不區分大小寫。

subscriptionId
path True

string (uuid)

目標訂用帳戶的標識碼。 此值必須是 UUID。

api-version
query True

string

minLength: 1

用於此作業的 API 版本。

$expand
query

string

要包含在回應中的子資源。

回應

名稱 類型 Description
200 OK

ServerListResult

Azure 運作順利完成。

Other Status Codes

ErrorResponse

未預期的錯誤回應。

安全性

azure_auth

Azure Active Directory OAuth2 Flow.

類型: oauth2
Flow: implicit
授權 URL: https://login.microsoftonline.com/common/oauth2/authorize

範圍

名稱 Description
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"
      }
    }
  ]
}

定義

名稱 Description
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

An Azure SQL Database server.

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

伺服器管理員的類型。

Description
ActiveDirectory

活動目錄

createdByType

建立資源的身分識別類型。

Description
User
Application
ManagedIdentity
Key

ErrorAdditionalInfo

資源管理錯誤附加資訊。

名稱 類型 Description
info

object

附加資訊。

type

string

其他資訊類型。

ErrorDetail

錯誤詳細資料。

名稱 類型 Description
additionalInfo

ErrorAdditionalInfo[]

錯誤附加資訊。

code

string

錯誤碼。

details

ErrorDetail[]

錯誤詳情

message

string

錯誤訊息。

target

string

錯誤目標。

ErrorResponse

錯誤回應

名稱 類型 Description
error

ErrorDetail

錯誤物件。

ExternalGovernanceStatus

外部治理的狀態。

Description
Enabled

已啟用

Disabled

Disabled

IdentityType

識別類型。 請將此設定為「SystemAssigned」,以自動建立並指派該資源的 Azure Active Directory 主體。

Description
None

沒有

SystemAssigned

系統分配的

UserAssigned

UserAssigned

SystemAssigned,UserAssigned

系統指派,使用者指派

MinimalTlsVersion

最低 TLS 版本。 允許的值:'None'、1.0'、'1.1'、'1.2'、'1.3'

Description
None

沒有

1.0

1.0

1.1

1.1

1.2

1.2

1.3

1.3

PrincipalType

伺服器管理員的主體類型。

Description
User

User

Group

Group

Application

應用程式

PrivateEndpointConnectionProperties

私人端點連線的屬性。

名稱 類型 Description
groupIds

string[]

群組標識碼。

privateEndpoint

PrivateEndpointProperty

線上所屬的私人端點。

privateLinkServiceConnectionState

PrivateLinkServiceConnectionStateProperty

私人端點連線的連接狀態。

provisioningState

PrivateEndpointProvisioningState

私人端點連線的狀態。

PrivateEndpointProperty

名稱 類型 Description
id

string

私人端點的資源標識碼。

PrivateEndpointProvisioningState

私人端點連線的狀態。

Description
Approving

批准中

Ready

Ready

Dropping

下降

Failed

失敗

Rejecting

拒絕

PrivateLinkServiceConnectionStateActionsRequire

私人鏈接服務連線所需的動作。

Description
None

沒有

PrivateLinkServiceConnectionStateProperty

名稱 類型 Description
actionsRequired

PrivateLinkServiceConnectionStateActionsRequire

私人鏈接服務連線所需的動作。

description

string

私人鏈接服務連線描述。

status

PrivateLinkServiceConnectionStateStatus

私人鏈接服務連線狀態。

PrivateLinkServiceConnectionStateStatus

私人鏈接服務連線狀態。

Description
Approved

已核准

Pending

等待中

Rejected

已拒絕

Disconnected

已中斷連線

ResourceIdentity

Azure Active Directory identity configuration for a resource.

名稱 類型 Description
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>

要使用的使用者指派身分識別的資源標識碼

Server

An Azure SQL Database server.

名稱 類型 Description
id

string (arm-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

Azure Active Directory 管理員可在伺服器建立及伺服器更新時使用,但 azureADOnlyAuthentication 屬性除外。 若要更新 azureADOnlyAuthentication 屬性,必須使用單個 API。

properties.createMode

ServerCreateMode

伺服器的創建模式,只有有效的值是 正常和 恢復。

properties.externalGovernanceStatus

ExternalGovernanceStatus

外部治理的狀態。

properties.federatedClientId

string (uuid)

用於跨租使用者 CMK 案例的用戶端標識碼

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

預設會使用之使用者指派身分識別的資源標識碼。

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 Resource Manager 包含 createdBy 與 modifiedBy 資訊的元資料。

tags

object

資源標籤。

type

string

資源的類型。 例如:「Microsoft。運算/虛擬機器」或「Microsoft」。儲存/儲存帳號」

ServerCreateMode

伺服器的創建模式,只有有效的值是 正常和 恢復。

Description
Normal

正常

Restore

Restore

ServerExternalAdministrator

Active Directory 系統管理員的屬性。

名稱 類型 Description
administratorType

AdministratorType

伺服器管理員的類型。

azureADOnlyAuthentication

boolean

Azure Active Directory only authentication enabled.

login

string

伺服器管理員的登入名稱。

principalType

PrincipalType

伺服器管理員的主體類型。

sid

string (uuid)

伺服器管理員的 SID (物件識別符)。

tenantId

string (uuid)

系統管理員的租用戶標識碼。

ServerListResult

伺服器清單作業的回應。

名稱 類型 Description
nextLink

string (uri)

項目下一頁的連結

value

Server[]

此頁面上的伺服器項目

ServerNetworkAccessFlag

是否要限制此伺服器的輸出網路存取。 值為選擇性值,但如果傳入,則必須是 'Enabled' 或 'Disabled'

Description
Enabled

已啟用

Disabled

Disabled

ServerPrivateEndpointConnection

伺服器底下的私人端點連線

名稱 類型 Description
id

string

資源標識碼。

properties

PrivateEndpointConnectionProperties

私人端點連線屬性

ServerPublicNetworkAccessFlag

此伺服器是否允許公用端點存取。 值為選擇性值,但如果傳入,必須是 'Enabled' 或 'Disabled' 或 'SecuredByPerimeter'

Description
Enabled

已啟用

Disabled

Disabled

SecuredByPerimeter

SecuredByPerimeter

ServerWorkspaceFeature

現有伺服器是否已建立工作區,以及是否允許從工作區進行連線

Description
Connected

已連線

Disconnected

已中斷連線

systemData

與建立和上次修改資源相關的元數據。

名稱 類型 Description
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.

名稱 類型 Description
clientId

string (uuid)

The Azure Active Directory client id.

principalId

string (uuid)

The Azure Active Directory principal id.