I was recently building a nice flow in Azure Logic Apps (which I will share soon ;)) when I faced a strange issue while trying to save the flow.
I got two errors that didn’t immediately ring a bell to me:
Workflow validation failed for the workflow ”. {“error”:{“code”:”InvalidTemplate”,”message”:”The template validation failed: ‘The template action ‘Until_Delete_windowsHelloForBusinessAuthenticationMethod’ at line ‘1’ and column ‘8632’ is not valid: \”The template language expression ‘sanitized’ is not valid: the string character ‘\”‘ at position ’89’ is not expected.\”.’.”}}
Workflow validation failed for the workflow ‘LAEmergencyRevokeAccessv1.0’. The template validation failed: ‘The template action ‘Until_DELETE_microsoftAuthenticatorAuthenticationMethod’ at line ‘1’ and column ‘10199’ is not valid: “The template language expression ‘equals(outputs(‘HTTP_GET_authentication_methods’)?[‘statusCode’],”204″)’ is not valid: the string character ‘”‘ at position ’65’ is not expected.”.’.
Of course, the errors show the names of the actions that throw the error, but when I looked up the actions in the new designer, nothing seemed wrong to me. The errors were related to an Until action. And as in one of the actions, number 204 was entered, it must have something to do with that. But to my knowledge, nothing seems wrong.
I switched to Code view and searched for the Until action and number 204. At first, I didn’t see an issue with the code but wondered if it has to do with the double quotation marks or back slash next to the number.
Luckily, I had made a clone of the flow before I faced the issue to compare the code of both flows.
And indeed after changing ,\”204\”)” into ,0204)” I could save the flow again.
After a while when I added other actions to the flow, I faced the issue again and again. Even when I completely rebuilt the flow, the error popped up as soon as I added multiple Until actions in my flow.
It seems the new designer adds the quotation marks and backslashes for no reason to the flow.
Because of that, I filed a bug at GitHub.
But as I don’t know how long it takes; I decided to share the simple solution for this annoying bug here in case anybody else faces the issue. It might be related to the new designer, as I have never faced the issue before. But unfortunately, the legacy designer isn’t available for me anymore, so I can’t test that.