0 Comments

logoAzure Blob Bridge for IFTTT provides an easy way to use Azure Blob storage as a IFTTT destination Channel.

In this post I’ll introduce you to the Azure Blob Bridge for IFTTT project. I will follow up with a tutorial which will include:

  • Deploying Azure Blob Bridge for IFTTT
  • Creating a IFTTT recipe using the Maker channel

Background

IFTTT is a web-based service that allows users to create chains of simple conditional statements, called "recipes", which are triggered based on changes to other web services such as Gmail, Facebook, Instagram, and Pinterest. IFTTT is an abbreviation of "If This Then That"…

https://en.wikipedia.org/wiki/IFTTT

Wikipedia's description of IFTTT is accurate: It allows you to chain web services together. For example, I’ve been using it to write new posts from Feedly into our Wordpress.

Unfortunately IFTTT doesn't currently provide Channel for Azure Blob storage. Azure Blob Bridge for IFTTT -project can be used to work around the limitation. The project works as an output Channel (“action”) for IFTTT. Using Azure Blob Bridge for IFTTT as a Trigger is coming later.

Implementation

Azure Blob Bridge works by providing HTTP POST API for uploading blobs to your Azure Storage Account. The project is implemented using Nancy and C#.

The project creates a POST uri based on your configuration’s apiKey. For example, if you set your apiKey to “myKey”, you can access the bridge through /api/myKey/.

The new blob will be created from the request’s content (body). Content-type is set if provided in request headers. File name is automatically generated using DateTime.UtcNow.Ticks + ".dat".

Usage with HTTP POST

To write a blob to your Azure Blob storage, send a HTTP POST Request to the Azure Blob Bridge for IFTT:

POST http://myapp.domain.com/api/apikey HTTP/1.1
Content-Length: 38
Content-type: Application/json

{"author":"hello", "text":"mycontent"}

Configuration

You need to define three configuration settings, either through the Azure Deploy or through Web.config:

  • apiKey = Api key is used to define the URL for your api. NOTE: Use only valid URI characters. Example: apiKey = "hello" -> Your API works through http://yourdomain.com/api/hello
  • storageConnectionString = The Azure Storage connection string. Example: DefaultEndpointsProtocol=https;AccountName=mystoragewe;AccountKey=wjN544545444233rwsdsdddddkkkkkkk999999999923wu3zJXSoBJ4LAWBbtEYKqbwjIQ==
  • container = The Azure container where files will be written. NOTE: Use only valid container character (so no upper cases or numbers). If container is missing, it will be automatically created as private. Example: mycontainer

Code

The Azure Blob Bridge for IFTTT is available through GitHub as an open source project.

License

The project is distributed under the terms of the MIT License (see mit.txt).