'Compare files uploaded to Azure Blob with on-prem
I am currently uploading files to an Azure blob via a scheduled Powershell script. Is there any way that I can do a check to make sure that the files have uploaded successfully? I am writing to a log file, but I want to delete the files that have uploaded from my on-prem storage after the upload.
The files have unique names. Is there any way I can do a compare > create file on-prem after successful compare? I'd then be able to create a script that would only delete the files if this file existed.
Thanks.
Solution 1:[1]
After upload of on-prem files with Azure Storage blob, you can list the blobs in the Azure Storage account and compare the file names with the On-prem files
If the file exists, you can delete the on-prem file
To list the blobs in an Azure Storage container, you can use the below command:
az storage blob list -c containerName --account-name storageAccountName
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | RamaraoAdapa-MT |
