Using Inline Code on your Azure Logic Apps
Did you ever feel the need to run some pieces of code while building your workflows using Azure Logic Apps, and you quickly realized that you need to use and connect something else with your workflow, such as Azure Functions?
But of course, besides the fact that Azure Functions is amazing to run pieces of code, you still need to create a Function App, store your code in a repo (in case you are working as team, in your company, etc..), build a pipeline to deploy your code, maybe generate some ARM templates to follow the Infrastructure as Code principle, and create/configure your Function App while deploying your code.
So, does it really worth all these steps, to run small pieces of code with simple logic? Probably not.
To start using it, there are some some steps you need to perform.
- Create an Azure subscription. If you don’t have an Azure subscription, you can sign up for a free Azure account.
- Create a logic app so then you can add your code snippet. If you don’t have a logic app, follow this quick and amazing Microsoft guide - Create your first logic app.
- Create an integration account and link it to your logic app.
So before wrap up, I want to share with you an example of one of the ways I used this functionality. So, I was using Logic Apps to process some tweets on Twitter, based on keywords and hashtags (in this case using the hashtag #Azure), but as we know, usually tweets contains more hashtags, so I was looking a simple way to extract all hashtags from the tweet text, so then I could process it. In this case, I end-up using Inline Code action, and a simple regular expression (Regex) to extract all hashtags from the tweet text. Follows image below.
If you want to have more details about this functionality, please have a look to the Microsoft Documentation referenced below.
|Add and run code snippets by using inline code in Azure Logic Apps|