Reputation: 3258
What is the best way to transfer my files to the Azure
virtual machine? I tried below options, but no luck
Option 1: AzCopy
I am aware of AzCopy
which helps to copy the files to a storage account, however, my requirement is to copy the file from my local machine (on-premise network share) to cloud Azure Virtual Machine
disk.My Virtual Machine's are using managed disks. Hence I do not think I can use AzCopy
Option 2: Azure File Share
I also thought of using File Share
option, but I am sure if it's right choice.
Basically I want to automate the copy process to target VM's.
Advice appreciated.
Upvotes: 3
Views: 20717
Reputation: 1
Since this question shows up for general usage of uploading files to Azure, not just for OP's on-prem special use case, I found that just using scp is much easier than using Google Drive or Azure File Share.
scp -i path/to/your/sshkey.pem path/to/your/localfile username@[YOUR_VM_PUBLIC_IP]:/destination/path/on/vm
For example:
scp -i ~/sshkey.pem ./server-binary-release.zip [email protected]:/home/azureuser/
Upvotes: 0
Reputation: 307
The best way to transfer files on Vm is using google drive:
upload your files on google drive
Get id from shareable Link
login to your VM
finally run this command
wget --no-check-certificate 'https://drive.google.com/uc?export=download&id=this_is_the_id_of_files_on_drive' -O new_Name_any.rar
Thats it
Upvotes: 2
Reputation: 612
The best way would be to create a file share between two machines.
First, you need to Allow Inbound connection to your Azure VM from on-premises. Perhaps this is could be the case in your way, please go through this article, for enabling correct port if you don't want to expose everything.
Second, you should create a network drive.
Last, create a scheduler task with XCopy or PowerShell.
You can even create a Hybrid Worker in Automation Account for running your job from the Cloud to on-premises.
Upvotes: 2
Reputation: 6102
Sounds like Azure File Sync
is what you are after. It's a service that allows you to install agents on a VM that'll take care of syncing up with an Azure File Share. The following documentation gives a good overview on how to set it up and its capabilities.
Upvotes: 3
Reputation: 21
You can use Azure File share to map a permanent drive into your local machine. You will need to make sure that SMB port isn't blocked within your firewall.
You can use the following Azure powershell command:
New-PSDrive -Name "S" -Root "<Your_StorageAccountName>.file.core.windows.net/" -Persist -PSProvider "Registry"
Upvotes: 1