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