none
OneDrive Connector "An Error has Occurred." in Azure Logic App RRS feed

  • Question

  • I'm trying out the OneDrive Connector in my Logic app.  I have a trigger activity on a SharePoint Online document library that fires when a document is uploaded.  I am trying to take that document and upload it to OneDrive, but I can't quite seem to get the parameters right.  As a result I end up with an "Error has occurred" from my OneDrive Connector.

    Here are the parameters that I have tried:

    • FilePath: Public, Documents, etc - do strings need to be enclosed in anything or can we just type them in?
    • Content - @triggers().outputs.body.X_MS_ContentTransferEncoding and @triggers().outputs.body.X_MS_Content
    • Content Transfer Encoding - Base64 and none

    It seems like I am close but I can't quite get it.  Any guidance?


    Corey Roth - SharePoint Server MVP blog: www.dotnetmafia.com twitter: @coreyroth | SP2 Apps

    Friday, March 27, 2015 4:13 PM

Answers

  • Hi Corey,

    I tried out the same scenario (screenshot below).

    Sharepoint Online to One drive

    You can set the following values

    FilePath: @{concat('/Documents/',triggers().outputs.body.Name)}

    Content: @{triggers().outputs.body.X_MS_Content}

    Content Transfer Encoding: None

    Note that I have used the concat function to place the file inside a folder in one drive. You can update it to reflect your folder structure.

    You had set the Content Transfer Encoding to base64 earlier. Can you update it to None and try again?

    Let me know if this works for you.

    Wednesday, May 6, 2015 10:13 PM
    Answerer

All replies

  • Hi Corey

    I tried the scenario mentioned by you. Here are the parameters you can use:

    1. FilePath : This is folder + filename where you want to upload. If you set it to Name coming from SharePoint Trigger Output - @triggers().outputs.body.Name. It will use the document "name" and upload to root of your one drive location.

    2. Content : this is the content of the file. As pointed by you it should be @triggers().outputs.body.X_MS_Content

    3. Content Transfer Encoding : this value depends on how your content from SharePoint is being transferred. If in SharePoint Online Connector trigger operation, you have chosen FileType as Binary (which is default), the File Stream is base4 encoded while transferring the data, this is generally used for Docs, Excel Sheets and Images. For One drive connector you can provide Content Transfer Encoding as Base64. (If file type in SharePoint Trigger is Text, choose Transfer Encoding as None)

    We are updating our documents and tutorials to make it easier to create logic apps. 


    • Edited by Vinushree Friday, March 27, 2015 6:28 PM Fixing typo
    Friday, March 27, 2015 6:26 PM
  • Ok, I tried using the value you gave me for the File Path along with the Content and Base64 encoding and I am getting the same error.

    Here's what my app looks like.

    Thanks,

    Corey


    Corey Roth - SharePoint Server MVP blog: www.dotnetmafia.com twitter: @coreyroth | SP2 Apps

    Friday, March 27, 2015 7:20 PM
  • Hi Corey,

    I tried out the same scenario (screenshot below).

    Sharepoint Online to One drive

    You can set the following values

    FilePath: @{concat('/Documents/',triggers().outputs.body.Name)}

    Content: @{triggers().outputs.body.X_MS_Content}

    Content Transfer Encoding: None

    Note that I have used the concat function to place the file inside a folder in one drive. You can update it to reflect your folder structure.

    You had set the Content Transfer Encoding to base64 earlier. Can you update it to None and try again?

    Let me know if this works for you.

    Wednesday, May 6, 2015 10:13 PM
    Answerer
  • Hi John,

    I tried this and unfortunately, I am still getting errors.  Here is my input minus the the encoded content.

    {
        "host": {
            "gateway": "https://default-web-southcentraluse58f886843cd4c06bbe282a04c169cd3.azurewebsites.net/",
            "id": "/subscriptions/e58f8868-43cd-4c06-bbe2-82a04c169cd3/resourcegroups/default-web-southcentralus/providers/Microsoft.AppService/apiapps/onedriveconnector"
        },
        "operation": "UploadFile",
        "parameters": {
            "filePath": "/Documents/dlp example 2.xlsx",
            "fileContent": {
                "Content": "",
                "ContentTransferEncoding": "Base64"
            },
            "overwrite": true
        },
        "apiVersion": "2015-01-14",
        "authentication": {
            "scheme": "Zumo",
            "type": "Raw"
        }
    }

    Here is the output.

    {
        "headers": {
            "pragma": "no-cache,no-cache",
            "x-Content-Type-Options": "nosniff",
            "x-ms-proxy-outgoing-newurl": "https://microsoftonedriveconnector7c85734588ae4a88b109144607c4552b.azurewebsites.net/file//Documents/dlp example 2.xlsx?overwrite=True",
            "cache-Control": "no-cache",
            "set-Cookie": "ARRAffinity=ae9a4df8bf4d9523cd8a8a2acd9d5d23845ba104ce16dae05ac2930b8ac3621f;Path=/;Domain=default-web-southcentraluse58f886843cd4c06bbe282a04c169cd3.azurewebsites.net,ARRAffinity=13a49b3774942b0d8c61aa0da90e64c2501347e37123afb59f0053454fb44bb7;Path=/;Domain=default-web-southcentraluse58f886843cd4c06bbe282a04c169cd3.azurewebsites.net",
            "server": "Microsoft-IIS/8.0",
            "wwW-Authenticate": "Basic realm=\"Service\"",
            "x-AspNet-Version": "4.0.30319",
            "x-Powered-By": "ASP.NET,ASP.NET",
            "date": "Thu, 14 May 2015 16:27:26 GMT"
        },
        "body": {
            "status": 401,
            "source": "https://microsoftonedriveconnector7c85734588ae4a88b109144607c4552b.azurewebsites.net/file//Documents/dlp example 2.xlsx?overwrite=True",
            "message": "An error has occurred."
        }
    }

    I tried it with and without the Base64 encoding.  I noticed there is an extra / in the path on the source.  I also wonder if the space in the document filename is an issue?

    Thanks,

    Corey


    Corey Roth - SharePoint Server MVP blog: www.dotnetmafia.com twitter: @coreyroth | SP2 Apps

    Thursday, May 14, 2015 5:18 PM