Get Azure Resources Protected by Azure SQL Backup Policy

In this article

    You can get Azure SQL databases protected by a backup policy with the specified ID.

    Request

    To retrieve information on protected Azure resources, send the HTTP GET request to the /policies/sql/{policyId}/selectedItems endpoint. {policyId} is a system ID assigned to the backup policy in the Veeam Backup for Microsoft Azure REST API.

    HTTP Request

    GET https://<hostname>/api/v3/policies/sql/{policyId}/selectedItems

    Query Parameters

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

    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 list of all Azure SQL databases protected by the backup policy with the specified ID. The PolicySqlBackupItemV3 schema is used for the collection representation.

    Get Azure Resources Protected by Azure SQL Backup PolicyExample

    The following request returns information on all Azure resources protected by a backup policy with the ID 6ac40b80-4bdb-46e9-9759-0fc0d1166ccf.

    Request:

    GET https://51.11.247.127/api/v3/policies/sql/6ac40b80-4bdb-46e9-9759-0fc0d1166ccf/selectedItems

     

    Request Header:

    Authorization: Bearer <Access-Token>

     

    Response:

    200

     

    Response Body:

    {

     "offset": 0,

     "limit": 200,

     "results": [

       {

         "database": {

           "id": "aii53ntfg1mw6zckcq567cmq1u1m31kfka3k9kbrji32efz6unuo",

           "resourceId": "/subscriptions/254321a2-220d-45c9-92dd-82b6d5a3a78f/resourcegroups/res_group/providers/microsoft.sql/managedinstances/uk-sql-managedinstance/databases/uk-server-db-matrix17",

           "name": "uk-server-db-matrix17",

           "serverName": "uk-sql-managedServer",

           "serverId": "yt9o7xc9b5ien885b65px1pnknia6qa7jyeuba3kdf3y7y4r5nzo",

           "resourceGroupName": "res_group",

           "sizeInMb": 0,

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

           "regionId": "uksouth",

           "status": "Online",

           "databaseType": "Managed",

           "_embeddedResources": {

             "subscription": {

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

               "environment": "Global",

               "tenantId": "97438793-c913-4a51-8485-d33056db7b9b",

               "tenantName": "Backup Software",

               "name": "Enterprise - Dept",

               "status": "Active",

               "_links": {

                 "self": {

                   "href": "https://51.11.247.127/api/v3/cloudInfrastructure/subscriptions/254321a2-220d-45c9-92dd-82b6d5a3a78f"

                 },

                 "storageaccounts": {

                   "href": "https://51.11.247.127/api/v3/cloudInfrastructure/storageAccounts?subscriptionId=280921a2-220d-45c9-92dd-54b6d5a3a78f&repositoryCompatible=False&vhdCompatible=False"

                 }

               }

             },

             "region": {

               "id": "uksouth",

               "name": "UK South"

             },

             "resourceGroup": {

               "id": "6k9q3biyjy5nm234uzkng5skd56e91agxi81gwru4hfecdd6a9my",

               "resourceId": "/subscriptions/254321a2-220d-45c9-92dd-82b6d5a3a78f/resourcegroups/res_group",

               "name": "Dept03",

               "azureEnvironment": "Global",

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

               "regionId": "uksouth",

               "_links": {

                 "subscription": {

                   "href": "https://51.11.247.127/api/v3/cloudInfrastructure/subscriptions/253421a2-220d-45c9-92dd-82b6d5a3a78f"

                 },

                 "self": {

                   "href": "https://51.11.247.127/api/v3/cloudInfrastructure/resourceGroups/6k9q3biyjy5nm534uzkng5skd56e91agxi81gwru4hfecdd6a9my"

                 }

               }

             },

             "server": {

               "id": "yt9o7xc9b5ien534b89px1pnknia6qa7jyeuba8kdf3y7y4r5nzo",

               "name": "uk-sql-server",

               "resourceId": "/subscriptions/254321a2-220d-45c9-92dd-82b6d5a3a78f/resourcegroups/res_group/providers/microsoft.sql/managedinstances/uk-sql-server",

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

               "regionId": "uksouth",

               "serverType": "Managed",

               "_links": {

                 "self": {

                   "href": "https://51.11.247.127/api/v3/cloudInfrastructure/sqlServers/yt9o7xc9b5ien543b89px1pnknia6qa7jyeuba8kdf3y7y4r5nzo"

                 }

               }

             }

           },

           "_links": {

             "self": {

               "href": "https://51.11.247.127/api/v3/databases/aii53ntfg1mw6zckcq543cmq1u1m31kfka3k9kbrji86efz6unuo?expand=Subscription&expand=ResourceGroup&expand=Region&expand=Server"

             }

           }

         }

       }

     ],

     "_links": {

       "self": {

         "href": "https://51.11.247.127/api/v3/policies/sql/6ac40b80-4bdb-46e9-9759-0fc0d1166ccf/selectedItems?offset=0&limit=200"

       }

     }

    }