0

I want to upload the local files to azure-ml notebook tab.

In azure-ml GUI we have options to upload files and folders, can we do the same thing using python sdk!

Azure-ml GUI

1 Answers1

0

After reproducing from my end, I could able to get this done using upload_files method. Below is complete code that worked for me.

from azureml.core import Workspace

ws = Workspace(wsName='<YOUR_WORKSPACE_NAME>',
               subId='<YOUR_SUBSCRIPTION_ID>',
               rg='<YOUR_RESOURCE_GROUP_NAME>')

ds = ws.get_default_datastore()

print(ds)

ds.upload_files(files=["abc.txt"], target_path='\\', overwrite=True)

Results:

enter image description here

enter image description here

SwethaKandikonda
  • 7,513
  • 2
  • 4
  • 18
  • My question is not about uploading local files to datastore in azureml (which is possible, and I tried it before), if you see In Authoring tab we have a notebook section, if you click on that you will the see few options (https://i.stack.imgur.com/8ozPK.png) which I mentioned in my question. Want to know that is it possible to upload local files to notebook section using python! – Kumar Reddy Jun 06 '23 at 19:33