0

I do the following: I copy data from OneDrive to Datalake. For this I have built HTTP linked service, HTTP dataset and pipelines in ADF. Linked service and dataset also for Datalake.

Copy works fine.

But I also want the data in OneDrive to be deleted automatically after copying.

Is there a way to delete the data in Onedrive?

gio.s
  • 51
  • 7

1 Answers1

0

Although there is a Delete activity available now in ADF it has a limited scope. See Supported data stores

So if you are able to get the files from OneDrive using HTTP service, I would suggest you try this REST API doc Delete a DriveItem and use REST linked service to delete corresponding files after copy activity is successful.

With this you can Delete a DriveItem by using its ID or path.

KarthikBhyresh-MT
  • 4,560
  • 2
  • 5
  • 12
  • From my repro and other docs getting onedrive files using adf is not supported through any explicit connectors. You would have to use REST API and web activity to try make a download request. See, [Download the contents of a DriveItem](https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_get_content?view=odsp-graph-online) – KarthikBhyresh-MT Nov 26 '21 at 13:29
  • Or use a function app with python code as an example [here](https://stackoverflow.com/a/58259492/15969417) and for [Downloading a file in another format](https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_get_content_format?view=odsp-graph-online) – KarthikBhyresh-MT Nov 26 '21 at 13:33
  • Haven't tried yet though, what error do you see ? try checking this https://learn.microsoft.com/en-us/onedrive/developer/rest-api/concepts/errors?view=odsp-graph-online – KarthikBhyresh-MT Dec 01 '21 at 04:02