BlogPost

Azure - Connect to your Azure subscription by using Azure PowerShell - Part 1

Azure - Connect to your Azure subscription by using Azure PowerShell - Part 1



Good day to you all, in the next 2 posts we will be using Azure PowerShell, in this first post we will start will some of the basics

First an overview of Azure PowerShell

To manage Azure resources by using Windows PowerShell, you first must install the Azure PowerShell modules that provide this functionality.

Install-Module AzureRM

Install-Module Azure

In this post, we will work mainly with the AzureRM modules, which include cmdlets that implement features of Azure Resource Manager resource providers. For example, cmdlets of the Compute provider, which facilitates the deployment and management of Azure Virtual Machines, reside in the AzureRM.Compute module.

Please should note that deploying and managing Azure resources and services might require using other modules. For example, to work with classic resources, you should rely on the Azure PowerShell Service Management module called Azure. Similarly, there are separate modules that allow you to manage Azure AD, Azure Information Protection, Azure Service Fabric, and Azure ElasticDB

NOTE: The following content is from my time on the Microsoft 70-533 course, If you are interested in learning more about Azure I would highly recommend attending this course



Step One

Connect to your Azure subscription by using Azure PowerShell

In the Windows PowerShell Integrated Scripting Environment (ISE), in the console pane, type the following cmdlet and then press Enter:

Add-AzureRmAccount




In the sign-in windows that appears, sign in by using the Microsoft account that is the Service Administrator of your Azure subscription.




Result.





Step Two

Run some get commands

In the Windows PowerShell ISE window, in the console pane, type the following cmdlet and then press Enter:

Get-AzureRmSubscription





In the Windows PowerShell ISE window, in the console pane, type the following cmdlet and then press Enter:

Get-AzureRmResourceProvider




Examine the output, including Azure resource providers, resource types, and the Azure regions where these resources are available.

Result, you have connected to Azure from PowerShell and run a few get-commands


In the next post we will Manage Azure resources and resource groups by using Azure PowerShell