Hi Ranit Chatterjee,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
Azure CLI does not have a built-in command specifically designed for copying files directly between a local machine and a remote Azure Virtual Machine (VM) in the same way that scp
(Secure Copy Protocol) works.
You can try this as when you connect to a Windows VM using Remote Desktop Protocol (RDP), you can enable the sharing of local drives. This allows you to access files from your local machine directly in the VM.
For Linux VMs, you can use scp
to securely copy files to and from your local machine. The scp
command works similarly to ssh
but is specifically designed for file transfer. https://learn.microsoft.com/en-us/azure/virtual-machines/copy-files-to-vm-using-scp
You can use the azcopy
command to copy files between a local machine and a remote Azure VM. azcopy
is a command-line utility that allows you to copy files to and from Azure Blob, File, and Data Lake Storage. https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10?tabs=dnf#installing-azcopy, https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-files
You can upload files to Azure Blob Storage from your local machine and then download them to your VM. This is useful for larger files or when working with many files.
If you have any further queries, please do let us know.