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!
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…
- Open Visual Studio
- New console app
- NuGet for Service Bus
- Open portal.azure.com
- Browse to the SB blade and copy the connection string
- Paste it into app.config
- Write the code to pull the conn string from config and create a TopicClient
- 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!
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,
I can’t wait for the future, it looks sooo shiny!
Thanks for reading! <3
[Totally Irrelevant] See Also Section
- What’s New in the Windows Console in Windows Server 2016 Technical Preview – New select and paste behavior, word wrapping, transparency, mark mode! Now they’re just spoiling us! 😀
(These key combos work in Windows 10 too, btw)