简体   繁体   中英

Azure Data Lake Gen2 - Delete file using Linux script file and Automation

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM