Is there a way to download files from Azure Cloud Shell?
Asked Answered
S

3

17

I am trying to get credentials for my Azure Kubernetes Cluster. Ran the script to fetch details on Azure cloud shell and got a .config file. I wonder if there is a way to download the file from my Azure Cloud Shell session?

Sassafras answered 9/7, 2018 at 16:30 Comment(0)
A
2

When you use Azure Cloud Shell, you need to create an Azure File Share or use the existed. Cloud shell will mount File Share to the system. And the mount path you can use command mount to take a look. The result will like this: enter image description here enter image description here

As I suggest, you can copy the .config file to the path like this: /home/RG/clouddrive/.cloudconsole, then you can download the file from File Share.

For more details, you can take a look at another case here.

Ambages answered 10/7, 2018 at 1:25 Comment(2)
If the answer is helpful to you? Please let me know.Ambages
I'm glad the answer is helpful to you! :-)Ambages
M
41

At the cloud shell prompt just type: download yourfilename

Monomerous answered 15/8, 2019 at 16:41 Comment(3)
Very simple. Worked like a charm. Thank you for sharing your suggestion.Fuchsia
I'm running the command "download $HOME/.kube/config". But, I don't find any file getting downloaded to my machine. May I know where the file gets download?Byelaw
@Byelaw hit the same issue, you have to be doing this from the web browser for this to work (not the Windows Terminal).Compliance
A
2

When you use Azure Cloud Shell, you need to create an Azure File Share or use the existed. Cloud shell will mount File Share to the system. And the mount path you can use command mount to take a look. The result will like this: enter image description here enter image description here

As I suggest, you can copy the .config file to the path like this: /home/RG/clouddrive/.cloudconsole, then you can download the file from File Share.

For more details, you can take a look at another case here.

Ambages answered 10/7, 2018 at 1:25 Comment(2)
If the answer is helpful to you? Please let me know.Ambages
I'm glad the answer is helpful to you! :-)Ambages
L
2
  1. List your files

Azure Cloud Shell File listing

You may notice the clouddrive folder (check image link above). This folder is mounted to an Azure File Share, as specified here: https://learn.microsoft.com/en-us/azure/cloud-shell/persisting-shell-storage#how-cloud-shell-storage-works

  1. Get Azure File Share Information:

Azure File Share

With the Get-CloudDrive command you obtain the Azure File Share metadata that will help you to find the download page for your files in Azure Portal. Alternatively you may use the df command

df command output

  1. Login to Azure Portal and locate the Azure File Share:

Azure File Share at Azure Portal Azure storage account

Legislature answered 9/11, 2021 at 18:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.