Friday Fact: Visual Studio 2019 successfully deployed Logic App Consumption with invalid JSON payloads inside Compose actions

  • Sandro Pereira
  • May 31, 2024
  • 2 min read

If your organization uses Logic Apps Consumption for some enterprise integration scenarios, developing them in Visual Studio 2019 is mandatory. There is no other way to apply proper CI/CD and source control to Logic Apps Consumption.

Although we have a browser embedded in Visual Studio to be able to access the Logic App Designer, the Logic App Designer in Visual Studio 2019 behaves differently from the one in the Azure Portal. One of these different behaviors is the one we will reference here today.

📝 One-Minute Brief

When developing Logic Apps Consumption in Visual Studio 2019, JSON validation behaves differently than in the Azure Portal. This Friday Fact highlights an important flaw where Visual Studio allows invalid JSON payloads inside Compose actions to be saved and deployed without errors. Although the deployment succeeds, the Logic App fails during execution. The article explains why this happens, why it can be dangerous in CI/CD scenarios, and why developers should be extra cautious when validating JSON locally in Visual Studio.

If we are constructing a JSON payload within a Compose action, note that the Compose action in Visual Studio sometimes doesn’t validate the JSON payload!

doesn't validate the JSON payload

Notice that the picture above is missing a comma between param1 and param2.

Worse, even if it validates and presents the error message in the editor, it will allow you to save and deploy the Logic app successfully with this error, but it will fail when we try to execute it.

successfully deploy

This is the opposite of what happens inside Logic App Designer in the Azure Portal. Although it sometimes takes a little time to validate and present the valid JSON error message, you will not be able to save it if that payload is invalid.

Error in the Azure Portal

This behavior is clearly a bug within the Visual Studio Logic App extension that I hope Microsoft will fix in the future, since it may cause several problems in our processes, becoming a tedious and time-consuming task for analyzing the issues and their corrections.

To lazy to read? We’ve got you covered! Check out our video version of this content!

Hope you find this helpful! If you enjoyed the content or found it useful and wish to support our efforts to create more, you can contribute towards purchasing a Star Wars Lego for my son!

Buy me a coffee
Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

Leave a Reply

Your email address will not be published. Required fields are marked *

The Ultimate Cloud
Management Platform for Azure

Supercharge your Azure Cost Saving

Learn More
Turbo360 Widget

Back to Top