Get Collection of Azure SQL Databases

In this article

    You can get all Azure SQL backup policies created in Veeam Backup for Microsoft Azure.

    Request

    To retrieve a representation of a collection of Azure SQL databases, send the HTTP GET request to the /databases endpoint.

    HTTP Request

    GET https://<hostname>/api/v3/databases

    Query Parameters

    To control the amount and order of data in the response, you can use Offset, Limit, SearchPattern and the following query parameters:

    Query Parameter

    Value

    Description

    SubscriptionId

    string

    Returns only Azure SQL databases available the specified subscription. For more information, see Filter Parameters.

    TenantId

    string

    Returns only Azure SQL databases available the specified tenant. For more information, see Filter Parameters.

    ServiceAccountId

    string

    Returns only Azure SQL databases to which a specific Azure service account has access. For more information, see Filter Parameters.

    CredentialsState

    array[string]

    Defines whether Veeam Backup for Microsoft Azure must return only Azure SQL databases that are associated with any Azure SQL account: OnlyWithCredentials, OnlyWithoutCredentials, All.

    AssignableBySqlAccountId

    string

    Returns only Azure SQL databases that are associated with a specified Azure SQL account.

    RegionIds

    string

    Returns Azure SQL databases that reside in the specified Azure regions.

    ProtectionStatus

    • Protected
    • Unprotected

    Returns only Azure SQL databases with the specified protection status. For more information, see Filter Parameters.

    BuckupDestination

    • AzureBlob
    • ManualSnapshot
    • Archive

    Returns only Azure SQL databases with the specified backup destination. For more information, see Filter Parameters.

    Sync

    boolean

    Defines whether Veeam Backup for Microsoft Azure database is synchronized with the Azure resources.

    DbFromProtectedRegions

    boolean

    Defines whether an Azure SQL database resides in the protected region.

    Request Headers

    The request contains the following headers.

    Header

    Required

    Value

    Description

    Authorization

    Required

    Bearer <Access-Token>

    Authenticates a client who sends the request to the server. Must contain the access token for the current logon session in the Bearer <Access-Token> format.

    Response

    The server returns the following response to the client.

    Response Codes

    A successfully completed operation returns a response code 200 (OK).

    Response Headers

    The response to this request contains the following headers. The response may also include additional standard HTTP headers.

    Header

    Value

    Description

    Content-length

    integer

    Identifies the length of the response body message, in bytes.

    Content-type

    • application/json
    • application/problem+json

    Identifies the media type of the response body message.

    Response Body

    In the response body, Veeam Backup for Microsoft Azure returns a representation of the /databases collection. The DatabaseV3 schema is used for the collection representation.

    Get Collection of Azure SQL DatabasesExample

    The following request returns a full list of Azure SQL databases available to Veeam Backup for Microsoft Azure.

    Request:

    GET https://51.11.247.127/api/v3/databases

    Request Header:

    Authorization: Bearer <Access-Token>

     

    Response:

    200

     

    Response Body:

    {

     "offset": 0,

     "limit": 200,

     "totalCount": 73,

     "results": [

       {

         "id": "bsp1m6hd8d9a7zscoe4huh9xrtstqoj39abzywcguyu7yxum8h7y",

         "resourceId": "/subscriptions/123921a2-220d-45c9-92dd-82b6d5a3a78f/resourcegroups/bp-sql/providers/microsoft.sql/servers/bp-server-eus/databases/bp-sql-1",

         "name": "bp-sql-1",

         "serverName": "bp-server-eus",

         "serverId": "qhhre6nua6xdz815cwfquniemcx6zhxpd5addqndfzfpt9fztgjo",

         "resourceGroupName": "bp-sql",

         "sizeInMb": 2048,

         "subscriptionId": "123921a2-220d-45c9-92dd-82b6d5a3a78f",

         "regionId": "eastus",

         "hasElasticPool": false,

         "status": "Online",

         "databaseType": "Unmanaged",

         "_embeddedResources": {},

         "_links": {

           "self": {

             "href": "https://51.11.247.127/api/v3/databases/bsp1m6hd8d9a7zscoe4huh9xrtstqoj39abzywcguyu7yxum8h7y"

           }

         }

       },

       {

         "id": "931396wosfeh5xpbo3rzt5mjybirtye7sm1kafeyrmq4k9aotjpo",

         "resourceId": "/subscriptions/280921a2-220d-45c9-92dd-82b6d5a3a78f/resourcegroups/bp-sql/providers/microsoft.sql/servers/bp-server-we/databases/bp-sql-1 -restored",

         "name": "bp-sql-1 -restored",

         "serverName": "bp-server-we",

         "serverId": "zbuxm9yzfasp1stzfq84euohfxcnait96x1r8bz13kc9cg4di3po",

         "resourceGroupName": "bp-sql",

         "sizeInMb": 2048,

         "subscriptionId": "280921a2-220d-45c9-92dd-82b6d5a3a78f",

         "regionId": "westeurope",

         "hasElasticPool": false,

         "status": "Online",

         "databaseType": "Unmanaged",

         "_embeddedResources": {},

         "_links": {

           "self": {

             "href": "https://51.11.247.127/api/v3/databases/931396wosfeh5xpbo3rzt5mjybirtye7sm1kafeyrmq4k9aotjpo"

           }

         }

       }

    ...

     ],

     "_links": {

       "self": {

         "href": "https://51.11.247.127/api/v3/databases?offset=0&limit=200&dbFromProtectedRegions=False"

       }

     }

    }