jeffhollan / LogicAppTemplateCreator

Script to convert Logic Apps into templates for deployment
MIT License
143 stars 74 forks source link

The input is not a valid Base-64 string as it contains a non-base 64 character... #112

Open thomas-christiansen opened 2 years ago

thomas-christiansen commented 2 years ago

I have 2 logic apps in the same resource group, that I send through the LogicAppTemplateCreator. One generates the template just fine, the other generates this error and generates a blank template:

The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.

Any idea what is wrong?

thomas-christiansen commented 2 years ago

Okay, so I debugged a little in the source code. It looks like it happens when you use the "List Files in Folder" connector:

{ "List_files_in_folder": { "runAfter": { "jsonFileName": [ "Succeeded" ] }, "metadata": { "6e202211-2856-4d17-9ded-5beb8b8626b0": "/" }, "type": "ApiConnection", "inputs": { "host": { "connection": { "name": "@parameters('$connections')['filesystem_1']['connectionId']" } }, "method": "get", "path": "/datasets/default/folders/@{encodeURIComponent(encodeURIComponent('6e202211-2856-4d17-9ded-5beb8b8626b0'))}" } } }

It looks like it is trying to Base64Decode a string in the AddParameterForMetadataBase64.

As a workaround I commented out the Base64Decode part, and then it worked for me. //var param = AddTemplateParameter(parametername, "string", Base64Decode(base64string)); var param = AddTemplateParameter(parametername, "string", base64string);

MLogdberg commented 2 years ago

Thanks for reporting this, seems there is a change in the setup for File Connector.