azurevisual-studio-codevscode-remoteazure-cloud-shell

Connecting VScode to Azure Cloudshell




Answer: TLDR: type code . in azure Cloudshell in browser to get file editor. (Using own IDE is not possible, only cloudshell as terminal)


I'm looking to connect VS Code to Azure Cloudshell, especially for the file explorer component.

It is a bit of an anti-pattern, but cloudshell is the only way in which I am able to run some commands that connect to Azure resources (spinning up a VM is not allowed).

I know the 'remote-ssh' extension can connect to a remote machine and provide a nice file explorer, however, for cloudshell I do not have ssh available. However, there is a connection possible through the 'Azure account' extension. (There is also a 'remote tunnel' extension that is able to establish connections over different protocol than ssh).

This is the connection that 'Azure account' sets up with the cloudshell:

Netid  State   Recv-Q   Send-Q     Local Address:Port          Peer Address:Port          Process  
tcp    ESTAB   0        0          10.xxx.xx.169:http-alt      10.xxx.xx.29:57404            
tcp    ESTAB   0        0          10.xxx.xx.169:51710        20.xxx.xx.200:microsoft-ds

Does anybody know if this can be used to get a full remote development experience in VScode connected to Azure cloudshell?

(I tried to install the vs code server rpm package in cloudshell, failed due to lacking yum and sudo permissions.)


Solution

  • Check the below steps to connect to Azure Cloud shell (PowerShell/Bash).

    enter image description here

    enter image description here

    enter image description here

    OR

    Press Ctrl + Shift + P => Azure: Sign in.

    enter image description here

    enter image description here

    enter image description here

    file explorer component

    Thanks @Brendan Burn for the Post.

    Refer this SO Thread regarding File Explorer.