is there any simple way to copy data within Azure ADLS gen2 using Azure CLI, Rest API or Python?
Azure ADLS gen2 API documentation is very limited for now... https://docs.microsoft.com/en-us/rest/api/storageservices/data-lake-storage-gen2
is there any simple way to copy data within Azure ADLS gen2 using Azure CLI, Rest API or Python?
Azure ADLS gen2 API documentation is very limited for now... https://docs.microsoft.com/en-us/rest/api/storageservices/data-lake-storage-gen2
According to my research, we can use Azure CLI or python to move a directory or move a file. For more details, please refer to the document.
For example
az extension add -n storage-preview
# move directory
az storage blob directory move -c my-file-system -d my-new-directory -s my-directory --account-name mystorageaccount
# move a file
az storage blob move -c my-file-system -d my-file-new.txt -s my-file.txt --account-name mystorageaccount
Python
try:
file_system_client = service_client.get_file_system_client(file_system="my-file-system")
directory_client = file_system_client.get_directory_client("my-directory")
new_dir_name = "my-directory-renamed"
directory_client.rename_directory(rename_destination=directory_client.file_system_name + '/' + new_dir_name)
except Exception as e:
print(e)