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*
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
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
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
I’m in!
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
Succeeded sounds good. To stop your VM enter Stop-AzureRmVM.
Stop-AzureRmVM -Name AzServer01 -ResourceGroupName Group1
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.
Categories: Microsoft Azure, PowerShell, Windows Server
Hi Patrick,
While executing this command ((Get-Command -Module AzureRM).count) am getting zero count.
Thanks,
Amitansu
LikeLike
Hi,
Are you sure you’ve installed the AzureRM module?
All the best,
P
LikeLike
Hi,
I have installed everything as mentioned by you but still am not getting anything.
Could you please help me out.
Thanks,
Amitansu
LikeLike
You could try running Get-Command *azure*. You should find the Azure commands.
LikeLike