microsoft/AzureADGraphApps

Run script for AzureChinaCloud

jpaulan opened this issue · 3 comments

I tried to run this script in our organization azure china cloud environment with below change to the script

Connect-AzAccount -Environment AzureChinaCloud
$context=Get-AzContext
Connect-AzureAD -AzureEnvironmentName AzureChinaCloud -TenantId $context.Tenant.TenantId -AccountId $context.Account.Id | Out-Null

but did not get any results even through there are apps using AAD graph api , after checking through UI

below content in csv file. after running script in

Environments Context
System.Collections.Generic.Dictionary`2[System.String,Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment] Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext

Can you add an Out-Null to the first Connect-AzAccount? It looks like the output from that is interfering with the csv output of the apps.

Connect-AzAccount -Environment AzureChinaCloud  | Out-Null
$context=Get-AzContext
Connect-AzureAD -AzureEnvironmentName AzureChinaCloud -TenantId $context.Tenant.TenantId -AccountId $context.Account.Id | Out-Null

@jpaulan Can you please use the updated script. I believe your tenant does not have any AAD Graph apps. I have improved the messaging to show this and also moved out the connect-AzureAD command to make it easier to connect to other clouds.