none
ADLS Gen 2 REST API's help

    Question

  • Hi all,



    I am trying to use the Path create adls gen2 rest api to rename a file and also a directory. I am being returned an error saying I am missing a required http header. Headers I have included are "x-ms-rename-source", "x-ms-date" and "x-ms-version". I am assuming this is an easy fix but I'm not sure from the documentation (https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/create) exactly what other header is required?

    Any help is greatly appreciated!


    Tuesday, March 19, 2019 2:15 PM

All replies

  • Hi Ewan,

    I think you are missing "Content-length" and "Authorization" headers.

    For example :

    curl -i -X PUT -H "x-ms-version: 2018-11-09" -H "content-length: 0" -H "Authorization: Bearer $ACCESS_TOKEN" "https://$STORAGE_ACCOUNT_NAME.dfs.core.windows.net/mydata?resource=filesystem"

    Hope this helps.


    MSDN

    Wednesday, March 20, 2019 9:23 AM
    Moderator