{"id":10904,"date":"2019-09-29T19:33:44","date_gmt":"2019-09-30T02:33:44","guid":{"rendered":"https:\/\/riguy.com\/?page_id=10904"},"modified":"2019-09-30T13:22:40","modified_gmt":"2019-09-30T20:22:40","slug":"add-an-azure-virtual-machine-using-azure-cloud-shell","status":"publish","type":"page","link":"https:\/\/riguy.com\/?page_id=10904","title":{"rendered":"Add An Azure Virtual Machine Using Cloud Shell"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In order to add a virtual machine to Microsoft Azure by using the cloud shell, first log into the Azure Portal account. Go to: <br><a href=\"Https:\/\/shell.azure.com\/powershell\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Https:\/\/shell.azure.com\/powershell<\/a> &#8211; give it a few seconds, and the interface opens:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM1.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"548\" height=\"375\" src=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM1.png\" alt=\"Azure Cloud Shell\" class=\"wp-image-10916\" srcset=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM1.png 548w, https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM1-300x205.png 300w\" sizes=\"auto, (max-width: 548px) 100vw, 548px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">First thing to do: create a new resource group [RG] for the virtual machine, unless there is already a particular resource group available for this virtual machine. Name the RG intuitively. I own the &#8216;MSCloudSys.Com&#8217; domain, so I named it similarly. I also want this to be located in the West part of the USA. Give this command [or &#8220;cmdlet&#8221;] to begin creating a new RG:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8220;New-AzResourceGroup -Name myMSCloudSys&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM2.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"749\" height=\"273\" src=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM2.png\" alt=\"Azure Cloud Shell Resource Group\" class=\"wp-image-10918\" srcset=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM2.png 749w, https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM2-300x109.png 300w\" sizes=\"auto, (max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">After the new resource group is created successfully, the virtual machine can be created and essentially, put inside the new resource group.  The &#8216;cmdlet&#8217; is:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8220;New-AzVm&#8221; &#8211; it is followed by the needed parameters: the VM name, the RG, the Location [region], the VNET + Subnet,  the Network Security Group [NSG], and the public IP + ports to be opened. In addition, there will be username and password credentials needed:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM3.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"714\" height=\"390\" src=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM3.png\" alt=\"Azure New-AzVm\" class=\"wp-image-10919\" srcset=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM3.png 714w, https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM3-300x164.png 300w\" sizes=\"auto, (max-width: 714px) 100vw, 714px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The Azure virtual machine is being created &#8230; <\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM4.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM4.png\" alt=\"Azure New Virtual Machine via Shell\" class=\"wp-image-10920\" width=\"644\" height=\"209\" srcset=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM4.png 693w, https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM4-300x97.png 300w\" sizes=\"auto, (max-width: 644px) 100vw, 644px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Upon completion, the summary can be seen, including VM and RG name, and various IDs:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM5.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"894\" height=\"218\" src=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM5.png\" alt=\"Azure Cloud Shell\" class=\"wp-image-10921\" srcset=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM5.png 894w, https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM5-300x73.png 300w, https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM5-768x187.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><figcaption><br><\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">What about accessing the new virtual machine? We need an address. At the cloud shell, quickly obtain the public facing IP address with this: &#8220;Get-AzPublicIpAddress&#8221; + needed parameters:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM6.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"813\" height=\"216\" src=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM6.png\" alt=\"Azure Cloud Shell Get-AzPublicAddress\" class=\"wp-image-10922\" srcset=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM6.png 813w, https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM6-300x80.png 300w, https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM6-768x204.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">One option is to quickly open PowerShell on the local PC and issue this &#8216;cmdlet&#8217;: <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8220;mstsc \/v:40.118.233.184&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM9.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"567\" height=\"370\" src=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM9.png\" alt=\"Log into Azure Virtual Machine with MSTSC\" class=\"wp-image-10931\" srcset=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM9.png 567w, https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM9-300x196.png 300w\" sizes=\"auto, (max-width: 567px) 100vw, 567px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">From the Azure Portal, the brand new virtual machine and associated resources can be seen:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM8.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"359\" height=\"383\" src=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM8.png\" alt=\"Azure Portal All Resources\" class=\"wp-image-10928\" srcset=\"https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM8.png 359w, https:\/\/riguy.com\/wp-content\/uploads\/2019\/09\/AddCloudShellVM8-281x300.png 281w\" sizes=\"auto, (max-width: 359px) 100vw, 359px\" \/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>In order to add a virtual machine to Microsoft Azure by using the cloud shell, first log into the Azure Portal account. Go to: Https:\/\/shell.azure.com\/powershell &#8211; give it a few seconds, and the interface opens: First thing to do: create a new resource group [RG] for the virtual machine, unless there is already a particular &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/riguy.com\/?page_id=10904\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Add An Azure Virtual Machine Using Cloud Shell&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":5011,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","footnotes":""},"class_list":["post-10904","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/riguy.com\/index.php?rest_route=\/wp\/v2\/pages\/10904","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/riguy.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/riguy.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/riguy.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/riguy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10904"}],"version-history":[{"count":11,"href":"https:\/\/riguy.com\/index.php?rest_route=\/wp\/v2\/pages\/10904\/revisions"}],"predecessor-version":[{"id":10938,"href":"https:\/\/riguy.com\/index.php?rest_route=\/wp\/v2\/pages\/10904\/revisions\/10938"}],"up":[{"embeddable":true,"href":"https:\/\/riguy.com\/index.php?rest_route=\/wp\/v2\/pages\/5011"}],"wp:attachment":[{"href":"https:\/\/riguy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10904"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}