{"id":337,"date":"2014-11-18T00:01:00","date_gmt":"2014-11-18T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2014\/11\/18\/manage-azure-iaas-with-windows-powershell-part-2\/"},"modified":"2014-11-18T00:01:00","modified_gmt":"2014-11-18T00:01:00","slug":"manage-azure-iaas-with-windows-powershell-part-2","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/manage-azure-iaas-with-windows-powershell-part-2\/","title":{"rendered":"Manage Azure IaaS with Windows PowerShell: Part 2"},"content":{"rendered":"<p><b>Summary<\/b>: Attend to&nbsp;prep work to get &nbsp;virtual machine cmdlets working.<\/p>\n<p>Honorary Scripting Guy, Sean Kearney is here with some scribbly notes to help you out with Azure scripts for your virtual machines.<\/p>\n<p style=\"margin-left:30px\"><b>Note<\/b>&nbsp;&nbsp;This is the second post in a series. You might also enjoy reading <a href=\"https:\/\/devblogs.microsoft.com\/scripting\/manage-azure-iaas-with-windows-powershell-part-1\/\" target=\"_blank\">Manage Azure IaaS with Windows PowerShell: Part 1<\/a>.<\/p>\n<p>Before you can create virtual machines in Azure, you need to do some prep work to get those virtual machine cmdlets working.<\/p>\n<p>The first thing you need is storage; that is, a place to put your little pile of stuff, because everybody needs a place for their stuff.<\/p>\n<p>Just imagine Azure as a big Hyper-V box that you share with a massive group of people. Before you can create a virtual machine, you need to create a little box to hold your stuff. (Can you tell I&#039;ve been listening to George Carlin comedy again?)<\/p>\n<p>Normally, you can go into the management portal and create storage in this manner: In the left pane, click <b>STORAGE<\/b>, and then click <b>+NEW<\/b>.<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/76\/18\/7144.1.PNG\"><img decoding=\"async\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/76\/18\/7144.1.PNG\" alt=\"Image of menu\" title=\"Image of menu\" \/><\/a><\/p>\n<p>Click <b>Quick Create<\/b> and fill in the following fields:<\/p>\n<ul>\n<li>The URL for your storage account. Keep in mind that this is a DNS name, and it must be unique and all lowercase letters. Try to pick something you&#039;ll remember instead of a random name. It will make things a lot easier to script with. In our example, we have chosen the name <b>eothsgstorage.cloudapp.net<\/b>.<\/li>\n<li>A location to hold the storage. This will be one of the presently seven locations in the world. In this example, we are using <b>East US<\/b>.<\/li>\n<li>The replication type. This storage account is using <b>Locally Redundant<\/b>.<\/li>\n<\/ul>\n<p>Click <b>OK<\/b> to spin up the process and establish a storage container for our services in Azure.<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/76\/18\/8546.2.PNG\"><img decoding=\"async\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/76\/18\/8546.2.PNG\" alt=\"Image of menu\" title=\"Image of menu\" \/><\/a><\/p>\n<p>If you&#039;d like to see the storage accounts under your current subscription, you can leverage the <b>Get-AzureStorageAccount <\/b>cmdlet. In the following image, we see the output of the cmdlet. Note the <b>AccountType<\/b> property in addition to the <b>StorageAccountName<\/b> property:<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/76\/18\/3264.3.PNG\"><img decoding=\"async\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/76\/18\/3264.3.PNG\" alt=\"Image of command ouptut\" title=\"Image of command ouptut\" \/><\/a><\/p>\n<p>With these two properties, we can give you the cmdlet that would have created this. It&#039;s the <b>New-AzureStorageAccount<\/b> cmdlet in the following format:<\/p>\n<p style=\"margin-left:30px\">New-AzureStorageAccount &ndash;StorageAccountName &#039;eothsgstorage&#039; &ndash;Location &#039;East US&#039; &ndash;type &#039;Standard_LRS&#039;<\/p>\n<p>So creating (or re-creating) a storage account is actually pretty easy. Your only caveat is to make that you choose a unique name for <b>StorageAccountName<\/b> and that it&#039;s actually part of a DNS name in Azure.<\/p>\n<p>Pop by tomorrow and we&rsquo;ll dive into more Azure goodness!<\/p>\n<p>I invite you to follow The Scripting Guys on <a href=\"http:\/\/bit.ly\/scriptingguystwitter\" target=\"_blank\">Twitter<\/a> and <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\" target=\"_blank\">Facebook<\/a>. If you have any questions, send an email to The Scripting Guys at <a href=\"mailto:scripter@microsoft.com\" target=\"_blank\">scripter@microsoft.com<\/a>, or post your questions on the <a href=\"http:\/\/bit.ly\/scriptingforum\" target=\"_blank\">Official Scripting Guys Forum<\/a>. See you tomorrow. Until then remember eat your cmdlets every day with a dash of creativity.<\/p>\n<p><b>Sean Kearney, <\/b>Windows PowerShell MVP and Honorary Scripting Guy&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Attend to&nbsp;prep work to get &nbsp;virtual machine cmdlets working. Honorary Scripting Guy, Sean Kearney is here with some scribbly notes to help you out with Azure scripts for your virtual machines. Note&nbsp;&nbsp;This is the second post in a series. You might also enjoy reading Manage Azure IaaS with Windows PowerShell: Part 1. Before you [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[56,154,549,45],"class_list":["post-337","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-guest-blogger","tag-sean-kearney","tag-series","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Attend to&nbsp;prep work to get &nbsp;virtual machine cmdlets working. Honorary Scripting Guy, Sean Kearney is here with some scribbly notes to help you out with Azure scripts for your virtual machines. Note&nbsp;&nbsp;This is the second post in a series. You might also enjoy reading Manage Azure IaaS with Windows PowerShell: Part 1. Before you [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=337"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/337\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}