Logic Apps Killed The Console App Star!

Well, at least for me today, they did... :)

Changing habits! Better sharing! Saving time and HDD clutter!

Shiny Apparel! Yes my friends, the future is [finally] here!

In summary: Console App = 15-30 mins, Logic App = 1 min!

 

C:\Users\Peter> All Windows developers are Console App stars!

 

For nearly a quarter of a century of Windows development, Console Applications are by far the most common type of application I've written. When we need to spin up a service client, test or demonstrate some small piece of code or functionality, one of the simplest and quickest ways is a Console App.

blog1-10

 

PowerShell is fast replacing many of the DevOps tasks that may have had me reaching for a Console App.

However, neither of these are easily shared. They also rely on the development environment and PC setup of the recipient.

 

Recently, I developed a Logic App that took service bus messages, pulled templates from Blob Storage, generated emails with attachments and posted them via O365.

When I was faced with the need to test the Logic App, my natural thought was of course spin up a quick Console App as a Service Bus client, to send test messages.

 

So I prepared myself for the usual ritual, which in this case would have been something like...

  1. Open Visual Studio
  2. New console app
  3. NuGet for Service Bus
  4. Open portal.azure.com
  5. Browse to the SB blade and copy the connection string
  6. Paste it into app.config
  7. Write the code to pull the conn string from config and create a TopicClient
  8. Load the JSON into a BrokeredMessage... and send!

 

This can take, at the very least, 15-30 minutes.

If I wanted a colleague or a client to test, it's not cool or safe to send someone an exe.

So you send the whole solution, which they build and run themselves.

Or I'd often copy the contents of the Program class, or just the Main method into an email.

That's assuming they even have Visual Studio installed.

 

But then I thought, here is a Logic App, there is a Send Message action. Surely it's quicker to...

 

Test Client in Under a Minute!

A Logic App to test a Logic App

 

1. In portal.azure.com, create a new Logic App.

Give it a name, select resource group... create!

blog1-1

 

2. Select blank App blog1-2b

 

3. Add a Recurrence blog1-3 & blog1-4

 

4. Add a Service Bus "Send Message" action. blog1-5

 

5. Select, or make a connection to your Service Bus blog1-6

 

6. Select the queue/topic blog1-7

 

7. Add the JSON message and [optionally] any user properties.

In this case there is a property that the SB subscriber of my other Logic App uses, to filter the messages by.

 

blog1-8

 

8. Save and Run! blog1-11

 

 

C:\Users\Peter> These steps took me under a minute!

 

I can now send a colleague the URL to the Logic App in the portal. Or at worst, just the ARM scripted resource.
They can tweak the parameters and try it themselves, from right there in the portal.
No more zipping and sending the whole Visual Studio solution!
No more emailing code snippets or installing NuGet libraries.

Not this time at least!

 

You can manually run the trigger for your Logic Apps as shown below (but if there's nothing to do, it won't run)

If you use a recurring trigger like above, you can disable your Logic App, when its not needed.

The cost of each run is shown here -  truly tiny, for a personal or even SME sized function.

This example costs two actions, as the trigger counts as well.

 

blog1-9

 

 

Console Apps have been around as long as I can remember. They are the first thing I'd always have thought to use... until now!

 

Logic Apps have only been around since July 2016, but they are already transforming my developer habits!

 

Obviously, I expect to be needing Console Apps for a very long time yet, but [thankfully] less and less so.

This just shows how that Utopian dream of "shared code" really is beginning to become a reality!

 

A tip of the hat is of course due,in recognition for my playful title,to the Buggles - "Video Killed the Radio Star". 

I can't wait for the future, it looks sooo shiny!

the-buggles-video-killed-the-radio-star

 

 

Thanks for reading! <3

Pete Laker (Azure MVP)
MVP logo8507_PeteWikiNinjaStick_png-199x0

 

 

[Totally Irrelevant] See Also Section