{"id":432,"date":"2024-04-21T16:58:55","date_gmt":"2024-04-21T14:58:55","guid":{"rendered":"https:\/\/blog.bardalen.no\/?p=432"},"modified":"2024-04-23T10:47:45","modified_gmt":"2024-04-23T08:47:45","slug":"download-azure-vhds-without-your-computer","status":"publish","type":"post","link":"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/","title":{"rendered":"Download Azure VHDs without your computer!"},"content":{"rendered":"\n<p>But how? On my mobile device? No! In a container, using Docker, Linux, Tmux and AzCopy. Come on, I&#8217;ll show you how I do it!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The problem<\/h2>\n\n\n\n<p>Downloading VHDs from Azure can take a lot of time. Especially if they are several hundred gigabytes (or Terabytes!) in size. VHD stands for Virtual Hard Drive, and is essentially a hard disk for virtual machines in the cloud. Why you need to download them may vary, but legal reasons may be one. And where do you store the files temporarily? Do you have 2-3TB of space available on your laptop? I think not&#8230;<\/p>\n\n\n\n<p>Microsoft has a solution called Databox which will let you get a copy large amounts of data both to and from Azure Datacenters. In some cases this can be a good solution. Egress data from Azure also cost money, so it&#8217;s something to put into the equation here. Read more on Databox: <a href=\"https:\/\/azure.microsoft.com\/en-gb\/products\/databox\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/azure.microsoft.com\/en-gb\/products\/databox<\/a><\/p>\n\n\n\n<p>So what I do, I use a local NAS to temporary store a VHD file. But this still means that my computer is occupied with this task for hours and taking up precious system resources for that one thing. Hmm&#8230; how can I get this task running independently and still have control over the whole download from where I want?<\/p>\n\n\n\n<p>First I tried to use a tool called <a href=\"https:\/\/azure.microsoft.com\/en-us\/products\/storage\/storage-explorer\">Storage Explorer<\/a>. This made me able to log in and browse the VHDs I wanted to download, and I did get to download some disks. The smaller ones. When I tried to download something that took more than an hour, it failed. Why? Because the SAS-token expires by default after 3600 seconds. And there&#8217;s no way to adjust this value in Storage Explorer. Damn it!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The solution<\/h2>\n\n\n\n<p>I know I can set a custom value for the expiration via PowerShell. And I could use my computer to download the file and all would be well. But then my computer would need to be plugged in and downloading for several hours. I turned to my trusty homelab and began to test some techologies including:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Proxmox<\/li>\n\n\n\n<li>Linux<\/li>\n\n\n\n<li>Tmux<\/li>\n\n\n\n<li>Docker<\/li>\n\n\n\n<li>AzCopy<\/li>\n\n\n\n<li>PowerShell<\/li>\n\n\n\n<li>TrueNAS with NFS<\/li>\n<\/ul>\n\n\n\n<p>Quite an intricate setup just to download some files, huh? Yeah, but it solves the problem of both storing the files and freeing up my computer at the same time.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The actual setup<\/h2>\n\n\n\n<p>In my homelab I have a host running Proxmox for all of my local workloads. This runs several VMs (Virtual Machines) which again runs different OSes for different purposes. One of them is a Ubuntu Linux VM running several Docker containers. This is not a tutorial on either Linux, Proxmox or Containers. Only a description on how I use them. If you need to learn what a Docker is, please do read up on it and maybe continue to read this article after that?<\/p>\n\n\n\n<p>So why am I rambling on about Linux when Azure and AzCopy are both Microsoft technologies. As it turns out, Microsoft loves Linux. So much they&#8217;ve actually made a version of AzCopy for Linux! How neat! And the best part: I can run it in Docker! (Links to all the resources at the bottom of this article).<\/p>\n\n\n\n<p>Therefore I mounted up a NFS share on that Linux VM to my NAS running TrueNAS. Made sure I could both read and write to that share. Then I used PowerShell to create a SAS token for that disk in Azure so it could be exported. <strong>Please note that exporting a disk in Azure makes it unusable until either you release it from export manually or the SAS-token expires by itself!<\/strong> <\/p>\n\n\n\n<p>Next was to run the Docker and hope for the best. And, it worked! It ran as it should, downloading the VHD to NAS. And via Tmux I could leave the session, leave the house with my laptop and return some time later and joining the same session and confirming it has finished. Good times.<\/p>\n\n\n\n<p>Wanna know how you can do it too? Sure, I&#8217;ll show you<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: TrueNAS<\/h2>\n\n\n\n<p>You are not limited to TrueNAS, of cource. But this is my example and you should use what you want.<\/p>\n\n\n\n<p>First i created a NFS share on my NAS:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"452\" height=\"660\" src=\"https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-10.04.27.png\" alt=\"\" class=\"wp-image-437\" style=\"width:190px;height:auto\" srcset=\"https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-10.04.27.png 452w, https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-10.04.27-205x300.png 205w, https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-10.04.27-185x270.png 185w\" sizes=\"auto, (max-width: 452px) 100vw, 452px\" \/><\/figure><\/div>\n\n\n<p>In the file structure on your NAS, choose a sufficient placement:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"585\" src=\"https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-10.05.26-1024x585.png\" alt=\"\" class=\"wp-image-438\" style=\"width:487px;height:auto\" srcset=\"https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-10.05.26-1024x585.png 1024w, https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-10.05.26-300x171.png 300w, https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-10.05.26-768x439.png 768w, https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-10.05.26-473x270.png 473w, https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-10.05.26.png 1310w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>Make sure you set some user rights on this share. And it&#8217;s nice to actually limit what machines can acces it, so I set the IP to my VM to be the only machine allowed to communicate with this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"380\" src=\"https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-10.06.19-1024x380.png\" alt=\"\" class=\"wp-image-439\" srcset=\"https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-10.06.19-1024x380.png 1024w, https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-10.06.19-300x111.png 300w, https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-10.06.19-768x285.png 768w, https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-10.06.19-1536x570.png 1536w, https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-10.06.19-604x224.png 604w, https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-10.06.19.png 1904w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Click &laquo;Add&raquo; in the top right corner and it should be set. Cool, now you have to copy the path as we need in the next step when we are mounting NFS on Linux:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"484\" height=\"546\" src=\"https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-10.06.56.png\" alt=\"\" class=\"wp-image-440\" style=\"width:215px;height:auto\" srcset=\"https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-10.06.56.png 484w, https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-10.06.56-266x300.png 266w, https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-10.06.56-239x270.png 239w\" sizes=\"auto, (max-width: 484px) 100vw, 484px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Step 2: Prepare your Linux environment<\/h2>\n\n\n\n<p>Now for some nerdy Linux stuff in the command line! Log into your box and make sure you have NFS-support and Tmux installed:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#33384d;color:#aaafcf\">Bash<\/span><span role=\"button\" tabindex=\"0\" data-code=\"sudo apt update\nsudo apt install nfs-common\nsudo apt install tmux\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-palenight\" style=\"background-color: #292D3E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #FFCB6B\">sudo<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">apt<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">update<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">sudo<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">apt<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">install<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">nfs-common<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">sudo<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">apt<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">install<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">tmux<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>This will make sure both are in place. After that, we want to make a folder to mount our NFS share to. I used this method:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#33384d;color:#aaafcf\">Bash<\/span><span role=\"button\" tabindex=\"0\" data-code=\"sudo mkdir \/mnt\/nfs_client\nsudo mount -o hard,rsize=1048576,wsize=1048576,timeo=600 10.0.0.204:\/mnt\/Pool4TBdisks\/NAS \/mnt\/nfs_client\/\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-palenight\" style=\"background-color: #292D3E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #FFCB6B\">sudo<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">mkdir<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">\/mnt\/nfs_client<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">sudo<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">mount<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">-o<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">hard,rsize=<\/span><span style=\"color: #F78C6C\">1048576<\/span><span style=\"color: #C3E88D\">,wsize=<\/span><span style=\"color: #F78C6C\">1048576<\/span><span style=\"color: #C3E88D\">,timeo=<\/span><span style=\"color: #F78C6C\">600<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #F78C6C\">10.0<\/span><span style=\"color: #C3E88D\">.0.204:\/mnt\/Pool4TBdisks\/NAS<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">\/mnt\/nfs_client\/<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>This first creates a folder under \/mnt caled nfs_client. Then it mounts the \/mnt\/Pool4TBdisks\/NAS-share of my NAS, which is on IP 10.0.0.204 to that folder.<\/p>\n\n\n\n<p>Did it Work? Test it!:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#33384d;color:#aaafcf\">Bash<\/span><span role=\"button\" tabindex=\"0\" data-code=\"cd \/mnt\/nfs_client\nsudo mkdir Testfolder\nls -la\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-palenight\" style=\"background-color: #292D3E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #82AAFF\">cd<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">\/mnt\/nfs_client<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">sudo<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">mkdir<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">Testfolder<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">ls<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">-la<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>This should output no errors, and show you that a folder with name &laquo;Testfolder&raquo; exists on the NAS. Good! Now we can move on over to Azure and prepare what we need to download!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Prepare Azure<\/h2>\n\n\n\n<p>We can use PowerShell for this. Modules needed for this guide:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Az.Accounts<\/li>\n\n\n\n<li>Az.Compute<\/li>\n<\/ul>\n\n\n\n<p>You <em>could<\/em> also browse the Portal and find the names for the resource group and the disks, but I will show you how to PS it! Connect to Azure:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#33384d;color:#aaafcf\">PowerShell<\/span><span role=\"button\" tabindex=\"0\" data-code=\"Connect-AzAccount\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-palenight\" style=\"background-color: #292D3E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #82AAFF\">Connect-AzAccount<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Remember to authenticate with a user that has the right permissions to the subs and resources you need. If you have more than one Subscription in your tenant, you will get a notification for that. It will use the first one you have access to by default.<\/p>\n\n\n\n<p>In case you have more than one subscription available, get a list over the subscriptions:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#33384d;color:#aaafcf\">PowerShell<\/span><span role=\"button\" tabindex=\"0\" data-code=\"Get-AzSubscription\n\nName                               Id                      TenantId                        State\n----                               --                      --------                        -----\nSubscription1                      yyyy-yyyy-yyyy-yyyy     aaaa-aaaa-aaaa-aaaa             Enabled\nSubscription2                      xxxx-xxxx-xxxx-xxxx     aaaa-aaaa-aaaa-aaaa             Enabled\nSubscription3                      zzzz-zzzz-zzzz-zzzz     bbbb-bbbb-bbbb-bbbb             Enabled\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-palenight\" style=\"background-color: #292D3E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #82AAFF\">Get-AzSubscription<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #BABED8\">Name                               Id                      TenantId                        State<\/span><\/span>\n<span class=\"line\"><span style=\"color: #89DDFF\">----<\/span><span style=\"color: #BABED8\">                               <\/span><span style=\"color: #89DDFF\">--<\/span><span style=\"color: #BABED8\">                      <\/span><span style=\"color: #89DDFF\">--------<\/span><span style=\"color: #BABED8\">                        <\/span><span style=\"color: #89DDFF\">-----<\/span><\/span>\n<span class=\"line\"><span style=\"color: #BABED8\">Subscription1                      yyyy<\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">yyyy<\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">yyyy<\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">yyyy     aaaa<\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">aaaa<\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">aaaa<\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">aaaa             Enabled<\/span><\/span>\n<span class=\"line\"><span style=\"color: #BABED8\">Subscription2                      xxxx<\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">xxxx<\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">xxxx<\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">xxxx     aaaa<\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">aaaa<\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">aaaa<\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">aaaa             Enabled<\/span><\/span>\n<span class=\"line\"><span style=\"color: #BABED8\">Subscription3                      zzzz<\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">zzzz<\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">zzzz<\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">zzzz     bbbb<\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">bbbb<\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">bbbb<\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">bbbb             Enabled<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>If you need to switch subscription, you can do it like this:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#33384d;color:#aaafcf\">PowerShell<\/span><span role=\"button\" tabindex=\"0\" data-code=\"Set-AzContext -Subscription &quot;xxxx-xxxx-xxxx-xxxx&quot;\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-palenight\" style=\"background-color: #292D3E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #82AAFF\">Set-AzContext<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">Subscription <\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">xxxx-xxxx-xxxx-xxxx<\/span><span style=\"color: #89DDFF\">&quot;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Now you want to list out all the disks you have access to. You want to know their name, location, state and size maybe?<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#33384d;color:#aaafcf\">PowerShell<\/span><span role=\"button\" tabindex=\"0\" data-code=\"Get-AzDisk | ft Name, ResourceGroupName, DiskSizeGB, Location, DiskState\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-palenight\" style=\"background-color: #292D3E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #82AAFF\">Get-AzDisk<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">|<\/span><span style=\"color: #BABED8\"> ft Name<\/span><span style=\"color: #89DDFF\">,<\/span><span style=\"color: #BABED8\"> ResourceGroupName<\/span><span style=\"color: #89DDFF\">,<\/span><span style=\"color: #BABED8\"> DiskSizeGB<\/span><span style=\"color: #89DDFF\">,<\/span><span style=\"color: #BABED8\"> Location<\/span><span style=\"color: #89DDFF\">,<\/span><span style=\"color: #BABED8\"> DiskState<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>This gives you a list over disks with their names, Resource Group, their physical location, sizes and even what state it&#8217;s in. You cannot download a attached disk (with state attached), so you would need to stop that corresponding VM before you can download.<\/p>\n\n\n\n<p>To list out all VMs, their Resource Group and their state:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#33384d;color:#aaafcf\">PowerShell<\/span><span role=\"button\" tabindex=\"0\" data-code=\"Get-Azvm -Status | ft name, ResourceGroupName, PowerState\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-palenight\" style=\"background-color: #292D3E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #82AAFF\">Get-Azvm<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">Status <\/span><span style=\"color: #89DDFF\">|<\/span><span style=\"color: #BABED8\"> ft name<\/span><span style=\"color: #89DDFF\">,<\/span><span style=\"color: #BABED8\"> ResourceGroupName<\/span><span style=\"color: #89DDFF\">,<\/span><span style=\"color: #BABED8\"> PowerState<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>To get all disks of a VM, run this:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#33384d;color:#aaafcf\">PowerShell<\/span><span role=\"button\" tabindex=\"0\" data-code=\"Get-Azvm -ResourceGroupName &quot;resourceGroup&quot; -Name &quot;vm-name&quot; -Status | ft name, disks\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-palenight\" style=\"background-color: #292D3E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #82AAFF\">Get-Azvm<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">ResourceGroupName <\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">resourceGroup<\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">Name <\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">vm-name<\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">Status <\/span><span style=\"color: #89DDFF\">|<\/span><span style=\"color: #BABED8\"> ft name<\/span><span style=\"color: #89DDFF\">,<\/span><span style=\"color: #BABED8\"> disks<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>This will then print out the name of the VM and the names for all its disks. So, when you have this information you need to create the export of the disks. If your VM is still running, stop it:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#33384d;color:#aaafcf\">PowerShell<\/span><span role=\"button\" tabindex=\"0\" data-code=\"Stop-AzVM -ResourceGroupName &quot;resourceGroup&quot; -Name &quot;vm-name&quot;\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-palenight\" style=\"background-color: #292D3E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #82AAFF\">Stop-AzVM<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">ResourceGroupName <\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">resourceGroup<\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">Name <\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">vm-name<\/span><span style=\"color: #89DDFF\">&quot;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Now it&#8217;s ready to be exported. To do so, use this command:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#33384d;color:#aaafcf\">PowerShell<\/span><span role=\"button\" tabindex=\"0\" data-code=\"Grant-AzDiskAccess -ResourceGroupName &quot;resourceGroup&quot; -DiskName &quot;azuredisk&quot; -DurationInSecond 864000 -Access 'Read'\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-palenight\" style=\"background-color: #292D3E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #82AAFF\">Grant-AzDiskAccess<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">ResourceGroupName <\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">resourceGroup<\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">DiskName <\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">azuredisk<\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">DurationInSecond <\/span><span style=\"color: #F78C6C\">864000<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">Access <\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #C3E88D\">Read<\/span><span style=\"color: #89DDFF\">&#39;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Congratulations! You have now given yourself access to that disk, and created an &laquo;AccessSAS&raquo; to use in the next step. So copy it to somewhere safe and fire up that container. Just make sure it does not contain any strange line shifts or whitespaces. Trust me, it breaks everything!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4a: Run the Docker container from Tmux<\/h2>\n\n\n\n<p>Now you have everything you need to start the download. SSH in to your Linux VM and use Tmux to handle the session:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#33384d;color:#aaafcf\">Bash<\/span><span role=\"button\" tabindex=\"0\" data-code=\"tmux new -n azuredisk\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-palenight\" style=\"background-color: #292D3E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #FFCB6B\">tmux<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">new<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">-n<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">azuredisk<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>This runs Tmux with a new session called &#8216;azuredisk&#8217;. The &#8216;-n&#8217; argument is the name of the session<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"636\" src=\"https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-12.31.20-1024x636.png\" alt=\"\" class=\"wp-image-447\" srcset=\"https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-12.31.20-1024x636.png 1024w, https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-12.31.20-300x186.png 300w, https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-12.31.20-768x477.png 768w, https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-12.31.20-1536x953.png 1536w, https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-12.31.20-2048x1271.png 2048w, https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-12.31.20-435x270.png 435w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Start the Docker image by running a command in this format:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#33384d;color:#aaafcf\">Bash<\/span><span role=\"button\" tabindex=\"0\" data-code=\"sudo docker run --rm -it -v \/mnt\/nfs_client:\/mnt\/nfs_client peterdavehello\/azcopy:10.11.0 azcopy copy &quot;Your_SAS_URI&quot; &quot;\/mnt\/nfs_client\/yourvmdisk.vhd&quot;\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-palenight\" style=\"background-color: #292D3E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #FFCB6B\">sudo<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">docker<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">run<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">--rm<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">-it<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">-v<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">\/mnt\/nfs_client:\/mnt\/nfs_client<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">peterdavehello\/azcopy:10.11.0<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">azcopy<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">copy<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">Your_SAS_URI<\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">\/mnt\/nfs_client\/yourvmdisk.vhd<\/span><span style=\"color: #89DDFF\">&quot;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>It then should pull the Docker image and soon run AzCopy inside of that. This is an example of AzCopy in action running in Docker:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"634\" src=\"https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-16.44.30-1024x634.png\" alt=\"\" class=\"wp-image-461\" srcset=\"https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-16.44.30-1024x634.png 1024w, https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-16.44.30-300x186.png 300w, https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-16.44.30-768x475.png 768w, https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-16.44.30-1536x951.png 1536w, https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-16.44.30-2048x1268.png 2048w, https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Skjermbilde-2024-04-21-kl.-16.44.30-436x270.png 436w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Let me try to explain the Docker syntax I&#8217;m using here:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Docker run<\/strong> runs the docker image directly without any compose-file<\/li>\n\n\n\n<li><strong>&#8211;rm<\/strong> removes the docker instance after it has run<\/li>\n\n\n\n<li><strong>-it<\/strong> runs the docker in interactive mode. This is the only way you can actually see what&#8217;s going on. While It will work with &#8216;-d&#8217; for detached mode and exit when it finishes, you are left in the dark on how long remains and the overall status<\/li>\n\n\n\n<li><strong>-v<\/strong> runst Docker in verbose mode<\/li>\n\n\n\n<li><strong>\/mnt\/nfs_client:\/mnt\/nfs_client<\/strong> defines what root directory you work in<\/li>\n\n\n\n<li><strong>peterdavehello\/azcopy:10.11.0<\/strong> points to the right docker image and specifies what version you want to use<\/li>\n\n\n\n<li><strong>azcopy copy<\/strong> actually fires up azcopy and the copy-parameter tells it to do a copy. Here you can use AzCopy as you like. Just refer to the documentation for all the other options so you can see what more you can do!<\/li>\n\n\n\n<li><strong>Your_SAS_URI<\/strong>: This is the AccessSAS you copied from PowerShell earlier<\/li>\n\n\n\n<li><strong>\/mnt\/nfs_client\/yourvmdisk.vhd<\/strong> is the actual destination. Be sure to name it something meaningful, with the .vhd-extension. If you don&#8217;t specify the file name it just defaults to &#8216;abcd&#8217;, and nobody wants that!<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4b: Leaving Tmux and joining the session later:<\/h2>\n\n\n\n<p>This will potentially run for quite som time now, and it will be a good time to try out Tmux. To detach from a session just press Ctrl + B and then press D (D &#8211; without CTRL pressed). You will now return til your shell while Tmux are still handling your session in the background. You can now disconnect from SSH and all will be fine.<\/p>\n\n\n\n<p>So, you had your lunch or whatever and want to check the status on your download. How do you do it? Just SSH in to your Linux box again and run this command to attach your last session:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#33384d;color:#aaafcf\">Bash<\/span><span role=\"button\" tabindex=\"0\" data-code=\"tmux attach\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-palenight\" style=\"background-color: #292D3E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #FFCB6B\">tmux<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">attach<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Want to specify which session you want to attach?<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#33384d;color:#aaafcf\">Bash<\/span><span role=\"button\" tabindex=\"0\" data-code=\"tmux attach -t sessionname\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-palenight\" style=\"background-color: #292D3E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #FFCB6B\">tmux<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">attach<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">-t<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">sessionname<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Change out &#8216;sessionname&#8217; with your real session name. Not sure what you called it? Or you have started more than one session?<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#33384d;color:#aaafcf\">Bash<\/span><span role=\"button\" tabindex=\"0\" data-code=\"tmux list-sessions\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-palenight\" style=\"background-color: #292D3E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #FFCB6B\">tmux<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">list-sessions<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>For more tips on how to use Tmux, go to: <a href=\"https:\/\/tmuxcheatsheet.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/tmuxcheatsheet.com\/<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5: Cleanup<\/h2>\n\n\n\n<p>After you have downloaded your files you may have to clean up a couple of things. Perhaps exit the Tmux session?<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#33384d;color:#aaafcf\">Bash<\/span><span role=\"button\" tabindex=\"0\" data-code=\"tmux kill-session -t sessionname\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-palenight\" style=\"background-color: #292D3E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #FFCB6B\">tmux<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">kill-session<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">-t<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">sessionname<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>And perhaps you want to cancel the &laquo;AccessSAS&raquo; so you can resume your machine in Azure?<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#33384d;color:#aaafcf\">PowerShell<\/span><span role=\"button\" tabindex=\"0\" data-code=\"Revoke-AzDiskAccess -ResourceGroupName &quot;resourceGroup&quot; -DiskName &quot;azuredisk&quot;\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-palenight\" style=\"background-color: #292D3E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #82AAFF\">Revoke-AzDiskAccess<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">ResourceGroupName <\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">resourceGroup<\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">DiskName <\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">azuredisk<\/span><span style=\"color: #89DDFF\">&quot;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>And wait&#8230; It can take up to a minute to revoke that access. You will be prompted when it&#8217;s complete.<\/p>\n\n\n\n<p>Finally, start that VM again:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#33384d;color:#aaafcf\">PowerShell<\/span><span role=\"button\" tabindex=\"0\" data-code=\"Start-AzVm -ResourceGroupName &quot;resourceGroup&quot; -Name &quot;vm-name&quot;\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-palenight\" style=\"background-color: #292D3E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #82AAFF\">Start-AzVm<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">ResourceGroupName <\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">resourceGroup<\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">-<\/span><span style=\"color: #BABED8\">Name <\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">vm-name<\/span><span style=\"color: #89DDFF\">&quot;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion?<\/h2>\n\n\n\n<p>In my case, this solves a problem and I can utilize my homelab even more! Love it when I can leverage several layers of technology to solve some troubles and at the same time make my life easier.<\/p>\n\n\n\n<p>Do you have a homelab? Do you have solved this in another way? Please write to me about it. Would like to learn of more ways to use my homelab.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Links<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Tmux Cheatsheet: <a href=\"https:\/\/tmuxcheatsheet.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/tmuxcheatsheet.com\/<\/a><\/li>\n\n\n\n<li>Proxmox: <a href=\"https:\/\/proxmox.com\/en\/about\/company\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/proxmox.com\/en\/about\/company<\/a><\/li>\n\n\n\n<li>Ubuntu Linux: <a href=\"https:\/\/ubuntu.com\/download\/server\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/ubuntu.com\/download\/server<\/a><\/li>\n\n\n\n<li>Tmux: <a href=\"https:\/\/github.com\/tmux\/tmux\/wiki\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/tmux\/tmux\/wiki<\/a><\/li>\n\n\n\n<li>Docker: <a href=\"https:\/\/www.docker.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.docker.com\/<\/a><\/li>\n\n\n\n<li>AzCopy: <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/storage\/common\/storage-use-azcopy-v10#download-azcopy\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/learn.microsoft.com\/en-us\/azure\/storage\/common\/storage-use-azcopy-v10#download-azcopy<\/a><\/li>\n\n\n\n<li>AzCopy in Docker: <a href=\"https:\/\/github.com\/PeterDaveHello\/docker-azcopy\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/PeterDaveHello\/docker-azcopy<\/a><\/li>\n\n\n\n<li>TrueN<a href=\"https:\/\/www.truenas.com\/truenas-core\/\" target=\"_blank\" rel=\"noreferrer noopener\">AS: https:\/\/www.truenas.com\/truenas-core\/<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>But how? On my mobile device? No! In a container, using Docker, Linux, Tmux and AzCopy. Come on, I&#8217;ll show you how I do it! The problem Downloading VHDs from Azure can take a lot of time. Especially if they are several hundred gigabytes (or Terabytes!) in size. VHD stands for Virtual Hard Drive, and is essentially a hard disk for virtual machines in the cloud. Why you need to download them may vary, but legal reasons may be one&#8230;.<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/\">Les mer<span class=\"screen-reader-text\"> Les mer<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":464,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,46,56,57,47,64,25],"tags":[73,48,71,7,5,72],"class_list":["post-432","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-annet","category-azure","category-engelsk","category-english","category-microsoft","category-powershell","category-tips","tag-azcopy","tag-azure","tag-linux","tag-microsoft","tag-powershell","tag-vhd"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Download Azure VHDs without your computer! - Blog.bardalen.no<\/title>\n<meta name=\"description\" content=\"But how? On my mobile device? No! In a container, using Docker, Linux, Tmux and AzCopy. Come on, I&#039;ll show you how I do it!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/\" \/>\n<meta property=\"og:locale\" content=\"nb_NO\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Download Azure VHDs without your computer! - Blog.bardalen.no\" \/>\n<meta property=\"og:description\" content=\"But how? On my mobile device? No! In a container, using Docker, Linux, Tmux and AzCopy. Come on, I&#039;ll show you how I do it!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog.bardalen.no\" \/>\n<meta property=\"article:published_time\" content=\"2024-04-21T14:58:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-23T08:47:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Homelab_penguin.png\" \/>\n\t<meta property=\"og:image:width\" content=\"867\" \/>\n\t<meta property=\"og:image:height\" content=\"794\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Tony Bardalen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Skrevet av\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tony Bardalen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Ansl. lesetid\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutter\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/\"},\"author\":{\"name\":\"Tony Bardalen\",\"@id\":\"https:\/\/blog.bardalen.no\/#\/schema\/person\/824afefe68762a6905723a53c0f28f9a\"},\"headline\":\"Download Azure VHDs without your computer!\",\"datePublished\":\"2024-04-21T14:58:55+00:00\",\"dateModified\":\"2024-04-23T08:47:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/\"},\"wordCount\":1888,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/blog.bardalen.no\/#\/schema\/person\/824afefe68762a6905723a53c0f28f9a\"},\"image\":{\"@id\":\"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Homelab_penguin.png\",\"keywords\":[\"AzCopy\",\"Azure\",\"Linux\",\"Microsoft\",\"PowerShell\",\"VHD\"],\"articleSection\":[\"Annet\",\"Azure\",\"Engelsk\",\"English\",\"Microsoft\",\"PowerShell\",\"Tips\"],\"inLanguage\":\"nb-NO\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/\",\"url\":\"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/\",\"name\":\"Download Azure VHDs without your computer! - Blog.bardalen.no\",\"isPartOf\":{\"@id\":\"https:\/\/blog.bardalen.no\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Homelab_penguin.png\",\"datePublished\":\"2024-04-21T14:58:55+00:00\",\"dateModified\":\"2024-04-23T08:47:45+00:00\",\"description\":\"But how? On my mobile device? No! In a container, using Docker, Linux, Tmux and AzCopy. Come on, I'll show you how I do it!\",\"breadcrumb\":{\"@id\":\"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/#breadcrumb\"},\"inLanguage\":\"nb-NO\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"nb-NO\",\"@id\":\"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/#primaryimage\",\"url\":\"https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Homelab_penguin.png\",\"contentUrl\":\"https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Homelab_penguin.png\",\"width\":867,\"height\":794,\"caption\":\"Homelab\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Hjem\",\"item\":\"https:\/\/blog.bardalen.no\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Download Azure VHDs without your computer!\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.bardalen.no\/#website\",\"url\":\"https:\/\/blog.bardalen.no\/\",\"name\":\"Blog.bardalen.no\",\"description\":\"A blog about cloudy stuff\",\"publisher\":{\"@id\":\"https:\/\/blog.bardalen.no\/#\/schema\/person\/824afefe68762a6905723a53c0f28f9a\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.bardalen.no\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"nb-NO\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/blog.bardalen.no\/#\/schema\/person\/824afefe68762a6905723a53c0f28f9a\",\"name\":\"Tony Bardalen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"nb-NO\",\"@id\":\"https:\/\/blog.bardalen.no\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/433273fdcc418ba1a5101686ae0fa85fc15baf53a2bafc63eb84bce1911caa0e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/433273fdcc418ba1a5101686ae0fa85fc15baf53a2bafc63eb84bce1911caa0e?s=96&d=mm&r=g\",\"caption\":\"Tony Bardalen\"},\"logo\":{\"@id\":\"https:\/\/blog.bardalen.no\/#\/schema\/person\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Download Azure VHDs without your computer! - Blog.bardalen.no","description":"But how? On my mobile device? No! In a container, using Docker, Linux, Tmux and AzCopy. Come on, I'll show you how I do it!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/","og_locale":"nb_NO","og_type":"article","og_title":"Download Azure VHDs without your computer! - Blog.bardalen.no","og_description":"But how? On my mobile device? No! In a container, using Docker, Linux, Tmux and AzCopy. Come on, I'll show you how I do it!","og_url":"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/","og_site_name":"Blog.bardalen.no","article_published_time":"2024-04-21T14:58:55+00:00","article_modified_time":"2024-04-23T08:47:45+00:00","og_image":[{"width":867,"height":794,"url":"https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Homelab_penguin.png","type":"image\/png"}],"author":"Tony Bardalen","twitter_card":"summary_large_image","twitter_misc":{"Skrevet av":"Tony Bardalen","Ansl. lesetid":"12 minutter"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/#article","isPartOf":{"@id":"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/"},"author":{"name":"Tony Bardalen","@id":"https:\/\/blog.bardalen.no\/#\/schema\/person\/824afefe68762a6905723a53c0f28f9a"},"headline":"Download Azure VHDs without your computer!","datePublished":"2024-04-21T14:58:55+00:00","dateModified":"2024-04-23T08:47:45+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/"},"wordCount":1888,"commentCount":0,"publisher":{"@id":"https:\/\/blog.bardalen.no\/#\/schema\/person\/824afefe68762a6905723a53c0f28f9a"},"image":{"@id":"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Homelab_penguin.png","keywords":["AzCopy","Azure","Linux","Microsoft","PowerShell","VHD"],"articleSection":["Annet","Azure","Engelsk","English","Microsoft","PowerShell","Tips"],"inLanguage":"nb-NO","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/","url":"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/","name":"Download Azure VHDs without your computer! - Blog.bardalen.no","isPartOf":{"@id":"https:\/\/blog.bardalen.no\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/#primaryimage"},"image":{"@id":"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Homelab_penguin.png","datePublished":"2024-04-21T14:58:55+00:00","dateModified":"2024-04-23T08:47:45+00:00","description":"But how? On my mobile device? No! In a container, using Docker, Linux, Tmux and AzCopy. Come on, I'll show you how I do it!","breadcrumb":{"@id":"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/#breadcrumb"},"inLanguage":"nb-NO","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/"]}]},{"@type":"ImageObject","inLanguage":"nb-NO","@id":"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/#primaryimage","url":"https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Homelab_penguin.png","contentUrl":"https:\/\/blog.bardalen.no\/wp-content\/uploads\/2024\/04\/Homelab_penguin.png","width":867,"height":794,"caption":"Homelab"},{"@type":"BreadcrumbList","@id":"https:\/\/blog.bardalen.no\/index.php\/2024\/04\/21\/download-azure-vhds-without-your-computer\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Hjem","item":"https:\/\/blog.bardalen.no\/"},{"@type":"ListItem","position":2,"name":"Download Azure VHDs without your computer!"}]},{"@type":"WebSite","@id":"https:\/\/blog.bardalen.no\/#website","url":"https:\/\/blog.bardalen.no\/","name":"Blog.bardalen.no","description":"A blog about cloudy stuff","publisher":{"@id":"https:\/\/blog.bardalen.no\/#\/schema\/person\/824afefe68762a6905723a53c0f28f9a"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.bardalen.no\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"nb-NO"},{"@type":["Person","Organization"],"@id":"https:\/\/blog.bardalen.no\/#\/schema\/person\/824afefe68762a6905723a53c0f28f9a","name":"Tony Bardalen","image":{"@type":"ImageObject","inLanguage":"nb-NO","@id":"https:\/\/blog.bardalen.no\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/433273fdcc418ba1a5101686ae0fa85fc15baf53a2bafc63eb84bce1911caa0e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/433273fdcc418ba1a5101686ae0fa85fc15baf53a2bafc63eb84bce1911caa0e?s=96&d=mm&r=g","caption":"Tony Bardalen"},"logo":{"@id":"https:\/\/blog.bardalen.no\/#\/schema\/person\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/blog.bardalen.no\/index.php\/wp-json\/wp\/v2\/posts\/432","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bardalen.no\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bardalen.no\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bardalen.no\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bardalen.no\/index.php\/wp-json\/wp\/v2\/comments?post=432"}],"version-history":[{"count":29,"href":"https:\/\/blog.bardalen.no\/index.php\/wp-json\/wp\/v2\/posts\/432\/revisions"}],"predecessor-version":[{"id":472,"href":"https:\/\/blog.bardalen.no\/index.php\/wp-json\/wp\/v2\/posts\/432\/revisions\/472"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.bardalen.no\/index.php\/wp-json\/wp\/v2\/media\/464"}],"wp:attachment":[{"href":"https:\/\/blog.bardalen.no\/index.php\/wp-json\/wp\/v2\/media?parent=432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bardalen.no\/index.php\/wp-json\/wp\/v2\/categories?post=432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bardalen.no\/index.php\/wp-json\/wp\/v2\/tags?post=432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}