Azure Table Storage Connector is out!

Today we received the announcement that the Azure Table Storage Connector is released!  At the moment, the connector is only available in West Central US, but it will be rolled out to the next data centres within the coming days and week.  This blog contains a preview of the capabilities of this new kid in the Logic Apps family!

Features

Below you can see the complete list of available actions.  It contains all actions you need to create/delete tables and to perform CRUD operations on them.  Next to that, we can conclude that there are no triggers available at the moment.  A use case where you need to act upon a new or edited row in a table, seems not feasible right now.  If you are in need of such functionality, don’t hesitate to get in touch with the product team and share your business scenario.

table1

Authentication

Obviously, the authentication is performed by providing the access key of your Storage Account, similar to the blob / queue / file connector.  At the moment, you need to provide it yourself.  I’m convinced that, in the future, there will be a wizard to pick one of the storage accounts available in your subscription.  This fits in the agile release cycles of Logic Apps: ship the Minimum Valuable Product as preview to get early feedback and enhance usability afterwards.

table2

Actions

In this chapter, I’ll test some of the most common actions.

Create table

I love to use the CreateIfNotExists() functionality to create new tables.  Unfortunately, the Create Table action does not support this.  Would be great see this option in a next release!  You can work around this, by using first the List Tables action.

table3

If you try to create an already existing table at runtime, you get the following exception: The table specified already exists.

Insert or Replace Entity

Great to see that the cool upsert features of Azure Table Storage made it to the connector: Insert or Merge Entity and Insert or Replace Entity.  I’ve tested the upsert functionality of the Insert or Replace Entity and it works as expected!  It’s your duty to provide the Partition Key and Row Key.  If an entity exists already with this key combination, it will be replaced by the new entity.

table4

Important remark: ensure that the Entity JSON object you pass, has no hierarchy.  An example to clarfiy:

  • This JSON object will be inserted by the connector:
{
   "ProductId": "123", 
   "ProductType": "Triple", 
   "ProductName": "Petrus", 
   "Type" : "Triple", 
   "Colour" : "Blond", 
   "AlcoholPercentage" : "8,4%" 
}
  • This JSON object will result in the following error: An error occurred while processing your request.  This is because Azure Table Storage expects flat structures.  You can flatten your JSON object first, before inserting it into the table.
{ 
   "ProductId": "123", 
   "ProductType": "Triple", 
   "ProductName": "Karmeliet", 
   "Characteristics" : 
   { 
      "Type" : "Triple", 
      "Colour" : "Blond", 
      "AlcoholPercentage" : "8,4%" 
   }
}

Get Entities

All select operations are performed via the Get Entities action.  You must provide the table name. Via the Filter OData Query, you can specify the search condition.  In the Select Query, you can choose what properties need to be returned.  This action works absolutely fine!

This action returns an array object, that contains your selected row(s):

[
   {
      "odata.etag": "W/\"datetime'2017-08-08T05%3A26%3A08.26797Z'\"",
      "ProductName": "Karmeliet",
      "ProductType": "Triple"
   }
]

 

Delete Entity

As a last test, I want to remove and entity from a table.  You need to provide the table, the Partition Key and Row Key to uniquely define the entity you want to remove.  It works as a charm!  Of course, trying to delete a non-existing entity results in an exception.

Conclusion

This Azure Table Storage connector is a much requested connector!  Azure Table Storage is cheap, fast and powerful, if you use it the right way.  Very happy to see that we don’t need to use a custom connector anymore!

Thank you, Logic Apps!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s