Ready to get started?

Learn more about the CData BizTalk Adapter for Cosmos DB or download a free trial:

Download Now

Configure a Receive Location for the CData BizTalk Adapter for Cosmos DB

Pull Cosmos DB data in BizTalk using the CData BizTalk Adapter for Cosmos DB. Use receive locations to execute SQL commands and automate actions in Cosmos DB.

You can follow the procedure in this article to connect to Cosmos DB data, configure a static one-way receive location, and use it to perform a simple test: retrieving Cosmos DB data and writing it to an XML file.


Create the Receive Port



Create the Receive Location

After you create the receive port, create the receive location and configure it to use the Cosmos DB adapter as its transport type.

  4. In the Receive Location properties, select CData.CosmosDB in the Transport Type menu.

Configure the Adapter


  2. In the SQL Command property, enter the command. This example uses SELECT City, CompanyName FROM Customers

Configure the Connection String


  2. Click the button in the Connection String property.
  4. Enter connection properties. Below is a typical connection string: AccountEndpoint=myAccountEndpoint;AccountKey=myAccountKey;

    To obtain the connection string needed to connect to a Cosmos DB account using the SQL API, log in to the Azure Portal, select Azure Cosmos DB, and select your account. In the Settings section, click Connection String and set the following values:

    • AccountEndpoint: The Cosmos DB account URL from the Keys blade of the Cosmos DB account
    • AccountKey: In the Azure portal, navigate to the Cosmos DB service and select your Azure Cosmos DB account. From the resource menu, go to the Keys page. Find the PRIMARY KEY value and set AccountKey to this value.



Use a Send Port to Write Data to an XML File



  4. For the file name, a macro can be used to easily identify what day the file was created. By default, %MessageId%.xml is used. However, this is not a very user-friendly name, as it is a randomly generated BizTalk Id. To produce a file in the format Customers_yyyy-MM-dd.xml, enter Customers_%Date%.xml.


  7. Set the following properties:
    Property: Select "BTS.InboundTransportLocation" from the menu.
    Operator: Select "==" from the menu.


Enlist and Enable the Locations and Ports





The log will include error messages for all applications on the system, so it is important to check that the source of the error message is "CData BizTalk Cosmos DB Receive Adapter". Details of the error message should provide insight into why the error is occurring. For guidance on resolving the error, contact support@cdata.com.