Logic Apps Killed The Console App Star!
Published Feb 12 2019 02:47 PM 336 Views
Bronze Contributor
First published on MSDN on Mar 09, 2017

Authored by Peter Laker

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.

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!

2. Select blank App

3. Add a Recurrence


4. Add a Service Bus "Send Message" action.

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

6. Select the queue/topic

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.

8. Save and Run!

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.

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!

Thanks for reading! <3

Pete Laker (Azure MVP)

[Totally Irrelevant] See Also Section

  • 3 funny things you can do with C# Console

  • Minesweeper recreated as a Console App

Version history
Last update:
‎Feb 12 2019 02:47 PM
Updated by: