Parameterizing Azure SQL and Azure SQL Managed Instance (MI) Linked Services

When you create a linked service in Azure Data Factory (ADF), the database name can be passed as a parameter, eliminating the need to create a separate linked service for each database. Linked service parameterization is available for Azure SQL and Azure SQL Managed Instance pipelines.

To configure a parameterized Azure SQL Database linked service, follow these steps:

  1. Open Azure Data Factory.
  2. Navigate to the Linked services section.
  3. Click New linked service.
  4. In the Data store search box, type Azure SQL Database.
  5. Select Azure SQL Database if you're creating a linked service for the AzureSQL pipeline, or Azure SQL Managed Instance for the AzureSQL Managed Instance pipeline. Then select Continue.

  6. Select either Azure SQL Database or Azure SQL Database Managed Instancefrom the list and click Continue.

  7. Configure the linked service:
    • Parameters: Add a string parameter with or without a default value. For e xample: LS_DATABASE
    • Name: Enter a meaningful name to identify the linked service. Optionally, add a description.
    • Connect via integration runtime: Select the appropriate integration runtime, for example, AutoResolveIntegrationRuntime.
    • Account selection method: Select Enter Manually.
    • Fully qualified domain name: Enter the complete address of your SQL server, for example, <your-server-name>.database.windows.net.
    • Database name: Enter the name of the specific database on the SQL server that your pipeline will connect to. For parameterization, use a dynamic expression such as @dataset().DatabaseName or @linkedService().LS_DATABASE, depending on your setup.
    • Authentication type: Select the authentication method based on your environment standards (for example, SQL Authentication, Managed Identity).
    • Define the credentials:
      • Provide the username and password.
      • Store the password directly in the linked service or use Azure Key Vault for security.
    • Parameters: Add a string parameter with or without a default value. For example: LS_DATABASE
  8. To ensure the linked service is set up correctly, click Test connection. If the test is successful, to save the linked service, click Create.

Your parameterized Azure SQL Database linked service is now configured and ready to use in Azure Data Factory.