{"id":827,"date":"2020-03-03T09:42:54","date_gmt":"2020-03-03T17:42:54","guid":{"rendered":"http:\/\/blog.nillsf.com\/?p=827"},"modified":"2020-03-03T09:43:03","modified_gmt":"2020-03-03T17:43:03","slug":"cloud-shell-goodness-outside-of-the-azure-portal","status":"publish","type":"post","link":"https:\/\/nillsf.com\/index.php\/2020\/03\/03\/cloud-shell-goodness-outside-of-the-azure-portal\/","title":{"rendered":"Cloud shell goodness outside of the Azure portal"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Do you know about the Azure Cloud Shell? If you don&#8217;t, this post is for you. If you do, this post <em>might <\/em>be for you, because cloud shell is available in more places than you might think.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I recently gave a talk at the Azure security and compliance event in Sunnyvale, and showcased the Azure Cloud Shell. In showing this, I did not only show cloud shell in the Azure portal, but I also showed it in the Windows Terminal as well as in Visual Studio code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this blog post, you&#8217;ll learn more about cloud shell and the different places Cloud Shell is available. Let&#8217;s start by introducing the Azure Cloud Shell.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is the Azure Cloud Shell?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Azure Cloud Shell is a shell that is integrated into the Azure portal. It offers you an admin machine at your fingertips, with tons of tools preinstalled. It even has &#8211; in the Azure portal at least &#8211; a visual code editor available. If you&#8217;re tired of <a href=\"https:\/\/stackoverflow.com\/questions\/11828270\/how-do-i-exit-the-vim-editor\">having to look on StackOverflow<\/a> on how to exit vim, this visual code editor might be your saving grace.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Another saving grace might be all the preinstalled &#8211; and up to date &#8211; tools. The cloud shell has goodies such as git, Terraform, python, kubectl, helm and much more pre-installed. For a full list please refer to <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cloud-shell\/features\">this documentation page<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It wouldn&#8217;t be an Azure Cloud Shell if the Shell didn&#8217;t come with Azure tools preinstalled. When you launch cloud shell, you can switch back and forth between the Az CLI or Azure PowerShell. If you need AzCopy, Azure Functions core tools, Service Fabric CLI those are also preinstalled.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Azure Cloud Shell itself is free of charge. You are charged for the persistent storage it creates.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Why don&#8217;t we have a look at what cloud shell looks like in the Azure portal?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Setting up cloud shell for the first time<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To open cloud shell, you can hit the little shell icon in the top of the Azure portal.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"564\" height=\"50\" src=\"\/wp-content\/uploads\/2020\/03\/image.png\" alt=\"\" class=\"wp-image-828\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image.png 564w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-300x27.png 300w\" sizes=\"auto, (max-width: 564px) 100vw, 564px\" \/><figcaption>Hit the shell icon to open cloud shell.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If this is your first time opening cloud shell, you&#8217;ll be presented with the question if you prefer to run Bash (aka Az CLI) or PowerShell. For the examples in this post, we&#8217;ll focus on Bash. Don&#8217;t worry, you can always switch between both.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"379\" src=\"\/wp-content\/uploads\/2020\/03\/image-3-1024x379.png\" alt=\"\" class=\"wp-image-831\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-3-1024x379.png 1024w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-3-300x111.png 300w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-3-768x285.png 768w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-3.png 1120w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>You can choose to run either Bash or PowerShell.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ll now be asked to configure storage for the shell. To be able to do this, you need have access to at least a resource group and have storage access rights in that resource group. If you want a little more control over your storage, you can hit the advanced settings and configure a different storage account.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"951\" height=\"360\" src=\"\/wp-content\/uploads\/2020\/03\/image-1.png\" alt=\"\" class=\"wp-image-829\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-1.png 951w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-1-300x114.png 300w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-1-768x291.png 768w\" sizes=\"auto, (max-width: 951px) 100vw, 951px\" \/><figcaption>You can do either a quick-create or show advanced settings to configure your preferences.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In the advanced setting view you are able to point cloud shell to a new or an existing resource group name, a new or existing storage account and a new or existing file share. You can also configure the region in which you want your data to be stored.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"953\" height=\"359\" src=\"\/wp-content\/uploads\/2020\/03\/image-2.png\" alt=\"\" class=\"wp-image-830\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-2.png 953w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-2-300x113.png 300w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-2-768x289.png 768w\" sizes=\"auto, (max-width: 953px) 100vw, 953px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now, create the storage configuration and give it a couple seconds. Once all is created, you should be presented with your shell.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"631\" height=\"350\" src=\"\/wp-content\/uploads\/2020\/03\/image-4.png\" alt=\"\" class=\"wp-image-832\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-4.png 631w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-4-300x166.png 300w\" sizes=\"auto, (max-width: 631px) 100vw, 631px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Once in this shell, you can execute all sorts of commands. You can download files, execute scripts and clone git repos.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s try some things out:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Examples of things you can do in Cloud Shell<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s run through two example of using Cloud Shell:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Let&#8217;s create a resource group and a VM in bash<\/li><li>Let&#8217;s create another VM using an ARM template from the Azure Quickstart and make code changes using the visual editor<\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Using Cloud Shell to create a VM using Az CLI<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We&#8217;ll start this demo by creating an SSH-keypair. If you already have one in your cloud shell, you can skip this part. To create a new keypair, use the following command (all the default settings are fine)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh-keygen<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To create a new resource group (assuming you&#8217;re running the Bash version), you can use the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>az group create -n shell-demo -l westus2<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This will create a new resource group for you:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"406\" src=\"\/wp-content\/uploads\/2020\/03\/image-5-1024x406.png\" alt=\"\" class=\"wp-image-833\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-5-1024x406.png 1024w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-5-300x119.png 300w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-5-768x304.png 768w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-5.png 1249w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Creating a resource group using cloud shell.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Did you notice here how you didn&#8217;t have to authenticate? Azure CLI uses the credentials from the Azure portal to do the authentication.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With that new resource group created, we can now create a new VM using the Az CLI:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>az vm create -n shell-vm -g shell-demo --image ubuntults --admin-username nilfranadmin --ssh-key-values ~\/.ssh\/id_rsa.pub<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This will create a VM, that we can later connect to using the username and the ssh key we provided. It&#8217;ll take about a minute for the VM be deployed, so be a little patient.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"541\" height=\"417\" src=\"\/wp-content\/uploads\/2020\/03\/image-6.png\" alt=\"\" class=\"wp-image-834\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-6.png 541w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-6-300x231.png 300w\" sizes=\"auto, (max-width: 541px) 100vw, 541px\" \/><figcaption>Use the public IP to connect to the VM.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This will output the public IP address of the VM. You can use that IP address to connect to the VM, using:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh &lt;username>@&lt;ip address><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This will connect to that machine, and will ask you if you trust the fingerprint. Type yes to continue connecting to the machine.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"152\" src=\"\/wp-content\/uploads\/2020\/03\/image-7-1024x152.png\" alt=\"\" class=\"wp-image-835\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-7-1024x152.png 1024w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-7-300x44.png 300w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-7-768x114.png 768w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-7.png 1094w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Type yes to finish connecting to your VM.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">And finally, you&#8217;ll be connected to that new VM. To exit out of that VM, you can type <code>exit<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This created a VM using the Az CLI using the cloud shell. And this without having the pre-install the Az CLI, or even authenticate to it. It used the same user credentials as the Azure portal. Let&#8217;s in the next step, connect use an ARM template to do the same.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Using the code editor to make changes to files in cloud shell<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">There a large repository of ARM templates available on <a href=\"https:\/\/github.com\/Azure\/azure-quickstart-templates\">Github<\/a>. We will clone that Github repo into cloud shell, and then use the code editor in cloud shell to make a change. We&#8217;ll then deploy that VM using cloud shell.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To start, we&#8217;ll clone that git repo into our shell. To do this, (make sure you&#8217;re not longer connected to that demo VM), you use the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone https:\/\/github.com\/Azure\/azure-quickstart-templates.git<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This will clone the complete sample set of ARM templates. Did you notice how you didn&#8217;t have the first install git, it was simply there?<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"292\" src=\"\/wp-content\/uploads\/2020\/03\/image-8-1024x292.png\" alt=\"\" class=\"wp-image-836\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-8-1024x292.png 1024w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-8-300x86.png 300w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-8-768x219.png 768w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-8.png 1119w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Cloning the git repo, without having to have preinstalled git<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Next step if to make some changes to the files there. Navigate into the directory using:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd azure-quickstart-templates\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">There&#8217;s a couple of way in which you can now use the code editor. You can use it to open a specific individual file using a command like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>code 101-vm-simple-linux\/azuredeploy.parameters.json<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Or you can open the code editor in the local location and explore the files for yourself:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>code .<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"957\" height=\"418\" src=\"\/wp-content\/uploads\/2020\/03\/image-9.png\" alt=\"\" class=\"wp-image-837\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-9.png 957w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-9-300x131.png 300w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-9-768x335.png 768w\" sizes=\"auto, (max-width: 957px) 100vw, 957px\" \/><figcaption>Opening a folder so you can browse the folder structure.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If you use the second method, look for the <code>101-vm-simple-linux<\/code> folder and open the <code>azuredeploy.parameters.json file<\/code>.  In there, make changes to include your username, public key and a unique DNS prefix. If you can know how to find your public key, use the command <code>cat ~\/.ssh\/id_rsa.pub<\/code> and copy-paste the value into the parameters file.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"939\" height=\"593\" src=\"\/wp-content\/uploads\/2020\/03\/image-12.png\" alt=\"\" class=\"wp-image-840\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-12.png 939w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-12-300x189.png 300w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-12-768x485.png 768w\" sizes=\"auto, (max-width: 939px) 100vw, 939px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Save the file using either CTRL+S (CMD+S on a Mac) or click on the three dots in the top right to open the menu.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"274\" height=\"241\" src=\"\/wp-content\/uploads\/2020\/03\/image-11.png\" alt=\"\" class=\"wp-image-839\"\/><figcaption>Use the three dots to open the menu<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We&#8217;re now ready to deploy the template. This can be done using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>az group deployment create -g shell-demo -n ARMtemplate --template-file 101-vm-simple-linux\/azuredeploy.json --parameters @storage.101-vm-simple-linux\/azuredeploy.parameters.json<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This showed you how you can use the code editor in the portal to edit files in cloud shell. Let&#8217;s now look in a couple other places where cloud shell is available.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Cloud Shell in Windows Terminal<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you didn&#8217;t know, Microsoft is <a href=\"https:\/\/github.com\/Microsoft\/Terminal\">building a new Windows Terminal<\/a>. It is very awesome, and it includes cloud shell. To get the new Windows Terminal, you&#8217;ll to use the Microsoft Store to install it:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"348\" height=\"71\" src=\"\/wp-content\/uploads\/2020\/03\/image-13.png\" alt=\"\" class=\"wp-image-841\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-13.png 348w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-13-300x61.png 300w\" sizes=\"auto, (max-width: 348px) 100vw, 348px\" \/><figcaption>Open the Microsoft store.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In the store, look for Terminal and open that app and install it.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"336\" height=\"123\" src=\"\/wp-content\/uploads\/2020\/03\/image-14.png\" alt=\"\" class=\"wp-image-842\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-14.png 336w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-14-300x110.png 300w\" sizes=\"auto, (max-width: 336px) 100vw, 336px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Once you installed the app, open the Terminal and look for the pointing down arrow, click on it and select Azure Cloud Shell there.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"560\" height=\"300\" src=\"\/wp-content\/uploads\/2020\/03\/image-15.png\" alt=\"\" class=\"wp-image-843\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-15.png 560w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-15-300x161.png 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If this is the first time opening up Cloud Shell, you&#8217;ll be asked to sign in. Browse to <a href=\"https:\/\/microsoft.com\/devicelogin\">https:\/\/microsoft.com\/devicelogin<\/a> and enter the code the terminal presented you.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"797\" height=\"117\" src=\"\/wp-content\/uploads\/2020\/03\/image-16.png\" alt=\"\" class=\"wp-image-844\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-16.png 797w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-16-300x44.png 300w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-16-768x113.png 768w\" sizes=\"auto, (max-width: 797px) 100vw, 797px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Once you&#8217;re signed in , this will ask you if you want to save your connecting settings. This means that next time you open cloud shell again, you won&#8217;t have to re-authenticate. This is awesome for productivity, but you just have to be mindful about your standing access.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now that cloud shell is opened, you can do a ls operation to list all the files in your working directory. You should see there the github repo we just cloned. <em>That&#8217;s right, files are persisted on the cloud shell, and available for anywhere. <\/em><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"790\" height=\"494\" src=\"\/wp-content\/uploads\/2020\/03\/image-17.png\" alt=\"\" class=\"wp-image-845\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-17.png 790w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-17-300x188.png 300w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-17-768x480.png 768w\" sizes=\"auto, (max-width: 790px) 100vw, 790px\" \/><figcaption>The github repo we cloned is available here.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This has shows you how you can run the cloud shell from the Windows Terminal. Let&#8217;s also have a look at the cloud shell in VScode.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Cloud Shell in VS Code<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">VS Code is even more awesome than the Windows terminal. It is a free and open-source code editor. It is very lightweight but powerful at the same time. A lot of the power from VS Code comes through it&#8217;s network of extensions, and cloud shell can be integrated with VS Code using one of those extensions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To install VS Code, follow the instruction on the <a href=\"https:\/\/code.visualstudio.com\/\">VS Code website<\/a>. Once you have VS Code installed, open it up. To install this, open the extensions view, look for &#8216;Azure tools&#8217; and install the Azure Tools.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"874\" height=\"291\" src=\"\/wp-content\/uploads\/2020\/03\/image-18.png\" alt=\"\" class=\"wp-image-846\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-18.png 874w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-18-300x100.png 300w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-18-768x256.png 768w\" sizes=\"auto, (max-width: 874px) 100vw, 874px\" \/><figcaption>Install the Azure tools.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To use the Cloud Shell from VS Code, you also need node JS installed on your machine. Download and install node using the instructions on the <a href=\"https:\/\/nodejs.org\/en\/download\/\">node website<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you have the Azure tools and Node installed, you can open a Cloud Shell for VS Code (you might need to restart VS Code if you installed node while VS Code was open). To do this, open the command palate using CTRL+SHIFT+P, then type cloud shell. This should show you the options to open cloud shell in Bash or PowerSh<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"611\" height=\"170\" src=\"\/wp-content\/uploads\/2020\/03\/image-19.png\" alt=\"\" class=\"wp-image-847\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-19.png 611w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-19-300x83.png 300w\" sizes=\"auto, (max-width: 611px) 100vw, 611px\" \/><figcaption>Look for cloud shell in the command palate (CTRL+SHIFT+P)<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This will open a popup, that will guide you to a login page:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"456\" height=\"91\" src=\"\/wp-content\/uploads\/2020\/03\/image-20.png\" alt=\"\" class=\"wp-image-848\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-20.png 456w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-20-300x60.png 300w\" sizes=\"auto, (max-width: 456px) 100vw, 456px\" \/><figcaption>Click the sign in button.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Log in on that page, and then you can access cloud shell from VScode. If you do a <code>ls <\/code>operation again, you should again see the folder we created earlier.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"413\" height=\"219\" src=\"\/wp-content\/uploads\/2020\/03\/image-21.png\" alt=\"\" class=\"wp-image-849\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-21.png 413w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-21-300x159.png 300w\" sizes=\"auto, (max-width: 413px) 100vw, 413px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">And this is how you use cloud shell from VS Code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;m a pretty heavy user of cloud shell. It&#8217;s just so awesome to not have to preinstall any tools, and have them available anywhere you go. In this post, we looked at an introduction of the cloud shell and we looked into two interesting places where the cloud shell is available that you might not have predicted.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you have other fun places where you run cloud shell, let me know! Happy to extend this post.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Do you know about the Azure Cloud Shell? If you don&#8217;t, this post is for you. If you do, this post might be for you, because cloud shell is available in more places than you might think. I recently gave a talk at the Azure security and compliance event in Sunnyvale, and showcased the Azure [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":832,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-827","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"jetpack_featured_media_url":"https:\/\/nillsfblog.blob.core.windows.net\/media\/2020\/03\/image-4.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/nillsf.com\/index.php\/wp-json\/wp\/v2\/posts\/827","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nillsf.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nillsf.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nillsf.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nillsf.com\/index.php\/wp-json\/wp\/v2\/comments?post=827"}],"version-history":[{"count":2,"href":"https:\/\/nillsf.com\/index.php\/wp-json\/wp\/v2\/posts\/827\/revisions"}],"predecessor-version":[{"id":851,"href":"https:\/\/nillsf.com\/index.php\/wp-json\/wp\/v2\/posts\/827\/revisions\/851"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nillsf.com\/index.php\/wp-json\/wp\/v2\/media\/832"}],"wp:attachment":[{"href":"https:\/\/nillsf.com\/index.php\/wp-json\/wp\/v2\/media?parent=827"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nillsf.com\/index.php\/wp-json\/wp\/v2\/categories?post=827"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nillsf.com\/index.php\/wp-json\/wp\/v2\/tags?post=827"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}