In previous blog posts I’ve been writing about some of the basics of Azure’s App Service offering. Today I would like to add another episode covering the steps required to provision Azure API Apps found within the Azure Marketplace. Without following the following steps, you won’t be able to consume the logic blocks (API calls) exposed by the API App. Fortunately, this is all fairly simple and therefore leaving room to cover some of the API Apps, currently available within the Azure Marketplace, in further detail.
If you are new to Azures App Service offering, I would like to recommend reading my previous Azure App Service posts which can be found here.
Azure App Service – Provision APIs using the Azure Portal
For this demo I will be provisioning a Twitter Connector. There are multiple locations which will lead to the Azure API Apps section within the Azure Marketplace. The first way is from within the Logic App designer as seen within the image below.
NOTE: Before you can start provisioning API Apps, it’s recommended to think about your App Service Plan setup as covered in previous posts (This plans explains what resources are available and what you will have to pay). I will be using an existing App Service Plan to simplify the demos. If you are playing around with Azure App Service, just create a new plan during the provisioning steps and make sure the geographical location is offering Azure App Service.
I personally prefer provisioning all required API’s (building blocks) via the Marketplace tile, which by default, is located on the dashboard. After opening Azure Marketplace, select API Apps for listing all available options.
The Twitter Connector can be found under the section called “Social”. Select the connector and click on the create button within the details blade.
A new blade will open where it’s required to specify the Name and the App Service Plan (Includes the Service tier, Resource group and Subscription) or create a new plan. One thing you will have to be aware of is that the A logic App can only consume APIs provisioned within the same Resource Group.
NOTE: other connectors may require additional information. Some of this information cannot be changed after the creation of the connector. At the moment, I’m not sure if this is by design or if this will be released in a later stage.
After creation, the API App should be visible within the Azure resource browser as seen below.
Before we continue it’s important to know that Azures API Apps hosting platform is designed to take care of rudimentary plumbing such as access level control, authentication and API updates. Most of the settings can be configured within the Settings details blade. This also includes Authentication; however this section is optional when given that I will only access the API App from a Logic App.
I will be covering more advanced scenarios within a later post which will also cover the resource group gateway (a special application that handles all requests destined for API apps in the resource group).
At this point it possible to start consuming the API App within your Logic App. To do this, just create a new Logic App within the portal and make sure to select the same App Hosting Plan because the Logic App will need to coexist within the same resource group. It’s possible so save the Logic App at this point or start the designer by clicking on Triggers and Actions.
When designing a Logic App it’s you will have to keep in mind that something will need to initiate this process. This can either be the Recurrence logic block (published by default) or an API App which includes a trigger. The Twitter Connector includes a single Trigger called New Tweet and listens for new Tweets for the account configured within the Logic App. Setting up the authentication is simple, Start by clicking on the Twitter Connector » Click on Authenticate, provide the credentials and allow access.
To access the available actions, just start with a blank designer and add a Recurrence logic block. After configuring the interval, add the Twitter Connector and a list with possible actions will appear including; Get user timeline, Search Tweets, Tweet etc.
This post just provided a quick introduction on how to consume existing API Apps as found within the Azure Marketplace. Every API App comes with its own sets of settings and possibilities and can be consumed directly via its endpoint or from within an Azure Logic App.
The Twitter Connector is a good example of an simple API App which includes both Triggers and Actions. Configuring authentication was simple given that Azure will take care of this in the background and therefore saving lots of work.