Share via


Databases - List By Elastic Pool

Gets a list of databases in an elastic pool.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases?api-version=2021-11-01

URI Parameters

Name In Required Type Description
elasticPoolName
path True

string

The name of the elastic pool.

resourceGroupName
path True

string

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

serverName
path True

string

The name of the server.

subscriptionId
path True

string

The subscription ID that identifies an Azure subscription.

api-version
query True

string

The API version to use for the request.

Responses

Name Type Description
200 OK

DatabaseListResult

Successfully retrieved a list of databases in an elastic pool.

Other Status Codes

*** Error Responses: ***

  • 404 SubscriptionDoesNotHaveServer - The requested server was not found

  • 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.

  • 404 CannotFindObject - Cannot find the object because it does not exist or you do not have permissions

  • 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.

  • 404 ServerNotInSubscription - Specified server does not exist on the specified subscription.

  • 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.

  • 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.

  • 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.

  • 504 RequestTimeout - Service request exceeded the allowed timeout.

Examples

Gets a list of databases in an elastic pool.

Sample request

GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/elasticPools/pool1/databases?api-version=2021-11-01

Sample response

{
  "value": [
    {
      "sku": {
        "name": "ElasticPool",
        "tier": "Standard"
      },
      "kind": "v12.0,user",
      "properties": {
        "collation": "SQL_Latin1_General_CP1_CI_AS",
        "maxSizeBytes": 268435456000,
        "elasticPoolId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/elasticPools/Pool1",
        "status": "Online",
        "databaseId": "bfe0735f-bc87-447f-b2c2-481f4b100614",
        "creationDate": "2017-07-12T22:08:39.163Z",
        "currentServiceObjectiveName": "ElasticPool",
        "defaultSecondaryLocation": "North Europe",
        "catalogCollation": "SQL_Latin1_General_CP1_CI_AS"
      },
      "location": "southeastasia",
      "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/DB001",
      "name": "DB001",
      "type": "Microsoft.Sql/servers/databases"
    },
    {
      "sku": {
        "name": "ElasticPool",
        "tier": "Standard"
      },
      "kind": "v12.0,user",
      "properties": {
        "collation": "SQL_Latin1_General_CP1_CI_AS",
        "maxSizeBytes": 268435456000,
        "elasticPoolId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/elasticPools/Pool1",
        "status": "Online",
        "databaseId": "82246152-3177-4357-b81c-a16d87ce3593",
        "creationDate": "2017-07-12T22:10:10.773Z",
        "currentServiceObjectiveName": "ElasticPool",
        "defaultSecondaryLocation": "North Europe",
        "catalogCollation": "SQL_Latin1_General_CP1_CI_AS"
      },
      "location": "southeastasia",
      "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/DB002",
      "name": "DB002",
      "type": "Microsoft.Sql/servers/databases"
    }
  ]
}

Definitions

Name Description
BackupStorageRedundancy

The storage account type used to store backups for this database.

CatalogCollationType

Collation of the metadata catalog.

CreateMode

Specifies the mode of database creation.

Default: regular database creation.

Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.

Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.

PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.

Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.

Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.

RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.

Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition.

Database

A database resource.

DatabaseIdentity

Azure Active Directory identity configuration for a resource.

DatabaseIdentityType

The identity type

DatabaseLicenseType

The license type to apply for this database. LicenseIncluded if you need a license, or BasePrice if you have a license and are eligible for the Azure Hybrid Benefit.

DatabaseListResult

A list of databases.

DatabaseReadScale

The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Not applicable to a Hyperscale database within an elastic pool.

DatabaseStatus

The status of the database.

DatabaseUserIdentity

Azure Active Directory identity configuration for a resource.

SampleName

The name of the sample schema to apply when creating this database.

SecondaryType

The secondary type of the database if it is a secondary. Valid values are Geo and Named.

Sku

An ARM Resource SKU.

BackupStorageRedundancy

The storage account type used to store backups for this database.

Name Type Description
Geo

string

GeoZone

string

Local

string

Zone

string

CatalogCollationType

Collation of the metadata catalog.

Name Type Description
DATABASE_DEFAULT

string

SQL_Latin1_General_CP1_CI_AS

string

CreateMode

Specifies the mode of database creation.

Default: regular database creation.

Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.

Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.

PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.

Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.

Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.

RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.

Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition.

Name Type Description
Copy

string

Default

string

OnlineSecondary

string

PointInTimeRestore

string

Recovery

string

Restore

string

RestoreExternalBackup

string

RestoreExternalBackupSecondary

string

RestoreLongTermRetentionBackup

string

Secondary

string

Database

A database resource.

Name Type Description
id

string

Resource ID.

identity

DatabaseIdentity

The Azure Active Directory identity of the database.

kind

string

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

location

string

Resource location.

managedBy

string

Resource that manages the database.

name

string

Resource name.

properties.autoPauseDelay

integer

Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled

properties.catalogCollation

CatalogCollationType

Collation of the metadata catalog.

properties.collation

string

The collation of the database.

properties.createMode

CreateMode

Specifies the mode of database creation.

Default: regular database creation.

Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.

Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.

PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.

Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.

Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.

RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.

Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition.

properties.creationDate

string

The creation date of the database (ISO8601 format).

properties.currentBackupStorageRedundancy

BackupStorageRedundancy

The storage account type used to store backups for this database.

properties.currentServiceObjectiveName

string

The current service level objective name of the database.

properties.currentSku

Sku

The name and tier of the SKU.

properties.databaseId

string

The ID of the database.

properties.defaultSecondaryLocation

string

The default secondary region for this database.

properties.earliestRestoreDate

string

This records the earliest start date and time that restore is available for this database (ISO8601 format).

properties.elasticPoolId

string

The resource identifier of the elastic pool containing this database.

properties.failoverGroupId

string

Failover Group resource identifier that this database belongs to.

properties.federatedClientId

string

The Client id used for cross tenant per database CMK scenario

properties.highAvailabilityReplicaCount

integer

The number of secondary replicas associated with the database that are used to provide high availability. Not applicable to a Hyperscale database within an elastic pool.

properties.isInfraEncryptionEnabled

boolean

Infra encryption is enabled for this database.

properties.isLedgerOn

boolean

Whether or not this database is a ledger database, which means all tables in the database are ledger tables. Note: the value of this property cannot be changed after the database has been created.

properties.licenseType

DatabaseLicenseType

The license type to apply for this database. LicenseIncluded if you need a license, or BasePrice if you have a license and are eligible for the Azure Hybrid Benefit.

properties.longTermRetentionBackupResourceId

string

The resource identifier of the long term retention backup associated with create operation of this database.

properties.maintenanceConfigurationId

string

Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates will occur.

properties.maxLogSizeBytes

integer

The max log size for this database.

properties.maxSizeBytes

integer

The max size of the database expressed in bytes.

properties.minCapacity

number

Minimal capacity that database will always have allocated, if not paused

properties.pausedDate

string

The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready.

properties.readScale

DatabaseReadScale

The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Not applicable to a Hyperscale database within an elastic pool.

properties.recoverableDatabaseId

string

The resource identifier of the recoverable database associated with create operation of this database.

properties.recoveryServicesRecoveryPointId

string

The resource identifier of the recovery point associated with create operation of this database.

properties.requestedBackupStorageRedundancy

BackupStorageRedundancy

The storage account type to be used to store backups for this database.

properties.requestedServiceObjectiveName

string

The requested service level objective name of the database.

properties.restorableDroppedDatabaseId

string

The resource identifier of the restorable dropped database associated with create operation of this database.

properties.restorePointInTime

string

Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.

properties.resumedDate

string

The date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused.

properties.sampleName

SampleName

The name of the sample schema to apply when creating this database.

properties.secondaryType

SecondaryType

The secondary type of the database if it is a secondary. Valid values are Geo and Named.

properties.sourceDatabaseDeletionDate

string

Specifies the time that the database was deleted.

properties.sourceDatabaseId

string

The resource identifier of the source database associated with create operation of this database.

properties.sourceResourceId

string

The resource identifier of the source associated with the create operation of this database.

This property is only supported for DataWarehouse edition and allows to restore across subscriptions.

When sourceResourceId is specified, sourceDatabaseId, recoverableDatabaseId, restorableDroppedDatabaseId and sourceDatabaseDeletionDate must not be specified and CreateMode must be PointInTimeRestore, Restore or Recover.

When createMode is PointInTimeRestore, sourceResourceId must be the resource ID of the existing database or existing sql pool, and restorePointInTime must be specified.

When createMode is Restore, sourceResourceId must be the resource ID of restorable dropped database or restorable dropped sql pool.

When createMode is Recover, sourceResourceId must be the resource ID of recoverable database or recoverable sql pool.

When source subscription belongs to a different tenant than target subscription, “x-ms-authorization-auxiliary” header must contain authentication token for the source tenant. For more details about “x-ms-authorization-auxiliary” header see https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant

properties.status

DatabaseStatus

The status of the database.

properties.zoneRedundant

boolean

Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.

sku

Sku

The database SKU.

The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the Capabilities_ListByLocation REST API or one of the following commands:

az sql db list-editions -l <location> -o table
Get-AzSqlServerServiceObjective -Location <location>
tags

object

Resource tags.

type

string

Resource type.

DatabaseIdentity

Azure Active Directory identity configuration for a resource.

Name Type Description
tenantId

string

The Azure Active Directory tenant id.

type

DatabaseIdentityType

The identity type

userAssignedIdentities

<string,  DatabaseUserIdentity>

The resource ids of the user assigned identities to use

DatabaseIdentityType

The identity type

Name Type Description
None

string

UserAssigned

string

DatabaseLicenseType

The license type to apply for this database. LicenseIncluded if you need a license, or BasePrice if you have a license and are eligible for the Azure Hybrid Benefit.

Name Type Description
BasePrice

string

LicenseIncluded

string

DatabaseListResult

A list of databases.

Name Type Description
nextLink

string

Link to retrieve next page of results.

value

Database[]

Array of results.

DatabaseReadScale

The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Not applicable to a Hyperscale database within an elastic pool.

Name Type Description
Disabled

string

Enabled

string

DatabaseStatus

The status of the database.

Name Type Description
AutoClosed

string

Copying

string

Creating

string

Disabled

string

EmergencyMode

string

Inaccessible

string

Offline

string

OfflineChangingDwPerformanceTiers

string

OfflineSecondary

string

Online

string

OnlineChangingDwPerformanceTiers

string

Paused

string

Pausing

string

Recovering

string

RecoveryPending

string

Restoring

string

Resuming

string

Scaling

string

Shutdown

string

Standby

string

Starting

string

Stopped

string

Stopping

string

Suspect

string

DatabaseUserIdentity

Azure Active Directory identity configuration for a resource.

Name Type Description
clientId

string

The Azure Active Directory client id.

principalId

string

The Azure Active Directory principal id.

SampleName

The name of the sample schema to apply when creating this database.

Name Type Description
AdventureWorksLT

string

WideWorldImportersFull

string

WideWorldImportersStd

string

SecondaryType

The secondary type of the database if it is a secondary. Valid values are Geo and Named.

Name Type Description
Geo

string

Named

string

Sku

An ARM Resource SKU.

Name Type Description
capacity

integer

Capacity of the particular SKU.

family

string

If the service has different generations of hardware, for the same SKU, then that can be captured here.

name

string

The name of the SKU, typically, a letter + Number code, e.g. P3.

size

string

Size of the particular SKU

tier

string

The tier or edition of the particular SKU, e.g. Basic, Premium.