Register and scan an Azure SQL Database Managed Instance

This article outlines how to register an Azure SQL Database Managed Instance data source in Purview and set up a scan on it.

Supported capabilities

The Azure SQL Database Managed Instance data source supports the following functionality:

  • Full and incremental scans to capture metadata and classification in Azure SQL Database Managed Instance.

  • Lineage between data assets for ADF copy and dataflow activities.

Prerequisites

Setting up authentication for a scan

Authentication to scan Azure SQL Database Managed Instance. If you need to create new authentication, you need to authorize database access to SQL Database Managed Instance. There are three authentication methods that Purview supports today:

  • SQL authentication
  • Service Principal
  • Managed Identity

SQL authentication

Note

Only the server-level principal login (created by the provisioning process) or members of the loginmanager database role in the master database can create new logins. It takes about 15 minutes after granting permission, the Purview account should have the appropriate permissions to be able to scan the resource(s).

You can follow the instructions in CREATE LOGIN to create a login for Azure SQL Database Managed Instance if you don't have this available. You will need username and password for the next steps.

  1. Navigate to your key vault in the Azure portal
  2. Select Settings > Secrets
  3. Select + Generate/Import and enter the Name and Value as the password from your Azure SQL Database Managed Instance
  4. Select Create to complete
  5. If your key vault is not connected to Purview yet, you will need to create a new key vault connection
  6. Finally, create a new credential using the username and password to setup your scan

Service principal and managed identity

There are several steps to allow Purview to use service principal to scan your Azure SQL Database Managed Instance

Create or use an existing service principal

Note

Skip this step if you are using managed identity

To use a service principal, you can use an existing one or create a new one.

Note

If you have to create a new Service Principal, please follow these steps:

  1. Navigate to the Azure portal.
  2. Select Azure Active Directory from the left-hand side menu.
  3. Select App registrations.
  4. Select + New application registration.
  5. Enter a name for the application (the service principal name).
  6. Select Accounts in this organizational directory only.
  7. For Redirect URI select Web and enter any URL you want; it doesn't have to be real or work.
  8. Then select Register.
Configure Azure AD authentication in the database account

The service principal or managed identity must have permission to get metadata for the database, schemas and tables. It must also be able to query the tables to sample for classification.

Add service principal to key vault and Purview's credential

Note

If you are planning to use managed identity, you can skip this step because the default Purview identity is already in Purview-MSI

It is required to get the service principal's application ID and secret:

  1. Navigate to your Service Principal in the Azure portal
  2. Copy the values the Application (client) ID from Overview and Client secret from Certificates & secrets.
  3. Navigate to your key vault
  4. Select Settings > Secrets
  5. Select + Generate/Import and enter the Name of your choice and Value as the Client secret from your Service Principal
  6. Select Create to complete
  7. If your key vault is not connected to Purview yet, you will need to create a new key vault connection
  8. Finally, create a new credential using the Service Principal to setup your scan

Register an Azure SQL Database Managed Instance data source

  1. Navigate to your Purview account.

  2. Select Data Map on the left navigation.

  3. Select Register

  4. Select Azure SQL Database Managed Instance and then Continue.

    Set up the SQL data source

  5. Select From Azure subscription, select the appropriate subscription from the Azure subscription drop-down box and the appropriate server from the Server name drop-down box.

  6. Provide the public endpoint fully qualified domain name and port number. Then select Register to register the data source.

    Add Azure SQL Database Managed Instance

    E.g. foobar.public.123.database.windows.net,3342

Creating and running a scan

To create and run a new scan, do the following:

  1. Select the Data Map tab on the left pane in the Purview Studio.

  2. Select the Azure SQL Database Managed Instance source that you registered.

  3. Select New scan

  4. Select the credential to connect to your data source.

    Set up scan

  5. You can scope your scan to specific tables by choosing the appropriate items in the list.

    Scope your scan

  6. Then select a scan rule set. You can choose between the system default, existing custom rule sets, or create a new rule set inline.

    Scan rule set

  7. Choose your scan trigger. You can set up a schedule or run the scan once.

    trigger

  8. Review your scan and select Save and run.

Viewing your scans and scan runs

To view existing scans, do the following:

  1. Go to the Purview studio. Select the Data Map tab under the left pane.

  2. Select the desired data source. You will see a list of existing scans on that data source under Recent scans, or can view all scans under the Scans tab.

  3. Select the scan that has results you want to view.

  4. This page will show you all of the previous scan runs along with the status and metrics for each scan run. It will also display whether your scan was scheduled or manual, how many assets had classifications applied, how many total assets were discovered, the start and end time of the scan, and the total scan duration.

Manage your scans - edit, delete, or cancel

To manage or delete a scan, do the following:

  1. Go to the Purview studio. Select the Data Map tab under the left pane.

  2. Select the desired data source. You will see a list of existing scans on that data source under Recent scans, or can view all scans under the Scans tab.

  3. Select the scan you would like to manage. You can edit the scan by selecting Edit scan.

  4. You can cancel an in progress scan by selecting Cancel scan run.

  5. You can delete your scan by selecting Delete scan.

Note

Deleting your scan does not delete your assets from previous Azure SQL Database Managed Instance scans.

Next steps