Database Management

Auto-generate an Azure SQL mass registration file for DPA

This article provides a PowerShell script plus instructions to auto-generate a CSV file containing the Azure SQL databases to monitor with DPA. You can upload this file to DPA to mass register all the database instances together.

First published date

10/29/2018 9:02 PM

Last published date

1/25/2022 4:23 PM

Overview

This article provides a PowerShell script and instructions to auto-generate a CSV file containing the Azure SQL databases you want to monitor with DPA. You can upload this file to DPA to mass register all the database instances together.

Product section

Database Performance Analyzer

Resolution

-- Scripts are not supported under any SolarWinds support program or service.
-- Scripts are provided AS IS without warranty of any kind. SolarWinds further
-- disclaims all warranties including, without limitation, any implied warranties
-- of merchantability or of fitness for a particular purpose. The risk arising
-- out of the use or performance of the scripts and documentation stays with you.
-- In no event shall SolarWinds or anyone else involved in the creation,
-- production, or delivery of the scripts be liable for any damages whatsoever
-- (including, without limitation, damages for loss of business profits, business
-- interruption, loss of business information, or other pecuniary loss) arising
-- out of the use of or inability to use the scripts or documentation.

Each registered database creates load on DPA and its repository. If you are using an Azure SQL database as your repository, you could overwhelm the database if you register too many databases at once. Please see the Administrator Guide on recommended DTU levels.

  1. Download one of the following scripts:
  2. Download and install Azure PowerShell (© 2017 Microsoft, available at http://www.microsoft.com, obtained on January 9, 2017) from Microsoft.
  3. Open the PowerShell console.
  4. Set the policy level based on your company policy requirements.
    Set-ExecutionPolicy Unrestricted

    The available levels are Unrestricted, RemoteSigned, AllSigned, and Restricted. See this Microsoft article (© 2017 Microsoft, available at http://www.microsoft.com, obtained on January 9, 2017) for more information.

  5. Log in using your account.
    Login-AzAccount
  6. Select your subscription.
    Get-AzSubscription -SubscriptionName YOUR_SUBSCRIPTION_NAME | Select-AzSubscription
  7. Run the PowerShell script you downloaded.
    • In DPA 2021.3 and earlier:
      .\GenerateMassRegFile.ps1
    • In DPA 2022.1 and later:
      .\GenerateMassRegFile_2022-1_and_later.ps1

    A file named massreg_sql_database.csv is generated.

  8. Edit and save the CSV file. Enter the required information in each column. Do not delete the header row.

    SolarWinds recommends that you register less than 50 databases at a time. Trim the CSV file accordingly.

  9. In DPA, click Options > Mass Registration.
  10. Click Choose File, and locate the file.
  11. Click Load Registration File.