Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.25k stars 3.85k forks source link

Get-AZADServicePrincipal - InternalServerError - GovCloud #11181

Closed mattyt0406 closed 4 years ago

mattyt0406 commented 4 years ago

Description

When trying to get all SPNs from AzureAD we are getting multiple errors. We either get InternalServerError or Gateway Timeout PS C:\Windows\system32> get-azadserviceprincipal get-azadserviceprincipal : Operation returned an invalid status code 'InternalServerError' At line:1 char:1

Steps to reproduce

connect to Azure w/ AZ module and run get-azadserviceprincipal

Environment data

PS C:\Windows\system32> $PSVersionTable

Name                           Value                                                                                                                                                                                                                                                              
----                           -----                                                                                                                                                                                                                                                              
PSVersion                      5.1.14393.3471                                                                                                                                                                                                                                                     
PSEdition                      Desktop                                                                                                                                                                                                                                                            
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                                                                                            
BuildVersion                   10.0.14393.3471                                                                                                                                                                                                                                                    
CLRVersion                     4.0.30319.42000                                                                                                                                                                                                                                                    
WSManStackVersion              3.0                                                                                                                                                                                                                                                                
PSRemotingProtocolVersion      2.3                                                                                                                                                                                                                                                                
SerializationVersion           1.1.0.1                                                                                                                                                                                                                                                            

Module versions


    Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version    Name                                ExportedCommands                                                                                                                                                                                                                        
---------- -------    ----                                ----------------                                                                                                                                                                                                                        
Manifest   1.4.0.0    AccessControlDSC                                                                                                                                                                                                                                                            
Manifest   1.4.0.0    AuditPolicyDsc                                                                                                                                                                                                                                                              
Manifest   1.2.0.0    AuditPolicyDsc                                                                                                                                                                                                                                                              
Script     1.7.1      Az.Accounts                         {Disable-AzDataCollection, Disable-AzContextAutosave, Enable-AzDataCollection, Enable-AzContextAutosave...}                                                                                                                             
Script     1.7.0      Az.Accounts                         {Disable-AzDataCollection, Disable-AzContextAutosave, Enable-AzDataCollection, Enable-AzContextAutosave...}                                                                                                                             
Script     1.6.4      Az.Accounts                         {Disable-AzDataCollection, Disable-AzContextAutosave, Enable-AzDataCollection, Enable-AzContextAutosave...}                                                                                                                             
Script     1.6.3      Az.Accounts                         {Disable-AzDataCollection, Disable-AzContextAutosave, Enable-AzDataCollection, Enable-AzContextAutosave...}                                                                                                                             
Script     1.6.2      Az.Accounts                         {Disable-AzDataCollection, Disable-AzContextAutosave, Enable-AzDataCollection, Enable-AzContextAutosave...}                                                                                                                             
Script     1.6.0      Az.Accounts                         {Disable-AzDataCollection, Disable-AzContextAutosave, Enable-AzDataCollection, Enable-AzContextAutosave...}                                                                                                                             
Script     1.5.2      Az.Accounts                         {Disable-AzDataCollection, Disable-AzContextAutosave, Enable-AzDataCollection, Enable-AzContextAutosave...}                                                                                                                             
Script     1.1.1      Az.Advisor                          {Get-AzAdvisorRecommendation, Enable-AzAdvisorRecommendation, Disable-AzAdvisorRecommendation, Get-AzAdvisorConfiguration...}                                                                                                           
Script     1.0.1      Az.Advisor                          {Get-AzAdvisorRecommendation, Enable-AzAdvisorRecommendation, Disable-AzAdvisorRecommendation, Get-AzAdvisorConfiguration...}                                                                                                           
Script     1.0.3      Az.Aks                              {Get-AzAks, New-AzAks, Remove-AzAks, Import-AzAksCredential...}                                                                                                                                                                         
Script     1.0.1      Az.Aks                              {Get-AzAks, New-AzAks, Remove-AzAks, Import-AzAksCredential...}                                                                                                                                                                         
Script     1.1.2      Az.AnalysisServices                 {Resume-AzAnalysisServicesServer, Suspend-AzAnalysisServicesServer, Get-AzAnalysisServicesServer, Remove-AzAnalysisServicesServer...}                                                                                                   
Script     1.1.0      Az.AnalysisServices                 {Resume-AzAnalysisServicesServer, Suspend-AzAnalysisServicesServer, Get-AzAnalysisServicesServer, Remove-AzAnalysisServicesServer...}                                                                                                   
Script     1.3.4      Az.ApiManagement                    {Add-AzApiManagementApiToProduct, Add-AzApiManagementProductToGroup, Add-AzApiManagementRegion, Add-AzApiManagementUserToGroup...}                                                                                                      
Script     1.3.3      Az.ApiManagement                    {Add-AzApiManagementApiToProduct, Add-AzApiManagementProductToGroup, Add-AzApiManagementRegion, Add-AzApiManagementUserToGroup...}                                                                                                      
Script     1.1.0      Az.ApiManagement                    {Add-AzApiManagementApiToProduct, Add-AzApiManagementProductToGroup, Add-AzApiManagementRegion, Add-AzApiManagementUserToGroup...}                                                                                                      
Script     1.0.3      Az.ApplicationInsights              {Get-AzApplicationInsights, New-AzApplicationInsights, Remove-AzApplicationInsights, Set-AzApplicationInsightsPricingPlan...}                                                                                                           
Script     1.0.0      Az.ApplicationInsights              {Get-AzApplicationInsights, New-AzApplicationInsights, Remove-AzApplicationInsights, Set-AzApplicationInsightsPricingPlan...}                                                                                                           
Script     1.3.5      Az.Automation                       {Get-AzAutomationHybridWorkerGroup, Remove-AzAutomationHybridWorkerGroup, Get-AzAutomationJobOutputRecord, Import-AzAutomationDscNodeConfiguration...}                                                                                  
Script     1.2.2      Az.Automation                       {Get-AzAutomationHybridWorkerGroup, Remove-AzAutomationHybridWorkerGroup, Get-AzAutomationJobOutputRecord, Import-AzAutomationDscNodeConfiguration...}                                                                                  
Script     2.0.2      Az.Batch                            {Remove-AzBatchAccount, Get-AzBatchAccount, Get-AzBatchAccountKey, New-AzBatchAccount...}                                                                                                                                               
Script     1.1.0      Az.Batch                            {Remove-AzBatchAccount, Get-AzBatchAccount, Get-AzBatchAccountKey, New-AzBatchAccount...}                                                                                                                                               
Script     1.0.2      Az.Billing                          {Get-AzBillingInvoice, Get-AzBillingPeriod, Get-AzEnrollmentAccount, Get-AzConsumptionBudget...}                                                                                                                                        
Script     1.0.1      Az.Billing                          {Get-AzBillingInvoice, Get-AzBillingPeriod, Get-AzEnrollmentAccount, Get-AzConsumptionBudget...}                                                                                                                                        
Script     1.0.0      Az.Billing                          {Get-AzBillingInvoice, Get-AzBillingPeriod, Get-AzEnrollmentAccount, Get-AzConsumptionBudget...}                                                                                                                                        
Script     0.2.6      Az.Blueprint                        {Get-AzBlueprint, Get-AzBlueprintAssignment, New-AzBlueprintAssignment, Remove-AzBlueprintAssignment...}                                                                                                                                
Script     1.4.2      Az.Cdn                              {Get-AzCdnProfile, Get-AzCdnProfileSsoUrl, New-AzCdnProfile, Remove-AzCdnProfile...}                                                                                                                                                    
Script     1.2.0      Az.Cdn                              {Get-AzCdnProfile, Get-AzCdnProfileSsoUrl, New-AzCdnProfile, Remove-AzCdnProfile...}                                                                                                                                                    
Script     1.2.2      Az.CognitiveServices                {Get-AzCognitiveServicesAccount, Get-AzCognitiveServicesAccountKey, Get-AzCognitiveServicesAccountSku, Get-AzCognitiveServicesAccountType...}                                                                                           
Script     1.1.1      Az.CognitiveServices                {Get-AzCognitiveServicesAccount, Get-AzCognitiveServicesAccountKey, Get-AzCognitiveServicesAccountSku, Get-AzCognitiveServicesAccountType...}                                                                                           
Script     3.4.0      Az.Compute                          {Remove-AzAvailabilitySet, Get-AzAvailabilitySet, New-AzAvailabilitySet, Update-AzAvailabilitySet...}                                                                                                                                   
Script     3.3.0      Az.Compute                          {Remove-AzAvailabilitySet, Get-AzAvailabilitySet, New-AzAvailabilitySet, Update-AzAvailabilitySet...}                                                                                                                                   
Script     2.1.0      Az.Compute                          {Remove-AzAvailabilitySet, Get-AzAvailabilitySet, New-AzAvailabilitySet, Update-AzAvailabilitySet...}                                                                                                                                   
Script     1.0.3      Az.ContainerInstance                {New-AzContainerGroup, Get-AzContainerGroup, Remove-AzContainerGroup, Get-AzContainerInstanceLog}                                                                                                                                       
Script     1.0.1      Az.ContainerInstance                {New-AzContainerGroup, Get-AzContainerGroup, Remove-AzContainerGroup, Get-AzContainerInstanceLog}                                                                                                                                       
Script     1.1.1      Az.ContainerRegistry                {New-AzContainerRegistry, Get-AzContainerRegistry, Update-AzContainerRegistry, Remove-AzContainerRegistry...}                                                                                                                           
Script     1.0.1      Az.ContainerRegistry                {New-AzContainerRegistry, Get-AzContainerRegistry, Update-AzContainerRegistry, Remove-AzContainerRegistry...}                                                                                                                           
Script     1.1.0      Az.DataBoxEdge                      {Get-AzDataBoxEdgeJob, Get-AzDataBoxEdgeDevice, Invoke-AzDataBoxEdgeDevice, New-AzDataBoxEdgeDevice...}                                                                                                                                 
Script     1.6.1      Az.DataFactory                      {Set-AzDataFactoryV2, Update-AzDataFactoryV2, Get-AzDataFactoryV2, Remove-AzDataFactoryV2...}                                                                                                                                           
Script     1.6.0      Az.DataFactory                      {Set-AzDataFactoryV2, Update-AzDataFactoryV2, Get-AzDataFactoryV2, Remove-AzDataFactoryV2...}                                                                                                                                           
Script     1.1.1      Az.DataFactory                      {Set-AzDataFactoryV2, Update-AzDataFactoryV2, Get-AzDataFactoryV2, Remove-AzDataFactoryV2...}                                                                                                                                           
Script     1.0.2      Az.DataLakeAnalytics                {Get-AzDataLakeAnalyticsDataSource, New-AzDataLakeAnalyticsCatalogCredential, Remove-AzDataLakeAnalyticsCatalogCredential, Set-AzDataLakeAnalyticsCatalogCredential...}                                                                 
Script     1.0.0      Az.DataLakeAnalytics                {Get-AzDataLakeAnalyticsDataSource, New-AzDataLakeAnalyticsCatalogCredential, Remove-AzDataLakeAnalyticsCatalogCredential, Set-AzDataLakeAnalyticsCatalogCredential...}                                                                 
Script     1.2.6      Az.DataLakeStore                    {Get-AzDataLakeStoreTrustedIdProvider, Remove-AzDataLakeStoreTrustedIdProvider, Remove-AzDataLakeStoreFirewallRule, Set-AzDataLakeStoreTrustedIdProvider...}                                                                            
Script     1.2.1      Az.DataLakeStore                    {Get-AzDataLakeStoreTrustedIdProvider, Remove-AzDataLakeStoreTrustedIdProvider, Remove-AzDataLakeStoreFirewallRule, Set-AzDataLakeStoreTrustedIdProvider...}                                                                            
Script     1.1.0      Az.DeploymentManager                {Get-AzDeploymentManagerArtifactSource, New-AzDeploymentManagerArtifactSource, Set-AzDeploymentManagerArtifactSource, Remove-AzDeploymentManagerArtifactSource...}                                                                      
Script     1.0.2      Az.DeploymentManager                {Get-AzDeploymentManagerArtifactSource, New-AzDeploymentManagerArtifactSource, Set-AzDeploymentManagerArtifactSource, Remove-AzDeploymentManagerArtifactSource...}                                                                      
Script     1.0.0      Az.DeploymentManager                {Get-AzDeploymentManagerArtifactSource, New-AzDeploymentManagerArtifactSource, Set-AzDeploymentManagerArtifactSource, Remove-AzDeploymentManagerArtifactSource...}                                                                      
Script     1.0.2      Az.DevTestLabs                      {Get-AzDtlAllowedVMSizesPolicy, Get-AzDtlAutoShutdownPolicy, Get-AzDtlAutoStartPolicy, Get-AzDtlVMsPerLabPolicy...}                                                                                                                     
Script     1.0.0      Az.DevTestLabs                      {Get-AzDtlAllowedVMSizesPolicy, Get-AzDtlAutoShutdownPolicy, Get-AzDtlAutoStartPolicy, Get-AzDtlVMsPerLabPolicy...}                                                                                                                     
Script     1.1.2      Az.Dns                              {Get-AzDnsRecordSet, New-AzDnsRecordConfig, Remove-AzDnsRecordSet, Set-AzDnsRecordSet...}                                                                                                                                               
Script     1.1.0      Az.Dns                              {Get-AzDnsRecordSet, New-AzDnsRecordConfig, Remove-AzDnsRecordSet, Set-AzDnsRecordSet...}                                                                                                                                               
Script     1.2.3      Az.EventGrid                        {New-AzEventGridTopic, Get-AzEventGridTopic, Set-AzEventGridTopic, New-AzEventGridTopicKey...}                                                                                                                                          
Script     1.1.1      Az.EventGrid                        {New-AzEventGridTopic, Get-AzEventGridTopic, Set-AzEventGridTopic, New-AzEventGridTopicKey...}                                                                                                                                          
Script     1.4.3      Az.EventHub                         {New-AzEventHubNamespace, Get-AzEventHubNamespace, Set-AzEventHubNamespace, Remove-AzEventHubNamespace...}                                                                                                                              
Script     1.1.0      Az.EventHub                         {New-AzEventHubNamespace, Get-AzEventHubNamespace, Set-AzEventHubNamespace, Remove-AzEventHubNamespace...}                                                                                                                              
Script     1.3.0      Az.FrontDoor                        {New-AzFrontDoor, Get-AzFrontDoor, Set-AzFrontDoor, Remove-AzFrontDoor...}                                                                                                                                                              
Script     1.0.0      Az.FrontDoor                        {New-AzFrontDoor, Get-AzFrontDoor, Set-AzFrontDoor, Remove-AzFrontDoor...}                                                                                                                                                              
Script     0.10.7     Az.GuestConfiguration               {Get-AzVMGuestPolicyStatus, Get-AzVMGuestPolicyStatusHistory}                                                                                                                                                                           
Script     0.10.6     Az.GuestConfiguration               {Get-AzVMGuestPolicyStatus, Get-AzVMGuestPolicyStatusHistory}                                                                                                                                                                           
Script     3.0.3      Az.HDInsight                        {Get-AzHDInsightJob, New-AzHDInsightSqoopJobDefinition, Wait-AzHDInsightJob, New-AzHDInsightStreamingMapReduceJobDefinition...}                                                                                                         
Script     3.0.2      Az.HDInsight                        {Get-AzHDInsightJob, New-AzHDInsightSqoopJobDefinition, Wait-AzHDInsightJob, New-AzHDInsightStreamingMapReduceJobDefinition...}                                                                                                         
Script     2.0.0      Az.HDInsight                        {Get-AzHDInsightJob, New-AzHDInsightSqoopJobDefinition, Wait-AzHDInsightJob, New-AzHDInsightStreamingMapReduceJobDefinition...}                                                                                                         
Script     1.0.1      Az.HealthcareApis                   {New-AzHealthcareApisService, Remove-AzHealthcareApisService, Set-AzHealthcareApisService, Get-AzHealthcareApisService}                                                                                                                 
Script     2.0.1      Az.IotHub                           {Add-AzIotHubKey, Get-AzIotHubEventHubConsumerGroup, Get-AzIotHubConnectionString, Get-AzIotHubJob...}                                                                                                                                  
Script     1.1.0      Az.IotHub                           {Add-AzIotHubKey, Get-AzIotHubEventHubConsumerGroup, Get-AzIotHubConnectionString, Get-AzIotHubJob...}                                                                                                                                  
Script     1.5.0      Az.KeyVault                         {Add-AzKeyVaultCertificate, Update-AzKeyVaultCertificate, Stop-AzKeyVaultCertificateOperation, Get-AzKeyVaultCertificateOperation...}                                                                                                   
Script     1.4.0      Az.KeyVault                         {Add-AzKeyVaultCertificate, Update-AzKeyVaultCertificate, Stop-AzKeyVaultCertificateOperation, Get-AzKeyVaultCertificateOperation...}                                                                                                   
Script     1.2.0      Az.KeyVault                         {Add-AzKeyVaultCertificate, Update-AzKeyVaultCertificate, Stop-AzKeyVaultCertificateOperation, Get-AzKeyVaultCertificateOperation...}                                                                                                   
Script     1.3.2      Az.LogicApp                         {Get-AzIntegrationAccountAgreement, Get-AzIntegrationAccountAssembly, Get-AzIntegrationAccountBatchConfiguration, Get-AzIntegrationAccountCallbackUrl...}                                                                               
Script     1.2.1      Az.LogicApp                         {Get-AzIntegrationAccountAgreement, Get-AzIntegrationAccountAssembly, Get-AzIntegrationAccountBatchConfiguration, Get-AzIntegrationAccountCallbackUrl...}                                                                               
Script     1.1.3      Az.MachineLearning                  {Move-AzMlCommitmentAssociation, Get-AzMlCommitmentAssociation, Get-AzMlCommitmentPlanUsageHistory, Remove-AzMlCommitmentPlan...}                                                                                                       
Script     1.1.0      Az.MachineLearning                  {Move-AzMlCommitmentAssociation, Get-AzMlCommitmentAssociation, Get-AzMlCommitmentPlanUsageHistory, Remove-AzMlCommitmentPlan...}                                                                                                       
Script     1.0.2      Az.ManagedServices                  {Get-AzManagedServicesAssignment, New-AzManagedServicesAssignment, Remove-AzManagedServicesAssignment, Get-AzManagedServicesDefinition...}                                                                                              
Script     1.0.2      Az.MarketplaceOrdering              {Get-AzMarketplaceTerms, Set-AzMarketplaceTerms}                                                                                                                                                                                        
Script     1.0.0      Az.MarketplaceOrdering              {Get-AzMarketplaceTerms, Set-AzMarketplaceTerms}                                                                                                                                                                                        
Script     1.1.1      Az.Media                            {Sync-AzMediaServiceStorageKey, Set-AzMediaServiceKey, Get-AzMediaServiceKey, Get-AzMediaServiceNameAvailability...}                                                                                                                    
Script     1.1.0      Az.Media                            {Sync-AzMediaServiceStorageKey, Set-AzMediaServiceKey, Get-AzMediaServiceKey, Get-AzMediaServiceNameAvailability...}                                                                                                                    
Script     1.5.0      Az.Monitor                          {Get-AzMetricDefinition, Get-AzMetric, Remove-AzLogProfile, Get-AzLogProfile...}                                                                                                                                                        
Script     1.2.1      Az.Monitor                          {Get-AzMetricDefinition, Get-AzMetric, Remove-AzLogProfile, Get-AzLogProfile...}                                                                                                                                                        
Script     2.3.0      Az.Network                          {Add-AzApplicationGatewayAuthenticationCertificate, Get-AzApplicationGatewayAuthenticationCertificate, New-AzApplicationGatewayAuthenticationCertificate, Remove-AzApplicationGatewayAuthenticationCertificate...}                      
Script     2.2.1      Az.Network                          {Add-AzApplicationGatewayAuthenticationCertificate, Get-AzApplicationGatewayAuthenticationCertificate, New-AzApplicationGatewayAuthenticationCertificate, Remove-AzApplicationGatewayAuthenticationCertificate...}                      
Script     1.8.1      Az.Network                          {Add-AzApplicationGatewayAuthenticationCertificate, Get-AzApplicationGatewayAuthenticationCertificate, New-AzApplicationGatewayAuthenticationCertificate, Remove-AzApplicationGatewayAuthenticationCertificate...}                      
Script     1.1.1      Az.NotificationHubs                 {Get-AzNotificationHub, Get-AzNotificationHubAuthorizationRule, Get-AzNotificationHubListKey, Get-AzNotificationHubPNSCredential...}                                                                                                    
Script     1.1.0      Az.NotificationHubs                 {Get-AzNotificationHub, Get-AzNotificationHubAuthorizationRule, Get-AzNotificationHubListKey, Get-AzNotificationHubPNSCredential...}                                                                                                    
Script     1.3.4      Az.OperationalInsights              {New-AzOperationalInsightsAzureActivityLogDataSource, New-AzOperationalInsightsCustomLogDataSource, Disable-AzOperationalInsightsLinuxCustomLogCollection, Disable-AzOperationalInsightsIISLogCollection...}                            
Script     1.2.0      Az.OperationalInsights              {New-AzOperationalInsightsAzureActivityLogDataSource, New-AzOperationalInsightsCustomLogDataSource, Disable-AzOperationalInsightsLinuxCustomLogCollection, Disable-AzOperationalInsightsIISLogCollection...}                            
Script     1.2.0      Az.PolicyInsights                   {Get-AzPolicyEvent, Get-AzPolicyState, Get-AzPolicyStateSummary, Get-AzPolicyRemediation...}                                                                                                                                            
Script     1.1.4      Az.PolicyInsights                   {Get-AzPolicyEvent, Get-AzPolicyState, Get-AzPolicyStateSummary, Get-AzPolicyRemediation...}                                                                                                                                            
Script     1.1.0      Az.PolicyInsights                   {Get-AzPolicyEvent, Get-AzPolicyState, Get-AzPolicyStateSummary, Get-AzPolicyRemediation...}                                                                                                                                            
Script     1.1.1      Az.PowerBIEmbedded                  {Remove-AzPowerBIWorkspaceCollection, Get-AzPowerBIWorkspaceCollection, Get-AzPowerBIWorkspaceCollectionAccessKey, Get-AzPowerBIWorkspace...}                                                                                           
Script     1.1.0      Az.PowerBIEmbedded                  {Remove-AzPowerBIWorkspaceCollection, Get-AzPowerBIWorkspaceCollection, Get-AzPowerBIWorkspaceCollectionAccessKey, Get-AzPowerBIWorkspace...}                                                                                           
Script     1.0.2      Az.PrivateDns                       {Get-AzPrivateDnsZone, Remove-AzPrivateDnsZone, Set-AzPrivateDnsZone, New-AzPrivateDnsZone...}                                                                                                                                          
Script     2.5.0      Az.RecoveryServices                 {Get-AzRecoveryServicesBackupProperty, Get-AzRecoveryServicesVault, Get-AzRecoveryServicesVaultSettingsFile, New-AzRecoveryServicesVault...}                                                                                            
Script     2.4.0      Az.RecoveryServices                 {Get-AzRecoveryServicesBackupProperty, Get-AzRecoveryServicesVault, Get-AzRecoveryServicesVaultSettingsFile, New-AzRecoveryServicesVault...}                                                                                            
Script     1.4.0      Az.RecoveryServices                 {Get-AzRecoveryServicesBackupProperty, Get-AzRecoveryServicesVault, Get-AzRecoveryServicesVaultSettingsFile, New-AzRecoveryServicesVault...}                                                                                            
Script     1.2.1      Az.RedisCache                       {Remove-AzRedisCachePatchSchedule, New-AzRedisCacheScheduleEntry, Get-AzRedisCachePatchSchedule, New-AzRedisCachePatchSchedule...}                                                                                                      
Script     1.1.0      Az.RedisCache                       {Remove-AzRedisCachePatchSchedule, New-AzRedisCacheScheduleEntry, Get-AzRedisCachePatchSchedule, New-AzRedisCachePatchSchedule...}                                                                                                      
Script     1.0.3      Az.Relay                            {New-AzRelayNamespace, Get-AzRelayNamespace, Set-AzRelayNamespace, Remove-AzRelayNamespace...}                                                                                                                                          
Script     1.0.1      Az.Relay                            {New-AzRelayNamespace, Get-AzRelayNamespace, Set-AzRelayNamespace, Remove-AzRelayNamespace...}                                                                                                                                          
Script     0.7.1      Az.Reservations                     {Get-AzReservationOrder, Get-AzReservation, Get-AzReservationHistory, Update-AzReservation...}                                                                                                                                          
Script     1.10.0     Az.Resources                        {Get-AzProviderOperation, Remove-AzRoleAssignment, Get-AzRoleAssignment, New-AzRoleAssignment...}                                                                                                                                       
Script     1.9.1      Az.Resources                        {Get-AzProviderOperation, Remove-AzRoleAssignment, Get-AzRoleAssignment, New-AzRoleAssignment...}                                                                                                                                       
Script     1.4.0      Az.Resources                        {Get-AzProviderOperation, Remove-AzRoleAssignment, Get-AzRoleAssignment, New-AzRoleAssignment...}                                                                                                                                       
Script     0.7.6      Az.Security                         {Get-AzSecurityAlert, Set-AzSecurityAlert, Get-AzSecurityAutoProvisioningSetting, Set-AzSecurityAutoProvisioningSetting...}                                                                                                             
Script     1.4.1      Az.ServiceBus                       {New-AzServiceBusNamespace, Get-AzServiceBusNamespace, Set-AzServiceBusNamespace, Remove-AzServiceBusNamespace...}                                                                                                                      
Script     1.1.0      Az.ServiceBus                       {New-AzServiceBusNamespace, Get-AzServiceBusNamespace, Set-AzServiceBusNamespace, Remove-AzServiceBusNamespace...}                                                                                                                      
Script     2.0.1      Az.ServiceFabric                    {Add-AzServiceFabricClientCertificate, Add-AzServiceFabricClusterCertificate, Add-AzServiceFabricNode, Add-AzServiceFabricNodeType...}                                                                                                  
Script     1.0.1      Az.ServiceFabric                    {Add-AzServiceFabricApplicationCertificate, Add-AzServiceFabricClientCertificate, Add-AzServiceFabricClusterCertificate, Add-AzServiceFabricNode...}                                                                                    
Script     1.1.1      Az.SignalR                          {New-AzSignalR, Get-AzSignalR, Get-AzSignalRKey, New-AzSignalRKey...}                                                                                                                                                                   
Script     1.0.2      Az.SignalR                          {New-AzSignalR, Get-AzSignalR, Get-AzSignalRKey, New-AzSignalRKey...}                                                                                                                                                                   
Script     2.2.0      Az.Sql                              {Get-AzSqlDatabaseTransparentDataEncryption, Get-AzSqlDatabaseTransparentDataEncryptionActivity, Set-AzSqlDatabaseTransparentDataEncryption, Get-AzSqlDatabaseUpgradeHint...}                                                           
Script     2.1.2      Az.Sql                              {Get-AzSqlDatabaseTransparentDataEncryption, Get-AzSqlDatabaseTransparentDataEncryptionActivity, Set-AzSqlDatabaseTransparentDataEncryption, Get-AzSqlDatabaseUpgradeHint...}                                                           
Script     1.10.0     Az.Sql                              {Get-AzSqlDatabaseTransparentDataEncryption, Get-AzSqlDatabaseTransparentDataEncryptionActivity, Set-AzSqlDatabaseTransparentDataEncryption, Get-AzSqlDatabaseUpgradeHint...}                                                           
Script     1.0.2      Az.SqlVirtualMachine                {New-AzSqlVM, Get-AzSqlVM, Update-AzSqlVM, Remove-AzSqlVM...}                                                                                                                                                                           
Script     1.12.0     Az.Storage                          {Get-AzStorageAccount, Get-AzStorageAccountKey, New-AzStorageAccount, New-AzStorageAccountKey...}                                                                                                                                       
Script     1.11.0     Az.Storage                          {Get-AzStorageAccount, Get-AzStorageAccountKey, New-AzStorageAccount, New-AzStorageAccountKey...}                                                                                                                                       
Script     1.3.0      Az.Storage                          {Get-AzStorageAccount, Get-AzStorageAccountKey, New-AzStorageAccount, New-AzStorageAccountKey...}                                                                                                                                       
Script     1.2.2      Az.StorageSync                      {Invoke-AzStorageSyncCompatibilityCheck, New-AzStorageSyncService, Get-AzStorageSyncService, Remove-AzStorageSyncService...}                                                                                                            
Script     1.0.1      Az.StreamAnalytics                  {Get-AzStreamAnalyticsFunction, Get-AzStreamAnalyticsDefaultFunctionDefinition, New-AzStreamAnalyticsFunction, Remove-AzStreamAnalyticsFunction...}                                                                                     
Script     1.0.0      Az.StreamAnalytics                  {Get-AzStreamAnalyticsFunction, Get-AzStreamAnalyticsDefaultFunctionDefinition, New-AzStreamAnalyticsFunction, Remove-AzStreamAnalyticsFunction...}                                                                                     
Script     1.0.3      Az.TrafficManager                   {Add-AzTrafficManagerCustomHeaderToEndpoint, Remove-AzTrafficManagerCustomHeaderFromEndpoint, Add-AzTrafficManagerCustomHeaderToProfile, Remove-AzTrafficManagerCustomHeaderFromProfile...}                                             
Script     1.0.1      Az.TrafficManager                   {Add-AzTrafficManagerCustomHeaderToEndpoint, Remove-AzTrafficManagerCustomHeaderFromEndpoint, Add-AzTrafficManagerCustomHeaderToProfile, Remove-AzTrafficManagerCustomHeaderFromProfile...}                                             
Script     1.6.0      Az.Websites                         {Get-AzAppServicePlan, Set-AzAppServicePlan, New-AzAppServicePlan, Remove-AzAppServicePlan...}                                                                                                                                          
Script     1.5.1      Az.Websites                         {Get-AzAppServicePlan, Set-AzAppServicePlan, New-AzAppServicePlan, Remove-AzAppServicePlan...}                                                                                                                                          
Script     1.2.1      Az.Websites                         {Get-AzAppServicePlan, Set-AzAppServicePlan, New-AzAppServicePlan, Remove-AzAppServicePlan...}   

Debug output

PS C:\Windows\system32> get-azadserviceprincipal
DEBUG: 10:44:34 AM - GetAzureADServicePrincipalCommand begin processing with ParameterSet 'EmptyParameterSet'.
DEBUG: 10:44:34 AM - using account id '****@directory.va.gov'...
DEBUG: [Common.Authentication]: Authenticating using Account: '**@directory.va.gov', environment: 'AzureUSGovernment', tenant: 'f7c49e36-971b-42c7-b244-a88eed6c0bf6'
DEBUG: [Common.Authentication]: Authenticating using configuration values: Domain: 'f7c49e36-971b-42c7-b244-a88eed6c0bf6', Endpoint: 'https://login.microsoftonline.us/', ClientId: '1950a258-227b-4e31-a9cf-717495945fc2', ClientRedirect: 'urn:ietf:wg:oauth:2.0:oob', ResourceClientUri: 'https:
//graph.windows.net/', ValidateAuthority: 'True'
DEBUG: [Common.Authentication]: Acquiring token using context with Authority 'https://login.microsoftonline.us/f7c49e36-971b-42c7-b244-a88eed6c0bf6/', CorrelationId: '00000000-0000-0000-0000-000000000000', ValidateAuthority: 'True'
DEBUG: [Common.Authentication]: Acquiring token using AdalConfiguration with Domain: 'f7c49e36-971b-42c7-b244-a88eed6c0bf6', AdEndpoint: 'https://login.microsoftonline.us/', ClientId: '1950a258-227b-4e31-a9cf-717495945fc2', ClientRedirectUri: urn:ietf:wg:oauth:2.0:oob
DEBUG: [ADAL]: Information: 2020-02-24T15:44:34.4609986Z: a810120c-7c54-418d-8b55-0551bd9cfbff - LoggerBase.cs: ADAL PCL.Desktop with assembly version '3.19.2.6005', file version '3.19.50302.0130' and informational version '2a8bec6c4c76d0c1ef819b55bdc3cda2d2605056' is running...

DEBUG: [ADAL]: Information: 2020-02-24T15:44:34.4609986Z: a810120c-7c54-418d-8b55-0551bd9cfbff - LoggerBase.cs: ADAL PCL.Desktop with assembly version '3.19.2.6005', file version '3.19.50302.0130' and informational version '2a8bec6c4c76d0c1ef819b55bdc3cda2d2605056' is running...

DEBUG: [ADAL]: Information: 2020-02-24T15:44:34.4609986Z: a810120c-7c54-418d-8b55-0551bd9cfbff - LoggerBase.cs: === Token Acquisition started: 
       CacheType: null
       Authentication Target: User
       , Authority Host: login.microsoftonline.us

DEBUG: [ADAL]: Information: 2020-02-24T15:44:34.4609986Z: a810120c-7c54-418d-8b55-0551bd9cfbff - LoggerBase.cs: === Token Acquisition started:
       Authority: https://login.microsoftonline.us/f7c49e36-971b-42c7-b244-a88eed6c0bf6/
       Resource: https://graph.windows.net/
       ClientId: 1950a258-227b-4e31-a9cf-717495945fc2
       CacheType: null
       Authentication Target: User

DEBUG: [ADAL]: Verbose: 2020-02-24T15:44:34.4609986Z: a810120c-7c54-418d-8b55-0551bd9cfbff - LoggerBase.cs: Loading from cache.

DEBUG: [ADAL]: Verbose: 2020-02-24T15:44:34.4609986Z: a810120c-7c54-418d-8b55-0551bd9cfbff - LoggerBase.cs: Loading from cache.

DEBUG: [ADAL]: Information: 2020-02-24T15:44:34.4609986Z: 00000000-0000-0000-0000-000000000000 - LoggerBase.cs: Deserialized 8 items to token cache.

DEBUG: [ADAL]: Verbose: 2020-02-24T15:44:34.4609986Z: a810120c-7c54-418d-8b55-0551bd9cfbff - LoggerBase.cs: Looking up cache for a token...

DEBUG: [ADAL]: Verbose: 2020-02-24T15:44:34.4609986Z: a810120c-7c54-418d-8b55-0551bd9cfbff - LoggerBase.cs: Looking up cache for a token...

DEBUG: [ADAL]: Information: 2020-02-24T15:44:34.4609986Z: a810120c-7c54-418d-8b55-0551bd9cfbff - LoggerBase.cs: An item matching the requested resource was found in the cache

DEBUG: [ADAL]: Information: 2020-02-24T15:44:34.4609986Z: a810120c-7c54-418d-8b55-0551bd9cfbff - LoggerBase.cs: An item matching the requested resource was found in the cache

DEBUG: [ADAL]: Information: 2020-02-24T15:44:34.4609986Z: a810120c-7c54-418d-8b55-0551bd9cfbff - LoggerBase.cs: 52.31326669 minutes left until token in cache expires

DEBUG: [ADAL]: Information: 2020-02-24T15:44:34.4609986Z: a810120c-7c54-418d-8b55-0551bd9cfbff - LoggerBase.cs: 52.31326669 minutes left until token in cache expires

DEBUG: [ADAL]: Information: 2020-02-24T15:44:34.4609986Z: a810120c-7c54-418d-8b55-0551bd9cfbff - LoggerBase.cs: A matching item (access token or refresh token or both) was found in the cache

DEBUG: [ADAL]: Information: 2020-02-24T15:44:34.4609986Z: a810120c-7c54-418d-8b55-0551bd9cfbff - LoggerBase.cs: A matching item (access token or refresh token or both) was found in the cache

DEBUG: [ADAL]: Information: 2020-02-24T15:44:34.4609986Z: a810120c-7c54-418d-8b55-0551bd9cfbff - LoggerBase.cs: === Token Acquisition finished successfully. An access token was returned: Expiration Time: 2/24/2020 4:36:53 PM +00:00

DEBUG: [ADAL]: Information: 2020-02-24T15:44:34.4609986Z: a810120c-7c54-418d-8b55-0551bd9cfbff - LoggerBase.cs: === Token Acquisition finished successfully. An access token was returned: Expiration Time: 2/24/2020 4:36:53 PM +00:00Access Token Hash: ACLQ5MbOBr2w1Sy6kYCpEkTai1/z9QDN50rgS5jR/
4g=
       User id: 9080eb0d-1477-40b5-9812-6e1e232f67d1

DEBUG: [Common.Authentication]: Renewing Token with Type: 'Bearer', Expiry: '02/24/2020 16:36:53 +00:00', MultipleResource? 'True', Tenant: 'f7c49e36-971b-42c7-b244-a88eed6c0bf6', UserId: '***@directory.va.gov'
DEBUG: [Common.Authentication]: User info for token DisplayId: '***@directory.va.gov', Name: Matthew Taylor0, IdProvider: 'https://sts.windows.net/f7c49e36-971b-42c7-b244-a88eed6c0bf6/', Uid: '9080eb0d-1477-40b5-9812-6e1e232f67d1'
DEBUG: [Common.Authentication]: Checking token expiration, token expires '02/24/2020 16:36:53 +00:00' Comparing to '02/24/2020 15:44:34 +00:00' With threshold '00:05:00', calculated time until token expiry: '00:52:18.7491045'
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://graph.windows.net/f7c49e36-971b-42c7-b244-a88eed6c0bf6/servicePrincipals?api-version=1.6

Headers:
x-ms-client-request-id        : a3848aff-aff8-443a-b9ca-63eb17f78ddf
accept-language               : en-US

Body:

DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
InternalServerError

Headers:
client-request-id             : 7a9d689c-4469-4b77-885c-3123535e328d
Duration                      : 1964676,2491644,4353497,4949450,6473941,8151625,10125351,11745850,13828187,14378095,15958593,16452860,18448788,20199954,21734439,22018259,25093744,27387409,30747259,33398022,35497304,36133049,37773079,38064614,41175451,43186728,45076182,45352656,48204394,4860
5337
Cache-Control                 : private
Date                          : Mon, 24 Feb 2020 15:45:13 GMT

Body:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"[]>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>500 - Internal server error.</title>
    <style type="text/css">
      <!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;} 
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;} 
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} 
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
    </style>
  </head>
  <body>
    <div id="header">
      <h1>Server Error</h1>
    </div>
    <div id="content">
      <div class="content-container">
        <fieldset>
          <h2>500 - Internal server error.</h2>
          <h3>There is a problem with the resource you are looking for, and it cannot be displayed.</h3>
        </fieldset>
      </div>
    </div>
  </body>
</html>

DEBUG: Caught exception, type: Microsoft.Azure.Graph.RBAC.Models.GraphErrorException
get-azadserviceprincipal : Operation returned an invalid status code 'InternalServerError'
At line:1 char:1
+ get-azadserviceprincipal
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Get-AzADServicePrincipal], GraphErrorException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.ActiveDirectory.GetAzureADServicePrincipalCommand

DEBUG: AzureQoSEvent: CommandName - Get-AzADServicePrincipal; IsSuccess - False; Duration - 00:00:39.5696713; Exception - Microsoft.Azure.Graph.RBAC.Models.GraphErrorException: Operation returned an invalid status code 'InternalServerError'
   at Microsoft.Azure.Graph.RBAC.ServicePrincipalsOperations.<ListWithHttpMessagesAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Graph.RBAC.ServicePrincipalsOperationsExtensions.<ListAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Graph.RBAC.ServicePrincipalsOperationsExtensions.List(IServicePrincipalsOperations operations, ODataQuery`1 odataQuery)
   at Microsoft.Azure.Commands.ResourceManager.Common.Paging.GenericPageEnumerator`1..ctor(Func`1 list, Func`2 listNext, UInt64 first, UInt64 skip)
   at Microsoft.Azure.Commands.ResourceManager.Common.Paging.GenericPageEnumerable`1.GetEnumerator()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Management.Automation.MshCommandRuntime._WriteObjectsSkipAllowCheck(Object sendToPipeline)
   at System.Security.SecurityContext.Run(SecurityContext securityContext, ContextCallback callback, Object state)
   at System.Management.Automation.MshCommandRuntime.WriteObject(Object sendToPipeline, Boolean enumerateCollection)
   at System.Management.Automation.Cmdlet.WriteObject(Object sendToPipeline, Boolean enumerateCollection)
   at Microsoft.Azure.Commands.ActiveDirectory.GetAzureADServicePrincipalCommand.<ExecuteCmdlet>b__24_0()
   at Microsoft.Azure.Commands.ActiveDirectory.ActiveDirectoryBaseCmdlet.ExecutionBlock(Action execAction);
DEBUG: Finish sending metric.
DEBUG: 10:45:14 AM - GetAzureADServicePrincipalCommand end processing.
DEBUG: 10:45:14 AM - GetAzureADServicePrincipalCommand end processing. 

Error output

PS C:\Windows\system32> Resolve-AzError
WARNING: Breaking changes in the cmdlet 'Resolve-AzError' :
WARNING:  - The `Resolve-Error` alias will be removed in a future release.  Please change any scripts that use this alias to use `Resolve-AzError` instead.

WARNING: NOTE : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell.

   HistoryId: 1

Message        : Operation returned an invalid status code 'InternalServerError'
StackTrace     :    at Microsoft.Azure.Graph.RBAC.ServicePrincipalsOperations.<ListWithHttpMessagesAsync>d__6.MoveNext()
                 --- End of stack trace from previous location where exception was thrown ---
                    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
                    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
                    at Microsoft.Azure.Graph.RBAC.ServicePrincipalsOperationsExtensions.<ListAsync>d__3.MoveNext()
                 --- End of stack trace from previous location where exception was thrown ---
                    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
                    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
                    at Microsoft.Azure.Graph.RBAC.ServicePrincipalsOperationsExtensions.List(IServicePrincipalsOperations operations, ODataQuery`1 odataQuery)
                    at Microsoft.Azure.Commands.ResourceManager.Common.Paging.GenericPageEnumerator`1..ctor(Func`1 list, Func`2 listNext, UInt64 first, UInt64 skip)
                    at Microsoft.Azure.Commands.ResourceManager.Common.Paging.GenericPageEnumerable`1.GetEnumerator()
                    at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
                    at System.Management.Automation.MshCommandRuntime._WriteObjectsSkipAllowCheck(Object sendToPipeline)
                    at System.Security.SecurityContext.Run(SecurityContext securityContext, ContextCallback callback, Object state)
                   at System.Management.Automation.MshCommandRuntime.WriteObject(Object sendToPipeline, Boolean enumerateCollection)
                    at System.Management.Automation.Cmdlet.WriteObject(Object sendToPipeline, Boolean enumerateCollection)
                    at Microsoft.Azure.Commands.ActiveDirectory.GetAzureADServicePrincipalCommand.<ExecuteCmdlet>b__24_0()
                    at Microsoft.Azure.Commands.ActiveDirectory.ActiveDirectoryBaseCmdlet.ExecutionBlock(Action execAction)
Exception      : Microsoft.Azure.Graph.RBAC.Models.GraphErrorException
InvocationInfo : {Get-AzADServicePrincipal}
Line           : get-azadserviceprincipal
Position       : At line:1 char:1
                 + get-azadserviceprincipal
                 + ~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 1 
wyunchi-ms commented 4 years ago

Hi @mattyt0406 . thanks for your feedback! Could you tell us which GovCloud are you using?

mattyt0406 commented 4 years ago

Fairfax

mattyt0406 commented 4 years ago

Hi @wyunchi-ms just checking in to see if any updates?

wyunchi-ms commented 4 years ago

Hi @mattyt0406 , sorry for the late response.

  1. Which gov cloud are you using?
  2. Could you please give us the GraphUrl of the cloud you are using. You can get the info by executing
    Get-AzEnvironment | fl
mattyt0406 commented 4 years ago

AzureUSGovernment

mattyt0406 commented 4 years ago

https://graph.windows.net

erich-wang commented 4 years ago

@mattyt0406 , do you have permission to view service principals in portal using your account ***@directory.va.gov (i.e. Azure AD->App registration-> All applications)? If you do have the permission, probably it is service related issue, and I'll route to service team.

BTW, are you able to successfully run other cmdlets like Get-AzSubscription? And how about

New-AzADServicePrincipal -DisplayName erichtest1
mattyt0406 commented 4 years ago

Erich, yes global/sub admin. I showed this to CSS yesterday that it errors out from both the API standpoint and PowerShell

ghost commented 4 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @adamedx.

dingmeng-xue commented 4 years ago

@mattyt0406 , do you still can see the same error? Can you see get service principal on Portal?

mattyt0406 commented 4 years ago

@dingmeng-xue - this appears to have been fixed. What was the resolution or what caused the break?

dingmeng-xue commented 4 years ago

@mattyt0406, I believe it was server side issue. We have no information because no service API is changed. I close this issue and please contact if you have any further question.