Transfer files to Azure Blob Storage

60 Views Asked by At

I'am looking for.. what is the best option to trasnfer files from my VM's (Onpremises) to Azure Blob Storage and if this option can be automate.

I'am a new Azure's user, I'am starting to learn about Azure.

Thank you!!!!!!!!!!

1

There are 1 best solutions below

0
Venkat V On

I'am looking for.. what is the best option to trasnfer files from my VM's (Onpremises) to Azure Blob Storage and if this option can be automate.

To transfer files from an on-premises location to an Azure Storage account, you can execute the PowerShell script using Task Scheduler by following the steps.

  1. Create a Storage account with blob anonymous enabled.

enter image description here

  1. Enable connections from all networks to the on-premises network.

enter image description here

  1. Create a new container in your storage account and modify the container's access policy to enable anonymous access.

enter image description here

  1. Navigate to the container and generate the SAS token with the necessary permissions, then copy the blob SAS URL.

enter image description here

"C:\Venkat\Azure_AD" : Local Path
  1. Here is the script to copy files from an on-premises location to an Azure Storage account.
 azcopy cp "C:\Venkat\Azure_AD"  "https://venkatstoragetest.blob.core.windows.net/venkat?sp=racwdli&st=2024-03-25T06:36:57Z&se=2024-03-25T14:36:57Z&sv=2022-11-02&sr=c&sig=DElfhf6x7YRdabM5SahaS%2BvD1qW0L%2FcVSGIJDJxo8fk%3D"  --recursive
  1. To automate file copying to an Azure Storage account, you can utilize the Task Scheduler on an on-premises machine. For configuration , refer to the link by Jeff Melnick on setting up the Task Scheduler.

Output:

enter image description here

After executing the script, the folder was successfully transferred from the on-premises to Azure Blob Storage.

enter image description here