Azure Shell

Written by Arne Tiedemann on Sunday June 3, 2018

This article describes how to use the Azure Shell with PowerShell and Module MSOnline to manage Exchange Online accounts.

  1. You need an Office 365 tenant
  2. You need a subscription that allow the creation of an storage account

When you start the Azure Shell the first time, the portal ask you some questions:

  1. Do you want to start Shell in "Bash" or in "PowerShell"
  2. When no storage account is present for that user that can be used for the shell, it will prompt you to select or create a storage account.
  3. You can use the advanced function to define the location and the subscription to use for this storage account.
  4. After creating the needed storage account at the right datacenter location, the shell will start.

Module MSOnline

At the default, only some PowerShell Modules are installed and you need to install modules that you want to use. In my case, I need the MSOnline Module to manage my Exchange online users.

So I need to install this module first whit the following Cmdlet.

# To search for the Module in PSGellary
Find-Module -Name MSOnline

# Install the Module
Install-Module -Name MSOnline

When the installation was successful you can use it.

At this time the Azure Shell cant use the credentials used in the browser, so we have to submit the credentials again.

After we create a new $Credential variable for later use, we can connect to MsolService with this credentials.

At this time we have all known Cmdlets available from the MSOnline module.