Azure SQL Linked Service

 

Important

This topic provides the JSON format that is supported by the older versions of Azure PowerShell. If you are using the July 2015 Release version of Azure PowerShell or later, see Azure SQL Linked Service for the latest JSON format. You can convert the JSON from old format to new format by using the tool: JSON Upgrade Tool

You create an Azure SQL linked service to link an Azure SQL database to an Azure data factory. This topic describes syntax for defining an Azure SQL linked service in a JSON file.When you use the Data Factory Editor in Azure Portal, the editor provides you a JSON template for defining a linked service that you can modify and deploy to create a linked service. To use the T:Microsoft.Azure.Commands.DataFactories.New-AzureDataFactoryLinkedService cmdlet to create a linked service, you will need to create a JSON file and use it with the cmdlet.

When creating a dataset based on this linked service, you set the location type in the dataset JSON to: Azure SQL Database. When creating a pipeline, you set the source type to SqlSource properties if you are using an Azure SQL database as a source in a copy operation. You set the sink type to SqlSink properties if you are using an Azure SQL database as a sink in the copy operation.

Properties

Property

Description

type

The type property should be set to: AzureSqlLinkedService

connectionString

Specify information needed to connect to the Azure SQL Database instance for the connectionString property.

Example

{
    "name": "MySQLAzureDB",
    "properties":
    {
        "type": "AzureSqlLinkedService",
        "connectionString": "Server=tcp:<servername>.database.windows.net,1433;Database=<databasename>;User ID=<username>@<servername>;Password=<password>;Trusted_Connection=False;Encrypt=True;Connection Timeout=30" "
    }
}

Important

If you want to copy data to an Azure SQL database, ensure that the IP address of the gateway machine falls in the range specified in the database-level rule for the database. See Azure SQL Database Firewall for details about the Azure SQL Database Firewall.

For an on-premises SQL Server database, ensure that the firewall on your network/computer hosting the Data Management Gateway allows outgoing communication on TCP port 1433.