I have created an Ubuntu VM on Azure and I want to download a file stored in one of the directories of this VM.
I want to do this using Powershell.
I have created an Ubuntu VM on Azure and I want to download a file stored in one of the directories of this VM.
I want to do this using Powershell.
If you just want to grab a couple files, then you can use pscp. You can download pscp from here: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Usage:
pscp.exe -r -pw 'password' 'local-path' [email protected]:/path If you want to do this more than once from multiple clients you can just serve the files with a web server, e.g. Apache. Then you can just use Invoke-WebRequest to download the files via HTTP.
Virtual machines in azure are completely locked down. Do you just need to download the file once? I am trying to understand your requirement of using PowerShell.
Here are a few options: 1. manually ftp the file from ubuntu to a FTP server and download it from there. 2. second option for you is to use Azure command line tools that run on ubuntu. you should install Azure CLI https://github.com/Azure/azure-xplat-cli
There are instructions for Ubuntu distributions. One Azure CLI has been isntalled you can use the azure storage command line options to tranfer the file to an azure storage container.
After the files in an azure container you can use PowerShell to download it. You can also use Azcopy tool to down the file from the container.
https://azure.microsoft.com/en-us/documentation/articles/storage-use-azcopy/
Let me know if this meets your needs.