The Azure Cosmos DB Blog

All about Cosmos DB, IoT and Azure

Month: January 2016 (page 2 of 5)

Polling for modified documents


Recently I saw a question posted asking if DocumentDB supported Notifications for modified resources.

I have worked with BizTalk for many years and this is a common scenario using the WCF LOB Adapters SDK.

I have added Notifications to my To Do list.

I have started a new project to demonstrate how you can buy Lyrica canada Poll for modified documents in DocumentDB.  

First I am going to explain how to do it and then in a follow-up post or two,  I will show how it is done.

To start off with, I am going to create a new Document and name it “PollingController”.

The how to buy antabuse tablets PollingController  document source is:

  "id" : "string",
  "isController" : "TRUE",
    "PollingStatus" :
      "DocId" : "string",
      "timestamp" : "date_time",
      "status" : 


This document is very similar to a table in SQL Server. The document will contain an array of “documents”,  described in the following table.

Item Description
DocId This is the ID of the new or modified document
timeStamp Date Time the document was created, modified, or picked up
status This is the status of the document as it is being Processed.

New = default

Modified = document has been modified

inprocess = the document is in the processing state

completed = the document has been processed.

Next I am going to create a new Trigger.

The . isController default value of true, is used to identify the PollingController Document from  the Trigger.

The Trigger would add a new “PollingStatus”  document to the array in the PollingController Document

Once I have the Trigger in place and tested, I will create a new API App using Swagger. There would be two operations to start off with

I could also add it to the DocumentDBRestAPI App I created.

One operation would be to query the “PollingStatus” document, looking for a Status = new or Status = modified.

If found,  I would Get the DocId value.  Since I don’t want to get these values more than once, I will need to change the Status = inprocess,  and update the timeStamp.

Since I need to run the Query Operation on a schedule, I will use a Logic App to handle this.

This should give you an idea of how the process will work.

Please check back for an update on the project.[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][/vc_column][/vc_row]

Migrating a WCF Service to an API App

I recently responded to a question about moving or re-implementing an existing WCF Service running on a BizTalk cluster.

The customer wanted to utilize Azure Logic Apps instead of BizTalk on premise.  The WCF Service is running as a Windows Service

I recommended the following:

  1. Create a Swagger for a new API that will replace the WCF Service.

    NOTE: When creating your Swagger, add descriptions for each operation and parameter

  2. Use the same signature (operation names and input parameters) for the Methods in the WCF Service.
  3. Create a new Azure API App in Visual Studio.
  4. You can include Application Insights as an option.
  5. Using the add REST API CLIENT,  Select an existing  Swagger metadata file, as shown below.
  6. Use the Swagger that you created.


The following figure is a sample showing the classes created.

vs project

The generated code will include Models, which represent Request and Response objects.

There are three additional classes created.

Continue reading

« Older posts Newer posts »
Skip to toolbar