0
votes

We have a requirement to run a Linux shell script to delete the file in Azure Data Lake Gen2 once it is processed. Can someone help to perform this? Basically, we need to authenticate and delete the file from Azure Data Lake Gen2 through shell script. Please guide. Thanks.

1

1 Answers

0
votes

You could use Azure CLI to do that, make sure you have installed the Azure CLI in Linux, use az login to login your user account or login with a service principal.

Then delete the file with the command az storage fs file delete.

Sample:

az storage fs file delete -p my-directory/my-file.txt -f my-file-system  --account-name mystorageaccount --auth-mode login

For more details, follow this - Use Azure CLI to manage directories, files, and ACLs in Azure Data Lake Storage Gen2