Azure 逻辑应用程序 - 平面文件解码 return 随机字符串

Azure Logics App - Flat file decode return random string

我想使用模式将平面文件解码为 XML,但是我在输出中得到了一些随机字符串 return。我使用企业集成包中的平面文件解码连接器。你能帮忙吗?

这是我的意见

{  
  "content": "PO1999-10-20\r\nUS        Alice Smith         123 Maple Street    Mill Valley    CA 90952\r\nUS        Robert Smith        8 Oak Avenue        Old Town       PA 95819\r\nITEMS,ITEM872-AA|Lawnmower|1|148.95|Confirm this is electric,ITEM926-AA|Baby Monitor|1|39.98|Confirm this is electric", 
  "integrationAccount": 
  {
        "schema": {            "name": "FlatFile"        }    
  }
}

这是我的输出

{    
  "body": 
  {        
       "$content-type": "application/xml;charset=utf-8",        
       "$content": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxQTyB4bWxucz0iaHR0cDovL0JpelRhbGtfU2VydmVyX1Byb2plY3QxLlBPIj4NCiAgPGRhdGUgeG1sbnM9IiI+MTk5OS0xMC0yMDwvZGF0ZT4NCiAgPGN1c3RvbWVyIHhtbG5zPSIiPg0KICAgIDxjb3VudHJ5PlVTPC9jb3VudHJ5Pg0KICAgIDxGdWxsTmFtZT5BbGljZSBTbWl0aDwvRnVsbE5hbWU+DQogICAgPFN0cmVldD4xMjMgTWFwbGUgU3RyZWV0PC9TdHJlZXQ+DQogICAgPENpdHk+TWlsbCBWYWxsZXk8L0NpdHk+DQogICAgPFN0YXRlPkNBPC9TdGF0ZT4NCiAgICA8UG9zdGFsQ29kZT45MDk1MjwvUG9zdGFsQ29kZT4NCiAgPC9jdXN0b21lcj4NCiAgPGN1c3RvbWVyIHhtbG5zPSIiPg0KICAgIDxjb3VudHJ5PlVTPC9jb3VudHJ5Pg0KICAgIDxGdWxsTmFtZT5Sb2JlcnQgU21pdGg8L0Z1bGxOYW1lPg0KICAgIDxTdHJlZXQ+OCBPYWsgQXZlbnVlPC9TdHJlZXQ+DQogICAgPENpdHk+T2xkIFRvd248L0NpdHk+DQogICAgPFN0YXRlPlBBPC9TdGF0ZT4NCiAgICA8UG9zdGFsQ29kZT45NTgxOTwvUG9zdGFsQ29kZT4NCiAgPC9jdXN0b21lcj4NCiAgPGl0ZW1zIHhtbG5zPSIiPg0KICAgIDxpdGVtc19DaGlsZDE+DQogICAgICA8cHJvZHVjdENvZGU+ODcyLUFBPC9wcm9kdWN0Q29kZT4NCiAgICAgIDxEZXNjcmlwdGlvbj5MYXdubW93ZXI8L0Rlc2NyaXB0aW9uPg0KICAgICAgPFF1YW50aXR5PjE8L1F1YW50aXR5Pg0KICAgICAgPFVuaXRQcmljZT4xNDguOTU8L1VuaXRQcmljZT4NCiAgICAgIDxOb3Rlcz5Db25maXJtIHRoaXMgaXMgZWxlY3RyaWM8L05vdGVzPg0KICAgIDwvaXRlbXNfQ2hpbGQxPg0KICAgIDxpdGVtc19DaGlsZDE+DQogICAgICA8cHJvZHVjdENvZGU+OTI2LUFBPC9wcm9kdWN0Q29kZT4NCiAgICAgIDxEZXNjcmlwdGlvbj5CYWJ5IE1vbml0b3I8L0Rlc2NyaXB0aW9uPg0KICAgICAgPFF1YW50aXR5PjE8L1F1YW50aXR5Pg0KICAgICAgPFVuaXRQcmljZT4zOS45ODwvVW5pdFByaWNlPg0KICAgICAgPE5vdGVzPkNvbmZpcm0gdGhpcyBpcyBlbGVjdHJpYzwvTm90ZXM+DQogICAgPC9pdGVtc19DaGlsZDE+DQogIDwvaXRlbXM+DQo8L1BPPg=="    
  }

这是我在 https://pastebin.com/Xhqc30bJ

的架构

"random string"实际上是一个base64编码的字符串。

在这里测试例如:https://www.base64decode.org/

您必须使用转换器函数 @base64toString() 解码文件内容。有关详细信息,请参见以下 MSDN 页面:https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-content-type,在 Application/xml and Application/octet-stream and converter functions.

部分下

您看到的是正确的。

您看到的是 Base64 编码的 Xml 平面文件解码器的输出。如果你在文本编辑器中解码该字符串,你会看到 Xml.

这就是 LogicApp 引擎的内部工作方式。当您尝试使用它时,它会自动解码 $content 的内容。

基本上,你没问题。完全没问题:)