Search code examples
azureazure-cli2

How do I work locally with files in my Cloud Shell profile


Either this isn't possible, or it's so simple, I am missing the trick or I am going about it the wrong way. Similar to this question.

I prefer working with VS Code and basically, I want to treat the home path in cloud CLI as a local folder, exposed to VS Code.

I have installed the following VS Code extensions:

  • Azure Account
  • Azure Storage
  • Azure CLI Tools

If I connect to cloud shell via VS Code (F1 > Azure:Open Bash in Cloud Shell) (as explained here) or through the Portal, I have a home directory /home/john, where I can put files. It is this area I want to connect to from my PC (via VS Code).

My first thought was that this area would be exposed in Azure Storage Explorer, however, the only thing in my cloud shell storage account is: File Shares: azclishare > .cloudconsole > acc_john.img. There is no sign of any of the files in /home/john. I'm guessing they're wrapped up in acc_john.img.

I also though about using SCP, but I can't find any reference to this either and I can't find any "connection strings" in the portal.

If anyone has any ideas, I'd be grateful if you could share...

P.S. I am using Windows 10.


Solution

  • It's always the same, post a question on SO then find the answer!

    The full answer is here: https://learn.microsoft.com/en-us/azure/cloud-shell/persisting-shell-storage

    The short answer is that Cloud Shell does map to the storage account (files), but to /usr/john/clouddrive.

    In fact, there is a symlink to clouddrive in /home/john.