I don't remember if it comes pre-installed or I added it beforehand, but you can certainly add it. Try
Install-Module Microsoft.Graph
or if already installed,
Update-Module -Name Microsoft.Graph*
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
We updated most of our powershell scripts to use MgGraph (migrated from using Connect-AzureAD to Connect-MgGraph, including the migration to the new <verb>-Mg<resource> commands.)
We do have a few scripts we normally use from Azure Cloud Shell (Powershell variant).
Interestingly Azure Cloud Shell does not support Connect-MgGraph by default,
$EnvironmentAadTenantId = "<AAD tenant ID here..>"
Connect-AzureAD -TenantId $EnvironmentAadTenantId
# or variant
Connect-AzureAD -ApplicationId $EnvironmentAadServicePrincipalApplicationId -TenantId $EnvironmentAadTenantId -CertificateThumbprint $EnvironmentAadServicePrincipalCertificateThumbprint
and it also does not allow to Import the modules
Import-Module Microsoft.Graph.Authentication
Import-Module Microsoft.Graph.Applications
So although the usage of AzureAD module is planned for deprecation and usage of MgGraph is the way forward, then how should we use MgGraph in scripts ran from Azure Cloud Shell?
Best regards,
Herbert
I don't remember if it comes pre-installed or I added it beforehand, but you can certainly add it. Try
Install-Module Microsoft.Graph
or if already installed,
Update-Module -Name Microsoft.Graph*