SID-500.COM

Home » Azure » Microsoft Azure: Connect to your Azure VM with PowerShell (AzureRM)

Microsoft Azure: Connect to your Azure VM with PowerShell (AzureRM)

I’ve been thinking about it for a long time. What schould I do with my new Azure computer? Surely I’ll come up with something over time. But for now I still don’t know. The server is still running without services. But what I know is that I want to administer my Azure VM via PowerShell. So, I started discovering the new PowerShell module AzureRM.

In my article Microsoft Azure: How to create an Azure VM and connect via Remote Desktop I showed how to connect via Remote Desktop. Now it’s time to bring PowerShell in. So how to get started? First we have to install AzureRM.

Installing AzureRM via PowerShell

Many instructions on the Internet refer to the manual download of AzureRM via SDK. But I want to download it directly to Powershell via a module download. On a Windows 10 Computer open Windows PowerShell. Enter the following command to search for the Azure package:

Find-Package -Name Azure*

1.PNG

If not already installed install the provider nuget, so press Y. All Azure Packages will be listed. I will download and install the AzureRM package. The AzureRM module is a module for the Azure Resource Manager cmdlets. Any Azure PowerShell module not previously installed is downloaded. So, let’s do it:

Install-Package AzureRM

Capture.PNG

Press Y to install it from the PSGallery.

To explore AzureRM cmdlets run

Get-Command -Module AzureRM

Note the scope: There are now over 2000 newly added commands on your computer 😉

(Get-Command -Module AzureRM).count

Capture.PNG

You have 24 hours to memorize them all (parameters included). Tomorrow is test day. 😉

Connect to your Azure Account

Your next step is to connect to your account. To be able to administer your ressources. In my case it’s my Windows Server 2016 VM. I have to provide login credentials.

Login-AzureRmAccount

Capture.PNG

I’m in!

Capture.PNG

Starting and Stopping Ressources (VM)

Finally, a few useful things. I will now start and shut down my VM. Just testing. My VM is currently not running, which I can see from the web interface. Let’s start it. All I have to do is to provide the name of the VM and the Ressource Group.

Start-AzureRmVM -Name AzServer01 -ResourceGroupName Group1

Unbenannt.JPG

Succeeded sounds good. To stop your VM enter Stop-AzureRmVM.

Stop-AzureRmVM -Name AzServer01 -ResourceGroupName Group1

Unbenannt.JPG

What’s next?

That’s it for today. Next time I will install PowerShell Web Access to make my VM accessible from every device, including my Smartphone. Can this be called innovation? I think so, yes.


2 Comments

  1. […] If you want to establish a connection via PowerShell then have a look at my article Microsoft Azure: Connect to your Azure VM with PowerShell (AzureRM) […]

    Like

  2. […] Das PowerShell Modul AzureRM ermöglicht die Remote-Administration von Azure Services. In meinem Fall ist das eine Windows Server 2016 Datacenter VM. Mehr zum Modul und meinen ersten Schritten damit in meinem Beitrag Microsoft Azure: Connect to your Azure VM with PowerShell (AzureRM). […]

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

GET-AUTHOR

My name is Patrick Grünauer. Microsoft MVP. I am from Austria. On sid-500 I write about Windows, Cisco and IT-Security in English and German. Have fun while reading!

Categories

Patrick Gruenauer
Follow SID-500.COM on WordPress.com