I have created a simple azure logic app.
I want to create above logic app unit test cases using msunit project. I'm new to logic apps.
I've dug quite a bit into the topic when was looking closely into Logic Apps... AFAIK, whether with or without deploying your Logic App to Azure, there's no way unit test a specific step, sorry.
At the very best you could have an end-to-end / integration test. That would require you to deploy the App into Azure cloud, because you don't have any other way to make your Logic App's JSON definition executable locally (on your desktop, or other on-premise machine).
Now we're talking about end-to-end tests, hence there's a question how do you make sure that your test does not mess up production data, right? This, in turn, raises one of two subsequent questions:
(Hint: Even though, both problems are solvable, none of these ^ questions have simple-easy answers. I personally decided to NOT go that way at all).
To give you some hope. In case you are okay with diverging from pure Logic App based solution, I'd recommend into implementing your custom logic as Azure Functions. Those functions are just normal JavaScript/C#/language of choice code which you actually can unit-test locally. Those functions are also easy to invoke from a Logic App.
The Logic App as a platform may work well as an orchestrating platform. It supports multiple triggers; allows controlling the degree of parallelism in your application; it lets you configure retry and timeout logic; and so on. It's just not good at all when it comes to everything that's related to expressing application logic that deals with the connectors.
Related sources:
!!! Slides with some decent ideas: Automated Testing with Logic Apps and Specflow
StackOverflow: Can you have automated regression/integration tests for Azure Logic Apps?
Is Your Serverless Application Testable? – Azure Logic Apps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With