Create a data factory and pipeline using .NET SDK

Eddy Tegera 0 Reputation points
2024-04-25T03:13:10.4833333+00:00

Hello, this is my first post here and I hope to find a solution. I am working on a web portal (.NET) hosted in Azure Web Apps and need to create a Service Link for Azure SQL Database in Azure Data Factory when I perform specific actions. The problem is that Microsoft's documentation only provides an example with the creation of a Linked Service for Azure Data Lake Storage (https://learn.microsoft.com/en-us/azure/data-factory/quickstart-create-data-factory-dot-net#create-a-data-factory), and I need the .NET format to link it to Azure SQL Database.

I hope you can help me. Thank you very much.

Azure SQL Database
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,600 questions
{count} votes

1 answer

Sort by: Most helpful
  1. phemanth 5,840 Reputation points Microsoft Vendor
    2024-04-26T06:17:30.4233333+00:00

    @Eddy Tegera Unfortunately, there isn't a directly corresponding Microsoft documentation page showcasing the exact code snippet you provided for creating a Service Link with parameters and service principal authentication using the Azure Data Factory .NET SDK.

    However, the approach you've outlined is correct, and we can combine the best aspects of what you already have and the referenced resources to achieve your goal.

    Here's a breakdown of your code and how it aligns with Microsoft documentation:

    • Linked Service Definition with Parameters: While there isn't explicit documentation referencing parameters within the Linked Service definition object itself, the concept aligns with Dynamic content: [invalid URL removed] in Azure Data Factory. This allows you to use expressions like @{linkedService().DbServer} to reference parameter values dynamically.
    • Service Principal Authentication: The servicePrincipalId, servicePrincipalKey (using SecureString), and tenant properties within typeProperties map directly to service principal authentication documented here: Create Microsoft Entra users using service principals: https://learn.microsoft.com/en-us/azure/azure-sql/database/authentication-aad-service-principal-tutorial

    Here's how you can leverage existing documentation and your approach:

    1. Linked Service Definition: Maintain the structure you have with name, properties, and dynamic content references for parameters within the connection string.
    2. Service Principal Authentication: Keep using servicePrincipalId, servicePrincipalKey (SecureString), and tenant properties for service principal details.
    1 person found this answer helpful.