Connect to SQL Server from a BizTalk Services Project
Updated: November 21, 2013
There are three broad steps in creating connectivity to a SQL Server database from a BizTalk Services project.
Create an LOB Target for SQL Server.
Note To create an LOB Target for SQL Server, you must be a member of the local Administrators group and have the System Administrator right on the back-end SQL server and the on-premise source SQL Server. Important Visual Studio must be opened with Administrative privileges to use BizTalk Adapter Service.
Use the LOB Target
Generate schema for the operation to be performed on the SQL Server application.
To add an LOB Target for SQL Server
In Server Explorer, expand BizTalk Adapter Service, expand the Management URL, and then expand LOB Types.
Right-click SQL and click Add SQL Target. This launches the Add a Target wizard:
In the Welcome window, click Next.
In Connection Parameters, specify the following:
Server: The server name or IP address of the SQL Server and optionally, the port number. If the port number is not specified, port 1433 will be used. To specify a different port, enter ComputerName:PortNumber.
Instance: The name of the SQL Server instance. If no value is specified, the Default instance is used.
Catalog: The name of the database.
Advanced: Click this button to configure additional Uri Properties and any Binding Properties:
In the Binding Properties tab, refer to Working with BizTalk Adapter for SQL Server Binding Properties to configure these properties.
Optional. The server name or IP address of the SQL failover server. This server is used if the primary server goes down.
Optional. An identifier used to make the URI unique.
Important Required when using the TypedPolling operation.
Required. The name of the on-premise source database.
Required. The name of the SQL Server instance. If no value is specified, the Default instance is used.
Required. The server name or IP address of the SQL Server and optionally, a port number. If the port is not specified, port 1433 will be used. To specify a different port, enter MyServerName:PortNumber.
The SQL Server Connection URI provides additional information on the SQL adapter.
Specify the credentials: Enter the credentials to authenticate to the on-premise source SQL Server. Options include:
Use Windows Credentials
The logged on user credentials will be used to connect to the source SQL Server.
Use the following UserName and Password
Enter a User name and Password that can connect to the source SQL Server.
- Server: The server name or IP address of the SQL Server and optionally, the port number. If the port number is not specified, port 1433 will be used. To specify a different port, enter ComputerName:PortNumber.
In Operations, expand the node, select the database operation and click the right arrow:
Browsing, Searching, and Retrieving Metadata for SQL Server Operations provides additional details on selecting an operation.
To see the operation’s generated WSDL, select the operation and click Properties.
In Runtime Security, specify the security type. This security type determines how the client message is authenticated with the LOB Target. Options include:
Select this option if you are using a username and password created locally on the LOB system.
Fixed Windows credential
Select this option to use a Windows domain account.
Custom SOAP Header
Select this option if you create a custom SOAP header to include the username and password.
Select this option if you are including the logon credentials in the WS-Security header of the message.
In Deployment, choose an existing LOB Relay or create a new LOB Relay.
Tip A single LOB Relay can be used with multiple LOB Targets. There are restrictions based on the security model. As a best practice, group the same security method in one LOB Relay. For example, use the same LOB Relay to host the LOB Targets that use Message Credential or Fixed Windows security type.
To create a new LOB Relay:
Required. Enter your Service Bus namespace because the LOB relay will be created in the Service Bus. The namespace name is available in the Azure Management Portal after you sign-in.
Required. The Service Bus Issuer Name. Issuer Name is available in the Azure Management Portal after you sign-in. The correct Issuer Name must be specified.
Required. The Service Bus Issuer Secret key. Issuer Secret is available in the Azure Management Portal after you sign-in. The correct Issuer Secret must be specified.
Required. Enter the desired name of the relay path. For example, if you use chose the Fixed windows credential option for Runtime Security; you can enter something like WindowsAuthRelay.
Required. Enter a sub-path to make this target unique. For example, you can enter GetOrder.
Target runtime URL
This is automatically populated with the namespace name, relay path and target sub-path specified. If using the examples above, it will be populated with something like:
Summary shows your configured values. Click Create.
When complete, click Finish. The following activities occur in the background:
The LOB Target is created in Server Explorer. It can be disabled, started and deleted. Its configuration can also be exported.
The LOB Target is created as an application in IIS. This application uses the Runtime for this specific LOB Target. Runtime Components: BizTalk Adapter Service describes the IIS components.
- The LOB Target is created in Server Explorer. It can be disabled, started and deleted. Its configuration can also be exported.
To use the LOB Target
Right-click anywhere on the BizTalk Service project design surface, select Properties and update the BizTalk Service URL property to include your BizTalk Services name. This is the name that you provided in Azure Management Portal while provisioning the BizTalk Services.
Set the security property for the relay endpoint.
Right-click the relay endpoint in Server Explorer and select Properties.
In the Properties grid, click the ellipsis (…) against the Runtime Security property.
In the Edit Security dialog box, select the security method you want to use and specify the relevant values.
- Right-click the relay endpoint in Server Explorer and select Properties.
Drag and drop the LOB Target onto the design surface. Note the Entity Name property of the LOB Target. The default value of the property is Relay-Path_target-sub-path.
Open the .config file for the LOB target, which typically has the naming convention as RelayPath_target-sub-path.config. Specify the Service Bus issuer name and issuer secret, as shown below:
<tokenProvider> <sharedSecret issuerName="owner" issuerSecret="issuer_secret" /> </tokenProvider>
Save changes to the config file.
To generate the schema
In the BizTalk Service project, in the Server Explorer, right click the LOB Target you created, and then click Add schemas to <project_name>. The Schema Generation dialog pops up.
Specify a file name prefix. This value will be prefixed with all the schema files that are generated. You can also specify the folder name under which the schemas will be added in the Visual Studio Solution Explorer. The default value for the folder is LOB Schemas.
Select a credential type to generate the schema, provided appropriate values for authentication, and then click OK.
The schemas are added to the project under the folder name.
ConceptsConnect to Oracle Database from a BizTalk Services Project
Connect to Oracle eBusiness Suite from a BizTalk Services Project
Connect to mySAP Business Suite from a BizTalk Services Project
Connect to Siebel eBusiness Applications from a BizTalk Services Project
Using LOB Targets with Bridges
PowerShell Cmdlets - BizTalk Adapter Service
Connect to LOB systems from a BizTalk Services Project
© 2013 Microsoft Corporation. All rights reserved.