Configuring an ADF Linked Service Connection for DB2
For information on how to enable a connection for use with linked services, see Configuring a Linked Service Connection.
Field labels in this walkthrough follow the underlying Azure Data Factory property names, with the connection column that carries each value named alongside. The exact labels shown in the BimlFlex Connection Editor may differ.
After selecting DB2 from the Linked Service Type dropdown, the form required for creating a DB2 Linked Service will appear.
Source Only Connector
A DB2 connection is used as a source. It is not available as a target.
Each object is read through a dataset parameterized on schema and table, and the query on the copy source reads the object.
Choosing an Authentication Method
| Method | Credentials | Additional Settings |
|---|---|---|
| Basic | User Name and Password | None |
Recommendation: Store the connection string in Azure Key Vault rather than entering the Password as plaintext.
Complete Example: Connection String in Azure Key Vault
| Field | Example Value |
|---|---|
| Connect via Integration Runtime | AutoResolveIntegrationRuntime |
| Azure Key Vault Linked Service | bfx-kv |
| Secret Name (for Connection String) | BFX-SRC-Db2ConnectionString |
The secret holds the whole connection string, for example server=db2.contoso.com:50000;database=SALES;authenticationType=Basic;username=bfx_reader;password=<password>;.
Required Fields
Common Required Fields
A DB2 Linked Service connection uses a single Authentication Type, so the same fields are required on every connection.
These common required fields are:
- Connect via Integration Runtime
- Connection String (or Azure Key Vault)
- Server Name
- Database Name
- Authentication Method
- User Name
- Password
Optional fields are:
Connect via Integration Runtime
Connect via Integration Runtime names the integration runtime for a DB2 Linked Service connection.
The default value is AutoResolveIntegrationRuntime.
To use another runtime, select it from the dropdown or choose + New to add one.
When a custom value is saved in the linked service form, it will be added to the custom integration runtimes.
The custom values that appear in this dropdown can be maintained in Settings under Azure - AzureIntegrationRuntime.
The runtime is stored in the connection's LS_ConnectVia_IntegrationRuntime column. Any value other than AutoResolveIntegrationRuntime is written to the linked service as the runtime it connects through.
Connection String
A connection to a DB2 linked service requires a connection string. The required properties for the connection string are Server Name, Database Name, Authentication Method, User Name, and Password. The Linked Service connection form will provide text boxes for these values and will use them to construct the connection string.
The connection string is stored in the connection's LS_ConnectionString column and maps to the ADF connectionString property.
The Server Name names the DB2 server, and a port can follow the server name after a colon (for example, db2.contoso.com:50000).
The connection string can instead be held in Azure Key Vault. The reference is held in the LS_ConnectionStringKVS_ fields and resolves to the connection string at runtime. The form fields are then not required.
While the Azure Key Vault tab is selected, the form hides the User Name and Password fields, and a User Name or Password entered before the tab was selected is not written into the saved connection string.
It is suggested that Azure Key Vault be used in place of manually entering Connection String details.
Authentication Method
The DB2 Linked Service connection signs in with Basic authentication, the authentication Azure Data Factory accepts for this linked service.
The Authentication Method Basic is written into the connection string, and the generated linked service carries the ADF authenticationType property set to Basic.
User Name
The User Name is the DB2 user account the connection signs in with. It is written into the connection string.
Password
The Password is the password of the User Name account. It is written into the connection string.
It is suggested that the connection string be stored in Azure Key Vault in place of manually entering the password.
Package Collection
The Package Collection names the collection under which Azure Data Factory creates the packages it needs when it queries the database. When it is not set, Azure Data Factory uses the user name as the collection. A value entered here is written into the connection string.
Certificate Common Name
The Certificate Common Name is entered when the connection uses Secure Sockets Layer (SSL) or Transport Layer Security (TLS) encryption. A value entered here is written into the connection string.
Additional Connection String Properties
Any additional properties entered here will be included in the Connection String.
These properties should be entered the same way you want them to appear in the connection string and separated by a semicolon, e.g. key=value;secondKey=secondValue.
Azure Data Factory Linked Service Additional Information
For additional information on ADF DB2 Linked Service and its connection requirements see the Azure Data Factory DB2 Connector documentation.