{"id":2600,"date":"2018-09-06T20:49:59","date_gmt":"2018-09-06T20:49:59","guid":{"rendered":"http:\/\/microsoftgeek.com\/?p=2600"},"modified":"2018-09-06T20:49:59","modified_gmt":"2018-09-06T20:49:59","slug":"getting-started-with-powershell-on-windows-azure","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=2600","title":{"rendered":"Getting Started With PowerShell On Windows Azure"},"content":{"rendered":"<p>There are over 700 PowerShell cmdlets to help you automate routine and complex tasks in Windows Azure. Here&#8217;s how you can start taking advantage of what PowerShell has to offer in Azure.<\/p>\n<p>&nbsp;<\/p>\n<p>One of the most popular public cloud services is Microsoft Azure. Azure is an enormous infrastructure of servers in dozens of data center across the world. It provides many different services, which are primarily controlled by Microsoft&#8217;s\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/manage.windowsazure.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Azure Portal<\/a><\/span>. The Azure Portal is where all of the Azure services are managed, but it&#8217;s not the only place through which Azure resources can be managed. Another method is Windows PowerShell.<\/p>\n<p>When managing Azure resources through PowerShell, an administrator can automate lots of routine and complex tasks that the Azure Portal cannot provide. In this article, we&#8217;ll go over how to get started using PowerShell with Windows Azure.<\/p>\n<h3><strong>Installing the Azure PowerShell Module<\/strong><\/h3>\n<p>Azure is controlled via a PowerShell module, which is provided by Microsoft. Your first task is to get this module installed. To do this, download and install the\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"http:\/\/go.microsoft.com\/fwlink\/p\/?linkid=320376&amp;clcid=0x409\" target=\"_blank\" rel=\"noopener noreferrer\">Microsoft Web Platform Installer package<\/a><\/span>for the Azure module. This convenient installer will install the Azure PowerShell module and all of the prerequisites for you.<\/p>\n<p>The installation will take just a few minutes. And once installed, you must then connect your Azure subscription.<\/p>\n<p><span class=\"imgContent imgCenter\"><span class=\"imgWrapperOutter\"><span class=\"imgWrapperInner\"><span class=\"iZoom\"><img decoding=\"async\" class=\"original-resized\" title=\"\" src=\"http:\/\/media.bestofmicro.com\/U\/I\/506538\/gallery\/azure-powershell-1_w_750.png\" alt=\"\" \/><\/span><\/span><\/span><\/span><\/p>\n<h3><strong>Connecting Your Azure Subscription<\/strong><\/h3>\n<p>After the Azure module is installed, open up your PowerShell console, and type\u00a0<span style=\"color: #ff0000;\"><strong>Add-AzureAccount<\/strong><\/span>. This will bring up a small page asking you to input your account that has an active Azure subscription attached to it.<\/p>\n<p><span class=\"imgContent imgCenter\"><span class=\"imgWrapperOutter\"><span class=\"imgWrapperInner\"><span class=\"iZoom\"><img decoding=\"async\" title=\"\" src=\"http:\/\/media.bestofmicro.com\/U\/J\/506539\/gallery\/azure-powershell-2_w_600.png\" alt=\"\" \/><\/span><\/span><\/span><\/span><\/p>\n<p>Input your credentials to attach your Azure subscription to the Azure PowerShell module. Once this happens, you&#8217;re ready to begin looking around to see what you can do.<\/p>\n<p>The first thing I always recommend to anyone when exploring a new PowerShell module is to use the\u00a0<span style=\"color: #ff0000;\"><strong>Get-Command<\/strong><\/span>\u00a0cmdlet. By using this command, you can easily explore all of the cmdlets available to you in that module.<\/p>\n<p><span class=\"imgContent imgCenter\"><span class=\"imgWrapperOutter\"><span class=\"imgWrapperInner\"><span class=\"iZoom\"><img decoding=\"async\" title=\"\" src=\"http:\/\/media.bestofmicro.com\/U\/L\/506541\/gallery\/azure-powershell-3_w_600.png\" alt=\"\" \/><\/span><\/span><\/span><\/span><\/p>\n<p>As of this writing, there are 716 cmdlets in the Azure module. You&#8217;ve got a lot of opportunity here!<\/p>\n<p>Another cmdlet you should get familiar with is\u00a0<span style=\"color: #ff0000;\"><strong>Get-Help<\/strong><\/span>. PowerShell has a great help system, and using it allows you to get up to speed quickly on everything the Azure module can do. To use PowerShell&#8217;s help, simply pass the name of the cmdlet you want to learn more about to the Get-Help cmdlet.<\/p>\n<blockquote><p><strong>\u00a0\u00a0\u00a0 <span style=\"color: #ff0000;\">Get-Help Get-AzureVMImage<\/span><\/strong><\/p><\/blockquote>\n<p>This example retrieves all help topics about the Get-AzureVMImage cmdlet. Feel free to peruse the cmdlets available to you in the Azure module, and use Get-Help to dig a little deeper to unerstand their purpose.<\/p>\n<p>The following is an example of using the Get-AzureVMImage cmdlet. This time, you will only see the images that have the word &#8220;Windows Server 2012&#8221; in them.<\/p>\n<p><span class=\"imgContent imgCenter\"><span class=\"imgWrapperOutter\"><span class=\"imgWrapperInner\"><span class=\"iZoom\"><img decoding=\"async\" class=\"original-resized\" title=\"\" src=\"http:\/\/media.bestofmicro.com\/U\/K\/506540\/gallery\/azure-powershell-4_w_750.png\" alt=\"\" \/><\/span><\/span><\/span><\/span><\/p>\n<p>This is just a single example from a single cmdlet in the Azure PowerShell module. As mentioned, there are over 700 different cmdlets for provisioning network resources, creating new VMs, modifying storage settings, and much more.<\/p>\n<p>By using the Azure PowerShell module, you can now quickly get information about your Azure subscription and resources, automate provisioning new services, and begin building some solid tools around Azure.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are over 700 PowerShell cmdlets to help you automate routine and complex tasks in Windows Azure. Here&#8217;s how you can start taking advantage of what PowerShell has to offer in Azure. &nbsp; One of the most popular public cloud services is Microsoft Azure. Azure is an enormous infrastructure of servers in dozens of data [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[69,59],"tags":[],"class_list":["post-2600","post","type-post","status-publish","format-standard","hentry","category-azure","category-powershell"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2600","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2600"}],"version-history":[{"count":1,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2600\/revisions"}],"predecessor-version":[{"id":2601,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2600\/revisions\/2601"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}