Run script for AzureChinaCloud
jpaulan opened this issue · 3 comments
jpaulan commented
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 |
merill commented
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 commented
Still not getting the data but now it is providing the account I am using to connect.
Should we make any change in below line? For azure china environment
if($sp.AppId -eq "00000002-0000-0000-c000-000000000000") #Azure Active Directory Graph API app