Hello @Taha Ahmad ,
Thanks for reaching out.
This is due to PowerShell limitations within Cloud Shell because currently AzureAD.Standard.Preview is the only supported module available, you can verify this by running
Get-Module AzureAD* from cloud shell as shown below:
This preview module provides most of the functionality as AzureAD public module but not all of them due to which you may experience issue. Therefore, you can try using Microsoft.Graph module as an alternative approach in this scenario to create AAD group as explained below.
1) Install Microsoft.Graph from Azure cloud shell
Install-Module -Name Microsoft.Graph
2) Login to Azure AD
Connect-MgGraph -Scopes Group.ReadWrite.All, Directory.ReadWrite.All, Directory.AccessAsUser.All
Note: You must pass these API permissions in the scope parameter along with Connect-MgGraph command.
3) Create Security group:
New-MgGroup -DisplayName AdminGroup -Description AdminGroup -MailEnabled:$false -SecurityEnabled:$true -MailNickname AdminGroup -IsAssignableToRole
The following screenshot is from my test outcome:
For more details: https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.groups/new-mggroup?view=graph-powershell-beta
Hope this helps.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.