مشاركة عبر


Servers - List

Gets a list of all servers in the subscription.

GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers?api-version=2025-01-01
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers?api-version=2025-01-01&$expand={$expand}

URI Parameters

Name In Required Type Description
subscriptionId
path True

string (uuid)

The ID of the target subscription. The value must be an UUID.

api-version
query True

string

minLength: 1

The API version to use for this operation.

$expand
query

string

The child resources to include in the response.

Responses

Name Type Description
200 OK

ServerListResult

Azure operation completed successfully.

Other Status Codes

ErrorResponse

An unexpected error response.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

List servers
List servers with $expand=administrators/activedirectory

List servers

Sample request

GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/servers?api-version=2025-01-01

Sample response

{
  "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",
        "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",
        "state": "Ready",
        "version": "12.0",
        "workspaceFeature": "Connected"
      }
    }
  ]
}

List servers with $expand=administrators/activedirectory

Sample request

GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/servers?api-version=2025-01-01

Sample response

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

Definitions

Name Description
AdministratorType

Type of the sever administrator.

createdByType

The type of identity that created the resource.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

ExternalGovernanceStatus

Status of external governance.

IdentityType

The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource.

MinimalTlsVersion

Minimal TLS version. Allowed values: 'None', 1.0', '1.1', '1.2', '1.3'

PrincipalType

Principal Type of the sever administrator.

PrivateEndpointConnectionProperties

Properties of a private endpoint connection.

PrivateEndpointProperty
PrivateEndpointProvisioningState

State of the private endpoint connection.

PrivateLinkServiceConnectionStateActionsRequire

The actions required for private link service connection.

PrivateLinkServiceConnectionStateProperty
PrivateLinkServiceConnectionStateStatus

The private link service connection status.

ResourceIdentity

Azure Active Directory identity configuration for a resource.

Server

An Azure SQL Database server.

ServerCreateMode

Create mode for server, only valid values for this are Normal and Restore.

ServerExternalAdministrator

Properties of a active directory administrator.

ServerListResult

The response of a Server list operation.

ServerNetworkAccessFlag

Whether or not to restrict outbound network access for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'

ServerPrivateEndpointConnection

A private endpoint connection under a server

ServerPublicNetworkAccessFlag

Whether or not public endpoint access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled' or 'SecuredByPerimeter'

ServerWorkspaceFeature

Whether or not existing server has a workspace created and if it allows connection from workspace

systemData

Metadata pertaining to creation and last modification of the resource.

UserIdentity

Azure Active Directory identity configuration for a resource.

AdministratorType

Type of the sever administrator.

Value Description
ActiveDirectory

ActiveDirectory

createdByType

The type of identity that created the resource.

Value Description
User
Application
ManagedIdentity
Key

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

ExternalGovernanceStatus

Status of external governance.

Value Description
Enabled

Enabled

Disabled

Disabled

IdentityType

The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource.

Value Description
None

None

SystemAssigned

SystemAssigned

UserAssigned

UserAssigned

SystemAssigned,UserAssigned

SystemAssigned,UserAssigned

MinimalTlsVersion

Minimal TLS version. Allowed values: 'None', 1.0', '1.1', '1.2', '1.3'

Value Description
None

None

1.0

1.0

1.1

1.1

1.2

1.2

1.3

1.3

PrincipalType

Principal Type of the sever administrator.

Value Description
User

User

Group

Group

Application

Application

PrivateEndpointConnectionProperties

Properties of a private endpoint connection.

Name Type Description
groupIds

string[]

Group IDs.

privateEndpoint

PrivateEndpointProperty

Private endpoint which the connection belongs to.

privateLinkServiceConnectionState

PrivateLinkServiceConnectionStateProperty

Connection state of the private endpoint connection.

provisioningState

PrivateEndpointProvisioningState

State of the private endpoint connection.

PrivateEndpointProperty

Name Type Description
id

string

Resource id of the private endpoint.

PrivateEndpointProvisioningState

State of the private endpoint connection.

Value Description
Approving

Approving

Ready

Ready

Dropping

Dropping

Failed

Failed

Rejecting

Rejecting

PrivateLinkServiceConnectionStateActionsRequire

The actions required for private link service connection.

Value Description
None

None

PrivateLinkServiceConnectionStateProperty

Name Type Description
actionsRequired

PrivateLinkServiceConnectionStateActionsRequire

The actions required for private link service connection.

description

string

The private link service connection description.

status

PrivateLinkServiceConnectionStateStatus

The private link service connection status.

PrivateLinkServiceConnectionStateStatus

The private link service connection status.

Value Description
Approved

Approved

Pending

Pending

Rejected

Rejected

Disconnected

Disconnected

ResourceIdentity

Azure Active Directory identity configuration for a resource.

Name Type Description
principalId

string (uuid)

The Azure Active Directory principal id.

tenantId

string (uuid)

The Azure Active Directory tenant id.

type

IdentityType

The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource.

userAssignedIdentities

<string,  UserIdentity>

The resource ids of the user assigned identities to use

Server

An Azure SQL Database server.

Name Type Description
id

string (arm-id)

Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"

identity

ResourceIdentity

The Azure Active Directory identity of the server.

kind

string

Kind of sql server. This is metadata used for the Azure portal experience.

location

string

The geo-location where the resource lives

name

string

The name of the resource

properties.administratorLogin

string

Administrator username for the server. Once created it cannot be changed.

properties.administratorLoginPassword

string (password)

The administrator login password (required for server creation).

properties.administrators

ServerExternalAdministrator

The Azure Active Directory administrator can be utilized during server creation and for server updates, except for the azureADOnlyAuthentication property. To update the azureADOnlyAuthentication property, individual API must be used.

properties.createMode

ServerCreateMode

Create mode for server, only valid values for this are Normal and Restore.

properties.externalGovernanceStatus

ExternalGovernanceStatus

Status of external governance.

properties.federatedClientId

string (uuid)

The Client id used for cross tenant CMK scenario

properties.fullyQualifiedDomainName

string

The fully qualified domain name of the server.

properties.isIPv6Enabled

ServerNetworkAccessFlag

Whether or not to enable IPv6 support for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'

properties.keyId

string

A CMK URI of the key to use for encryption.

properties.minimalTlsVersion

MinimalTlsVersion

Minimal TLS version. Allowed values: 'None', 1.0', '1.1', '1.2', '1.3'

properties.primaryUserAssignedIdentityId

string

The resource id of a user assigned identity to be used by default.

properties.privateEndpointConnections

ServerPrivateEndpointConnection[]

List of private endpoint connections on a server

properties.publicNetworkAccess

ServerPublicNetworkAccessFlag

Whether or not public endpoint access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled' or 'SecuredByPerimeter'

properties.restrictOutboundNetworkAccess

ServerNetworkAccessFlag

Whether or not to restrict outbound network access for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'

properties.retentionDays

integer (int32)

Number of days this server will stay soft-deleted.

properties.state

string

The state of the server.

properties.version

string

The version of the server.

properties.workspaceFeature

ServerWorkspaceFeature

Whether or not existing server has a workspace created and if it allows connection from workspace

systemData

systemData

Azure Resource Manager metadata containing createdBy and modifiedBy information.

tags

object

Resource tags.

type

string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

ServerCreateMode

Create mode for server, only valid values for this are Normal and Restore.

Value Description
Normal

Normal

Restore

Restore

ServerExternalAdministrator

Properties of a active directory administrator.

Name Type Description
administratorType

AdministratorType

Type of the sever administrator.

azureADOnlyAuthentication

boolean

Azure Active Directory only Authentication enabled.

login

string

Login name of the server administrator.

principalType

PrincipalType

Principal Type of the sever administrator.

sid

string (uuid)

SID (object ID) of the server administrator.

tenantId

string (uuid)

Tenant ID of the administrator.

ServerListResult

The response of a Server list operation.

Name Type Description
nextLink

string (uri)

The link to the next page of items

value

Server[]

The Server items on this page

ServerNetworkAccessFlag

Whether or not to restrict outbound network access for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'

Value Description
Enabled

Enabled

Disabled

Disabled

ServerPrivateEndpointConnection

A private endpoint connection under a server

Name Type Description
id

string

Resource ID.

properties

PrivateEndpointConnectionProperties

Private endpoint connection properties

ServerPublicNetworkAccessFlag

Whether or not public endpoint access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled' or 'SecuredByPerimeter'

Value Description
Enabled

Enabled

Disabled

Disabled

SecuredByPerimeter

SecuredByPerimeter

ServerWorkspaceFeature

Whether or not existing server has a workspace created and if it allows connection from workspace

Value Description
Connected

Connected

Disconnected

Disconnected

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string (date-time)

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string (date-time)

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.

UserIdentity

Azure Active Directory identity configuration for a resource.

Name Type Description
clientId

string (uuid)

The Azure Active Directory client id.

principalId

string (uuid)

The Azure Active Directory principal id.