Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.12k stars 3.76k forks source link

Intermittent authorization issue when using Azure PowerShell #25047

Open gsuttie opened 1 month ago

gsuttie commented 1 month ago

Description

We use a lot of Azure PowerShell cmdlets when performing maintenance on our environment.

Some cmdlets give an authorization error which we cannot explain. The error does not always occur, but it does very often. The strange thing is that my permissions are not changed between when it does work and when it does not. And the other strange thing is that some Azure PowerShell cmdlets does work when that authorization error occurs.

We cannot find the cause for this. We think it has to do with the fact that have multiple Azure tenants, and that the browser already logged on to one of them.

To give an example, when I run these commands:

Connect-AzAccount -TenantId

Select-AzSubscription -SubscriptionId

Get-AzStorageAccountKey -ResourceGroupName -AccountName

Then I get this error:

Get-AzStorageAccountKey : The client '<redacted' with object id '' does not have authorization to perform action 'Microsoft.Storage/storageAccounts/listKeys/action' over scope '/subscriptions//resourceGroups//providers/Microsoft.Storage/storageAccounts/' or the scope is invalid. If access was recently granted, please refresh your credentials.

When I try that same script for instance the next day (after being logged out), the script does work correctly.

Do you have any idea where we should look for the cause for this?

Issue script & Debug output

n/a

Environment data

Name                           Value
----                           -----
PSVersion                      7.4.2
PSEdition                      Core
GitCommitId                    7.4.2
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

Get-Module -ListAvailable Az*

    Directory: U:\PowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     10.4.1                Az                                  Core,Desk
Script     9.5.0                 Az                                  Core,Desk
Script     2.13.1                Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzCo…
Script     2.12.1                Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzCo…
Script     2.0.0                 Az.Advisor                          Core,Desk {Disable-AzAdvisorRecommendation, Enabl…
Script     5.5.1                 Az.Aks                              Core,Desk {Get-AzAksCluster, New-AzAksCluster, Re…
Script     5.3.1                 Az.Aks                              Core,Desk {Get-AzAksCluster, New-AzAksCluster, Re…
Script     1.1.4                 Az.AnalysisServices                 Core,Desk {Resume-AzAnalysisServicesServer, Suspe…
Script     4.0.2                 Az.ApiManagement                    Core,Desk {Add-AzApiManagementApiToGateway, Add-A…
Script     1.3.0                 Az.AppConfiguration                 Core,Desk {Get-AzAppConfigurationStore, Get-AzApp…
Script     1.2.0                 Az.AppConfiguration                 Core,Desk {Get-AzAppConfigurationStore, Get-AzApp…
Script     2.2.2                 Az.ApplicationInsights              Core,Desk {Get-AzApplicationInsights, Get-AzAppli…
Script     1.0.0                 Az.ArcResourceBridge                Core,Desk {Get-AzArcResourceBridge, Get-AzArcReso…
Script     2.0.0                 Az.Attestation                      Core,Desk {Get-AzAttestationPolicy, Set-AzAttesta…
Script     1.0.0                 Az.Automanage                       Core,Desk {Get-AzAutomanageBestPractice, Get-AzAu…
Script     1.9.1                 Az.Automation                       Core,Desk {Set-AzAutomationPython3Package, New-Az…
Script     3.5.0                 Az.Batch                            Core,Desk {Remove-AzBatchAccount, Get-AzBatchAcco…
Script     3.3.0                 Az.Batch                            Core,Desk {Remove-AzBatchAccount, Get-AzBatchAcco…
Script     2.0.3                 Az.Billing                          Core,Desk {Get-AzBillingInvoice, Get-AzBillingPer…
Script     2.0.0                 Az.Billing                          Core,Desk {Get-AzBillingInvoice, Get-AzBillingPer…
Script     3.1.1                 Az.Cdn                              Core,Desk {Clear-AzCdnEndpointContent, Clear-AzFr…
Script     2.1.0                 Az.Cdn                              Core,Desk {Clear-AzCdnEndpointContent, Clear-AzFr…
Script     1.2.0                 Az.CloudService                     Core,Desk {Get-AzCloudService, Get-AzCloudService…
Script     1.14.0                Az.CognitiveServices                Core,Desk {Get-AzCognitiveServicesAccount, Get-Az…
Script     1.13.0                Az.CognitiveServices                Core,Desk {Get-AzCognitiveServicesAccount, Get-Az…
Script     6.3.0                 Az.Compute                          Core,Desk {Remove-AzAvailabilitySet, Get-AzAvaila…
Script     5.5.0                 Az.Compute                          Core,Desk {Remove-AzAvailabilitySet, Get-AzAvaila…
Script     1.0.0                 Az.ConfidentialLedger               Core,Desk {Get-AzConfidentialLedger, New-AzConfid…
Script     3.2.2                 Az.ContainerInstance                Core,Desk {Add-AzContainerInstanceOutput, Get-AzC…
Script     3.2.0                 Az.ContainerInstance                Core,Desk {Add-AzContainerInstanceOutput, Get-AzC…
Script     4.1.1                 Az.ContainerRegistry                Core,Desk {Connect-AzContainerRegistry, Get-AzCon…
Script     3.0.2                 Az.ContainerRegistry                Core,Desk {New-AzContainerRegistry, Get-AzContain…
Script     1.12.0                Az.CosmosDB                         Core,Desk {Get-AzCosmosDBSqlContainer, Get-AzCosm…
Script     1.9.1                 Az.CosmosDB                         Core,Desk {Get-AzCosmosDBSqlContainer, Get-AzCosm…
Script     1.1.0                 Az.DataBoxEdge                      Core,Desk {Get-AzDataBoxEdgeJob, Get-AzDataBoxEdg…
Script     1.7.0                 Az.Databricks                       Core,Desk {Get-AzDatabricksAccessConnector, Get-A…
Script     1.5.0                 Az.Databricks                       Core,Desk {Get-AzDatabricksAccessConnector, Get-A…
Script     1.17.0                Az.DataFactory                      Core,Desk {Set-AzDataFactoryV2, Update-AzDataFact…
Script     1.16.13               Az.DataFactory                      Core,Desk {Set-AzDataFactoryV2, Update-AzDataFact…
Script     1.0.3                 Az.DataLakeAnalytics                Core,Desk {Get-AzDataLakeAnalyticsDataSource, New…
Script     1.0.2                 Az.DataLakeAnalytics                Core,Desk {Get-AzDataLakeAnalyticsDataSource, New…
Script     1.3.0                 Az.DataLakeStore                    Core,Desk {Get-AzDataLakeStoreTrustedIdProvider, …
Script     2.1.0                 Az.DataProtection                   Core,Desk {Backup-AzDataProtectionBackupInstanceA…
Script     1.1.0                 Az.DataProtection                   Core,Desk {Backup-AzDataProtectionBackupInstanceA…
Script     1.0.1                 Az.DataShare                        Core,Desk {New-AzDataShareAccount, Get-AzDataShar…
Script     1.1.0                 Az.DeploymentManager                Core,Desk {Get-AzDeploymentManagerArtifactSource,…
Script     4.0.0                 Az.DesktopVirtualization            Core,Desk {Disconnect-AzWvdUserSession, Expand-Az…
Script     3.1.1                 Az.DesktopVirtualization            Core,Desk {Disconnect-AzWvdUserSession, Expand-Az…
Script     1.0.2                 Az.DevTestLabs                      Core,Desk {Get-AzDtlAllowedVMSizesPolicy, Get-AzD…
Script     1.1.3                 Az.Dns                              Core,Desk {Get-AzDnsRecordSet, New-AzDnsRecordCon…
Script     1.1.2                 Az.Dns                              Core,Desk {Get-AzDnsRecordSet, New-AzDnsRecordCon…
Script     1.6.0                 Az.EventGrid                        Core,Desk {New-AzEventGridTopic, Get-AzEventGridT…
Script     1.5.0                 Az.EventGrid                        Core,Desk {New-AzEventGridTopic, Get-AzEventGridT…
Script     4.1.0                 Az.EventHub                         Core,Desk {New-AzEventHubAuthorizationRuleSASToke…
Script     3.2.2                 Az.EventHub                         Core,Desk {New-AzEventHubNamespace, Get-AzEventHu…
Script     1.10.0                Az.FrontDoor                        Core,Desk {New-AzFrontDoor, Get-AzFrontDoor, Set-…
Script     4.0.6                 Az.Functions                        Core,Desk {Get-AzFunctionApp, Get-AzFunctionAppAv…
Script     6.0.1                 Az.HDInsight                        Core,Desk {Get-AzHDInsightJob, New-AzHDInsightSqo…
Script     5.0.1                 Az.HDInsight                        Core,Desk {Get-AzHDInsightJob, New-AzHDInsightSqo…
Script     2.0.0                 Az.HealthcareApis                   Core,Desk {Get-AzHealthcareApisService, Get-AzHea…
Script     2.7.5                 Az.IotHub                           Core,Desk {Add-AzIotHubKey, Get-AzIotHubEventHubC…
Script     4.12.0                Az.KeyVault                         Core,Desk {Add-AzKeyVaultCertificate, Update-AzKe…
Script     4.9.2                 Az.KeyVault                         Core,Desk {Add-AzKeyVaultCertificate, Update-AzKe…
Script     2.2.0                 Az.Kusto                            Core,Desk {Add-AzKustoClusterLanguageExtension, A…
Script     2.1.0                 Az.Kusto                            Core,Desk {Add-AzKustoClusterLanguageExtension, A…
Script     1.0.0                 Az.LoadTesting                      Core,Desk {Get-AzLoad, New-AzLoad, Remove-AzLoad,…
Script     1.5.0                 Az.LogicApp                         Core,Desk {Get-AzIntegrationAccountAgreement, Get…
Script     1.1.3                 Az.MachineLearning                  Core,Desk {Move-AzMlCommitmentAssociation, Get-Az…
Script     1.0.0                 Az.MachineLearningServices          Core,Desk {Get-AzMLServiceQuota, Get-AzMLServiceU…
Script     1.3.1                 Az.Maintenance                      Core,Desk {Get-AzApplyUpdate, Get-AzConfiguration…
Script     1.2.1                 Az.Maintenance                      Core,Desk {Get-AzApplyUpdate, Get-AzConfiguration…
Script     1.1.1                 Az.ManagedServiceIdentity           Core,Desk {Get-AzFederatedIdentityCredentials, Ge…
Script     3.0.0                 Az.ManagedServices                  Core,Desk {Get-AzManagedServicesAssignment, Get-A…
Script     2.0.0                 Az.MarketplaceOrdering              Core,Desk {Get-AzMarketplaceTerms, Invoke-AzMarke…
Script     1.1.2                 Az.Media                            Core,Desk {Sync-AzMediaServiceStorageKey, Set-AzM…
Script     1.1.1                 Az.Media                            Core,Desk {Sync-AzMediaServiceStorageKey, Set-AzM…
Script     2.2.0                 Az.Migrate                          Core,Desk {Get-AzMigrateDiscoveredServer, Get-AzM…
Script     2.1.0                 Az.Migrate                          Core,Desk {Get-AzMigrateDiscoveredServer, Get-AzM…
Script     4.6.0                 Az.Monitor                          Core,Desk {Get-AzMetricDefinition, Get-AzMetric, …
Script     4.4.1                 Az.Monitor                          Core,Desk {Get-AzMetricDefinition, Get-AzMetric, …
Script     1.1.1                 Az.MySql                            Core,Desk {Get-AzMySqlConfiguration, Get-AzMySqlC…
Script     1.1.0                 Az.MySql                            Core,Desk {Get-AzMySqlConfiguration, Get-AzMySqlC…
Script     6.2.0                 Az.Network                          Core,Desk {Add-AzApplicationGatewayAuthentication…
Script     5.5.0                 Az.Network                          Core,Desk {Add-AzApplicationGatewayAuthentication…
Script     1.1.2                 Az.NotificationHubs                 Core,Desk {Get-AzNotificationHub, Get-AzNotificat…
Script     1.1.1                 Az.NotificationHubs                 Core,Desk {Get-AzNotificationHub, Get-AzNotificat…
Script     3.2.0                 Az.OperationalInsights              Core,Desk {New-AzOperationalInsightsAzureActivity…
Script     1.6.3                 Az.PolicyInsights                   Core,Desk {Get-AzPolicyEvent, Get-AzPolicyState, …
Script     1.6.0                 Az.PolicyInsights                   Core,Desk {Get-AzPolicyEvent, Get-AzPolicyState, …
Script     1.1.0                 Az.PostgreSql                       Core,Desk {Get-AzPostgreSqlConfiguration, Get-AzP…
Script     1.2.1                 Az.PowerBIEmbedded                  Core,Desk {Remove-AzPowerBIWorkspaceCollection, G…
Script     1.2.0                 Az.PowerBIEmbedded                  Core,Desk {Remove-AzPowerBIWorkspaceCollection, G…
Script     1.0.4                 Az.PrivateDns                       Core,Desk {Get-AzPrivateDnsZone, Remove-AzPrivate…
Script     1.0.3                 Az.PrivateDns                       Core,Desk {Get-AzPrivateDnsZone, Remove-AzPrivate…
Script     6.6.0                 Az.RecoveryServices                 Core,Desk {Get-AzRecoveryServicesBackupProperty, …
Script     6.3.0                 Az.RecoveryServices                 Core,Desk {Get-AzRecoveryServicesBackupProperty, …
Script     1.8.0                 Az.RedisCache                       Core,Desk {Remove-AzRedisCachePatchSchedule, New-…
Script     1.7.1                 Az.RedisCache                       Core,Desk {Remove-AzRedisCachePatchSchedule, New-…
Script     1.2.0                 Az.RedisEnterpriseCache             Core,Desk {Export-AzRedisEnterpriseCache, Get-AzR…
Script     1.1.0                 Az.RedisEnterpriseCache             Core,Desk {Export-AzRedisEnterpriseCache, Get-AzR…
Script     2.0.0                 Az.Relay                            Core,Desk {Get-AzRelayAuthorizationRule, Get-AzRe…
Script     1.0.4                 Az.Relay                            Core,Desk {New-AzRelayNamespace, Get-AzRelayNames…
Script     1.2.0                 Az.ResourceMover                    Core,Desk {Add-AzResourceMoverMoveResource, Get-A…
Script     1.1.0                 Az.ResourceMover                    Core,Desk {Add-AzResourceMoverMoveResource, Get-A…
Script     6.11.1                Az.Resources                        Core,Desk {Get-AzProviderOperation, Remove-AzRole…
Script     6.5.3                 Az.Resources                        Core,Desk {Get-AzProviderOperation, Remove-AzRole…
Script     1.4.0                 Az.Security                         Core,Desk {Get-AzSecuritySolution, Get-AzSecurity…
Script     3.1.0                 Az.SecurityInsights                 Core,Desk {Get-AzSentinelAlertRule, Get-AzSentine…
Script     3.0.1                 Az.SecurityInsights                 Core,Desk {Get-AzSentinelAlertRule, Get-AzSentine…
Script     3.0.0                 Az.ServiceBus                       Core,Desk {New-AzServiceBusAuthorizationRuleSASTo…
Script     2.2.0                 Az.ServiceBus                       Core,Desk {New-AzServiceBusNamespace, Get-AzServi…
Script     3.2.0                 Az.ServiceFabric                    Core,Desk {Add-AzServiceFabricClientCertificate, …
Script     3.1.1                 Az.ServiceFabric                    Core,Desk {Add-AzServiceFabricClientCertificate, …
Script     2.0.0                 Az.SignalR                          Core,Desk {New-AzSignalR, Get-AzSignalR, Get-AzSi…
Script     1.5.0                 Az.SignalR                          Core,Desk {New-AzSignalR, Get-AzSignalR, Get-AzSi…
Script     4.10.0                Az.Sql                              Core,Desk {Invoke-AzSqlServerExternalGovernanceSt…
Script     4.4.0                 Az.Sql                              Core,Desk {Get-AzSqlDatabaseTransparentDataEncryp…
Script     2.1.0                 Az.SqlVirtualMachine                Core,Desk {Get-AzAvailabilityGroupListener, Get-A…
Script     1.1.0                 Az.SqlVirtualMachine                Core,Desk {New-AzSqlVM, Get-AzSqlVM, Update-AzSql…
Script     2.2.0                 Az.StackHCI                         Core,Desk {Add-AzStackHCIVMAttestation, Disable-A…
Script     1.4.3                 Az.StackHCI                         Core,Desk {Add-AzStackHCIVMAttestation, Disable-A…
Script     5.10.1                Az.Storage                          Core,Desk {Get-AzStorageAccount, Get-AzStorageAcc…
Script     5.4.1                 Az.Storage                          Core,Desk {Get-AzStorageAccount, Get-AzStorageAcc…
Script     1.0.1                 Az.StorageMover                     Core,Desk {Get-AzStorageMover, Get-AzStorageMover…
Script     1.0.0                 Az.StorageMover                     Core,Desk {Get-AzStorageMover, Get-AzStorageMover…
Script     2.0.0                 Az.StorageSync                      Core,Desk {Invoke-AzStorageSyncCompatibilityCheck…
Script     1.7.0                 Az.StorageSync                      Core,Desk {Invoke-AzStorageSyncCompatibilityCheck…
Script     2.0.0                 Az.StreamAnalytics                  Core,Desk {Get-AzStreamAnalyticsCluster, Get-AzSt…
Script     1.0.0                 Az.Support                          Core,Desk {Get-AzSupportService, Get-AzSupportPro…
Script     3.0.3                 Az.Synapse                          Core,Desk {Get-AzSynapseSparkJob, Stop-AzSynapseS…
Script     2.3.0                 Az.Synapse                          Core,Desk {Get-AzSynapseSparkJob, Stop-AzSynapseS…
Script     1.2.1                 Az.TrafficManager                   Core,Desk {Add-AzTrafficManagerCustomHeaderToEndp…
Script     1.2.0                 Az.TrafficManager                   Core,Desk {Add-AzTrafficManagerCustomHeaderToEndp…
Script     3.1.1                 Az.Websites                         Core,Desk {Get-AzAppServicePlan, Set-AzAppService…
Script     2.13.0                Az.Websites                         Core,Desk {Get-AzAppServicePlan, Set-AzAppService…

    Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     11.4.0                Az                                  Core,Desk
Script     9.5.0                 Az                                  Core,Desk
Script     2.16.0                Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzCo…
Script     2.13.1                Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzCo…
Script     2.12.4                Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzCo…
Script     2.12.1                Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzCo…
Script     2.0.0                 Az.Advisor                          Core,Desk {Disable-AzAdvisorRecommendation, Enabl…
Script     6.0.1                 Az.Aks                              Core,Desk {Disable-AzAksAddOn, Enable-AzAksAddOn,…
Script     5.3.1                 Az.Aks                              Core,Desk {Get-AzAksCluster, New-AzAksCluster, Re…
Script     1.1.4                 Az.AnalysisServices                 Core,Desk {Resume-AzAnalysisServicesServer, Suspe…
Script     4.0.2                 Az.ApiManagement                    Core,Desk {Add-AzApiManagementApiToGateway, Add-A…
Script     1.0.0                 Az.App                              Core,Desk {Disable-AzContainerAppRevision, Enable…
Script     0.1.1                 Az.App                              Core,Desk {Disable-AzContainerAppRevision, Enable…
Script     1.3.0                 Az.AppConfiguration                 Core,Desk {Get-AzAppConfigurationStore, Get-AzApp…
Script     1.2.0                 Az.AppConfiguration                 Core,Desk {Get-AzAppConfigurationStore, Get-AzApp…
Script     2.2.3                 Az.ApplicationInsights              Core,Desk {Get-AzApplicationInsights, Get-AzAppli…
Script     2.2.2                 Az.ApplicationInsights              Core,Desk {Get-AzApplicationInsights, Get-AzAppli…
Script     1.0.0                 Az.ArcResourceBridge                Core,Desk {Get-AzArcResourceBridge, Get-AzArcReso…
Script     2.0.0                 Az.Attestation                      Core,Desk {Get-AzAttestationPolicy, Set-AzAttesta…
Script     1.0.0                 Az.Automanage                       Core,Desk {Get-AzAutomanageBestPractice, Get-AzAu…
Script     1.10.0                Az.Automation                       Core,Desk {Export-AzAutomationDscConfiguration, E…
Script     1.9.1                 Az.Automation                       Core,Desk {Set-AzAutomationPython3Package, New-Az…
Script     3.5.0                 Az.Batch                            Core,Desk {Remove-AzBatchAccount, Get-AzBatchAcco…
Script     3.3.0                 Az.Batch                            Core,Desk {Remove-AzBatchAccount, Get-AzBatchAcco…
Script     2.0.3                 Az.Billing                          Core,Desk {Get-AzBillingInvoice, Get-AzBillingPer…
Script     2.0.0                 Az.Billing                          Core,Desk {Get-AzBillingInvoice, Get-AzBillingPer…
Script     3.1.2                 Az.Cdn                              Core,Desk {Clear-AzCdnEndpointContent, Clear-AzFr…
Script     2.1.0                 Az.Cdn                              Core,Desk {Clear-AzCdnEndpointContent, Clear-AzFr…
Script     2.0.0                 Az.CloudService                     Core,Desk {Get-AzCloudService, Get-AzCloudService…
Script     1.2.0                 Az.CloudService                     Core,Desk {Get-AzCloudService, Get-AzCloudService…
Script     1.14.1                Az.CognitiveServices                Core,Desk {Get-AzCognitiveServicesAccount, Get-Az…
Script     1.13.0                Az.CognitiveServices                Core,Desk {Get-AzCognitiveServicesAccount, Get-Az…
Script     7.1.2                 Az.Compute                          Core,Desk {Add-AzImageDataDisk, Add-AzVhd, Add-Az…
Script     5.5.0                 Az.Compute                          Core,Desk {Remove-AzAvailabilitySet, Get-AzAvaila…
Script     1.0.0                 Az.ConfidentialLedger               Core,Desk {Get-AzConfidentialLedger, New-AzConfid…
Script     4.0.0                 Az.ContainerInstance                Core,Desk {Add-AzContainerInstanceOutput, Get-AzC…
Script     3.2.0                 Az.ContainerInstance                Core,Desk {Add-AzContainerInstanceOutput, Get-AzC…
Script     4.1.3                 Az.ContainerRegistry                Core,Desk {Connect-AzContainerRegistry, Get-AzCon…
Script     3.0.2                 Az.ContainerRegistry                Core,Desk {New-AzContainerRegistry, Get-AzContain…
Script     1.14.1                Az.CosmosDB                         Core,Desk {Get-AzCosmosDBAccount, Get-AzCosmosDBA…
Script     1.9.1                 Az.CosmosDB                         Core,Desk {Get-AzCosmosDBSqlContainer, Get-AzCosm…
Script     1.1.0                 Az.DataBoxEdge                      Core,Desk {Get-AzDataBoxEdgeJob, Get-AzDataBoxEdg…
Script     1.7.1                 Az.Databricks                       Core,Desk {Get-AzDatabricksAccessConnector, Get-A…
Script     1.5.0                 Az.Databricks                       Core,Desk {Get-AzDatabricksAccessConnector, Get-A…
Script     1.18.2                Az.DataFactory                      Core,Desk {Add-AzDataFactoryV2DataFlowDebugSessio…
Script     1.16.13               Az.DataFactory                      Core,Desk {Set-AzDataFactoryV2, Update-AzDataFact…
Script     1.0.3                 Az.DataLakeAnalytics                Core,Desk {Get-AzDataLakeAnalyticsDataSource, New…
Script     1.0.2                 Az.DataLakeAnalytics                Core,Desk {Get-AzDataLakeAnalyticsDataSource, New…
Script     1.3.0                 Az.DataLakeStore                    Core,Desk {Get-AzDataLakeStoreTrustedIdProvider, …
Script     2.2.0                 Az.DataProtection                   Core,Desk {Backup-AzDataProtectionBackupInstanceA…
Script     1.1.0                 Az.DataProtection                   Core,Desk {Backup-AzDataProtectionBackupInstanceA…
Script     1.0.1                 Az.DataShare                        Core,Desk {New-AzDataShareAccount, Get-AzDataShar…
Script     1.1.0                 Az.DeploymentManager                Core,Desk {Get-AzDeploymentManagerArtifactSource,…
Script     4.3.0                 Az.DesktopVirtualization            Core,Desk {Disconnect-AzWvdUserSession, Expand-Az…
Script     3.1.1                 Az.DesktopVirtualization            Core,Desk {Disconnect-AzWvdUserSession, Expand-Az…
Script     1.1.0                 Az.DevCenter                        Core,Desk {Deploy-AzDevCenterUserEnvironment, Get…
Script     1.0.2                 Az.DevTestLabs                      Core,Desk {Get-AzDtlAllowedVMSizesPolicy, Get-AzD…
Script     1.2.0                 Az.Dns                              Core,Desk {Get-AzDnsRecordSet, New-AzDnsRecordCon…
Script     1.1.2                 Az.Dns                              Core,Desk {Get-AzDnsRecordSet, New-AzDnsRecordCon…
Script     1.0.0                 Az.ElasticSan                       Core,Desk {Add-AzElasticSanVolumeGroupNetworkRule…
Script     1.6.0                 Az.EventGrid                        Core,Desk {New-AzEventGridTopic, Get-AzEventGridT…
Script     1.5.0                 Az.EventGrid                        Core,Desk {New-AzEventGridTopic, Get-AzEventGridT…
Script     4.2.0                 Az.EventHub                         Core,Desk {New-AzEventHubAuthorizationRuleSASToke…
Script     3.2.2                 Az.EventHub                         Core,Desk {New-AzEventHubNamespace, Get-AzEventHu…
Script     1.10.0                Az.FrontDoor                        Core,Desk {New-AzFrontDoor, Get-AzFrontDoor, Set-…
Script     4.0.7                 Az.Functions                        Core,Desk {Get-AzFunctionApp, Get-AzFunctionAppAv…
Script     4.0.6                 Az.Functions                        Core,Desk {Get-AzFunctionApp, Get-AzFunctionAppAv…
Script     6.1.0                 Az.HDInsight                        Core,Desk {Add-AzHDInsightClusterIdentity, Add-Az…
Script     5.0.1                 Az.HDInsight                        Core,Desk {Get-AzHDInsightJob, New-AzHDInsightSqo…
Script     2.0.0                 Az.HealthcareApis                   Core,Desk {Get-AzHealthcareApisService, Get-AzHea…
Script     2.7.5                 Az.IotHub                           Core,Desk {Add-AzIotHubKey, Get-AzIotHubEventHubC…
Script     5.2.1                 Az.KeyVault                         Core,Desk {Add-AzKeyVaultCertificate, Add-AzKeyVa…
Script     4.9.2                 Az.KeyVault                         Core,Desk {Add-AzKeyVaultCertificate, Update-AzKe…
Script     2.3.0                 Az.Kusto                            Core,Desk {Add-AzKustoClusterLanguageExtension, A…
Script     2.1.0                 Az.Kusto                            Core,Desk {Add-AzKustoClusterLanguageExtension, A…
Script     1.0.0                 Az.LoadTesting                      Core,Desk {Get-AzLoad, New-AzLoad, Remove-AzLoad,…
Script     1.5.1                 Az.LogicApp                         Core,Desk {Get-AzIntegrationAccount, Get-AzIntegr…
Script     1.5.0                 Az.LogicApp                         Core,Desk {Get-AzIntegrationAccountAgreement, Get…
Script     1.1.3                 Az.MachineLearning                  Core,Desk {Move-AzMlCommitmentAssociation, Get-Az…
Script     1.0.0                 Az.MachineLearningServices          Core,Desk {Get-AzMLServiceQuota, Get-AzMLServiceU…
Script     1.4.1                 Az.Maintenance                      Core,Desk {Get-AzApplyUpdate, Get-AzConfiguration…
Script     1.2.1                 Az.Maintenance                      Core,Desk {Get-AzApplyUpdate, Get-AzConfiguration…
Script     1.2.0                 Az.ManagedServiceIdentity           Core,Desk {Get-AzSystemAssignedIdentity, Get-AzUs…
Script     1.1.1                 Az.ManagedServiceIdentity           Core,Desk {Get-AzFederatedIdentityCredentials, Ge…
Script     3.0.0                 Az.ManagedServices                  Core,Desk {Get-AzManagedServicesAssignment, Get-A…
Script     2.0.0                 Az.MarketplaceOrdering              Core,Desk {Get-AzMarketplaceTerms, Invoke-AzMarke…
Script     1.1.2                 Az.Media                            Core,Desk {Sync-AzMediaServiceStorageKey, Set-AzM…
Script     1.1.1                 Az.Media                            Core,Desk {Sync-AzMediaServiceStorageKey, Set-AzM…
Script     2.3.0                 Az.Migrate                          Core,Desk {Get-AzMigrateDiscoveredServer, Get-AzM…
Script     2.1.0                 Az.Migrate                          Core,Desk {Get-AzMigrateDiscoveredServer, Get-AzM…
Script     5.1.0                 Az.Monitor                          Core,Desk {Add-AzLogProfile, Add-AzMetricAlertRul…
Script     4.4.1                 Az.Monitor                          Core,Desk {Get-AzMetricDefinition, Get-AzMetric, …
Script     1.1.1                 Az.MySql                            Core,Desk {Get-AzMySqlConfiguration, Get-AzMySqlC…
Script     1.1.0                 Az.MySql                            Core,Desk {Get-AzMySqlConfiguration, Get-AzMySqlC…
Script     7.4.0                 Az.Network                          Core,Desk {Add-AzApplicationGatewayAuthentication…
Script     5.5.0                 Az.Network                          Core,Desk {Add-AzApplicationGatewayAuthentication…
Script     1.0.0                 Az.NetworkCloud                     Core,Desk {Deploy-AzNetworkCloudCluster, Disable-…
Script     1.0.0                 Az.Nginx                            Core,Desk {Get-AzNginxCertificate, Get-AzNginxCon…
Script     1.1.2                 Az.NotificationHubs                 Core,Desk {Get-AzNotificationHub, Get-AzNotificat…
Script     1.1.1                 Az.NotificationHubs                 Core,Desk {Get-AzNotificationHub, Get-AzNotificat…
Script     3.2.0                 Az.OperationalInsights              Core,Desk {New-AzOperationalInsightsAzureActivity…
Script     1.6.4                 Az.PolicyInsights                   Core,Desk {Get-AzPolicyEvent, Get-AzPolicyState, …
Script     1.6.0                 Az.PolicyInsights                   Core,Desk {Get-AzPolicyEvent, Get-AzPolicyState, …
Script     1.1.0                 Az.PostgreSql                       Core,Desk {Get-AzPostgreSqlConfiguration, Get-AzP…
Script     2.0.0                 Az.PowerBIEmbedded                  Core,Desk {Resume-AzPowerBIEmbeddedCapacity, Susp…
Script     1.2.0                 Az.PowerBIEmbedded                  Core,Desk {Remove-AzPowerBIWorkspaceCollection, G…
Script     1.0.4                 Az.PrivateDns                       Core,Desk {Get-AzPrivateDnsZone, Remove-AzPrivate…
Script     1.0.3                 Az.PrivateDns                       Core,Desk {Get-AzPrivateDnsZone, Remove-AzPrivate…
Script     6.7.1                 Az.RecoveryServices                 Core,Desk {Add-AzRecoveryServicesAsrReplicationPr…
Script     6.3.0                 Az.RecoveryServices                 Core,Desk {Get-AzRecoveryServicesBackupProperty, …
Script     1.9.0                 Az.RedisCache                       Core,Desk {Export-AzRedisCache, Get-AzRedisCache,…
Script     1.7.1                 Az.RedisCache                       Core,Desk {Remove-AzRedisCachePatchSchedule, New-…
Script     1.2.0                 Az.RedisEnterpriseCache             Core,Desk {Export-AzRedisEnterpriseCache, Get-AzR…
Script     1.1.0                 Az.RedisEnterpriseCache             Core,Desk {Export-AzRedisEnterpriseCache, Get-AzR…
Script     2.0.0                 Az.Relay                            Core,Desk {Get-AzRelayAuthorizationRule, Get-AzRe…
Script     1.0.4                 Az.Relay                            Core,Desk {New-AzRelayNamespace, Get-AzRelayNames…
Script     1.2.0                 Az.ResourceMover                    Core,Desk {Add-AzResourceMoverMoveResource, Get-A…
Script     1.1.0                 Az.ResourceMover                    Core,Desk {Add-AzResourceMoverMoveResource, Get-A…
Script     6.16.0                Az.Resources                        Core,Desk {Export-AzResourceGroup, Export-AzTempl…
Script     6.5.3                 Az.Resources                        Core,Desk {Get-AzProviderOperation, Remove-AzRole…
Script     0.9.0                 Az.Search                           Core,Desk {New-AzSearchService, Get-AzSearchServi…
Script     1.6.0                 Az.Security                         Core,Desk {Add-AzSecurityAdaptiveNetworkHardening…
Script     1.4.0                 Az.Security                         Core,Desk {Get-AzSecuritySolution, Get-AzSecurity…
Script     3.1.1                 Az.SecurityInsights                 Core,Desk {Get-AzSentinelAlertRule, Get-AzSentine…
Script     3.0.1                 Az.SecurityInsights                 Core,Desk {Get-AzSentinelAlertRule, Get-AzSentine…
Script     3.0.0                 Az.ServiceBus                       Core,Desk {New-AzServiceBusAuthorizationRuleSASTo…
Script     2.2.0                 Az.ServiceBus                       Core,Desk {New-AzServiceBusNamespace, Get-AzServi…
Script     3.3.2                 Az.ServiceFabric                    Core,Desk {Add-AzServiceFabricClientCertificate, …
Script     3.1.1                 Az.ServiceFabric                    Core,Desk {Add-AzServiceFabricClientCertificate, …
Script     2.0.0                 Az.SignalR                          Core,Desk {New-AzSignalR, Get-AzSignalR, Get-AzSi…
Script     1.5.0                 Az.SignalR                          Core,Desk {New-AzSignalR, Get-AzSignalR, Get-AzSi…
Script     4.14.0                Az.Sql                              Core,Desk {Add-AzSqlDatabaseToFailoverGroup, Add-…
Script     4.4.0                 Az.Sql                              Core,Desk {Get-AzSqlDatabaseTransparentDataEncryp…
Script     2.2.0                 Az.SqlVirtualMachine                Core,Desk {Get-AzAvailabilityGroupListener, Get-A…
Script     1.1.0                 Az.SqlVirtualMachine                Core,Desk {New-AzSqlVM, Get-AzSqlVM, Update-AzSql…
Script     2.3.1                 Az.StackHCI                         Core,Desk {Add-AzStackHCIVMAttestation, Disable-A…
Script     1.4.3                 Az.StackHCI                         Core,Desk {Add-AzStackHCIVMAttestation, Disable-A…
Script     1.0.1                 Az.StackHCIVM                       Core,Desk {Add-AzStackHCIVMVirtualMachineDataDisk…
Script     6.1.2                 Az.Storage                          Core,Desk {Add-AzRmStorageContainerLegalHold, Add…
Script     5.4.1                 Az.Storage                          Core,Desk {Get-AzStorageAccount, Get-AzStorageAcc…
Script     1.3.0                 Az.StorageMover                     Core,Desk {Get-AzStorageMover, Get-AzStorageMover…
Script     1.0.0                 Az.StorageMover                     Core,Desk {Get-AzStorageMover, Get-AzStorageMover…
Script     2.1.1                 Az.StorageSync                      Core,Desk {Get-AzStorageSyncCloudEndpoint, Get-Az…
Script     1.7.0                 Az.StorageSync                      Core,Desk {Invoke-AzStorageSyncCompatibilityCheck…
Script     2.0.0                 Az.StreamAnalytics                  Core,Desk {Get-AzStreamAnalyticsCluster, Get-AzSt…
Script     1.0.0                 Az.Support                          Core,Desk {Get-AzSupportService, Get-AzSupportPro…
Script     3.0.5                 Az.Synapse                          Core,Desk {Add-AzSynapseDataFlowDebugSessionPacka…
Script     2.3.0                 Az.Synapse                          Core,Desk {Get-AzSynapseSparkJob, Stop-AzSynapseS…
Script     1.2.2                 Az.TrafficManager                   Core,Desk {Add-AzTrafficManagerCustomHeaderToEndp…
Script     1.2.0                 Az.TrafficManager                   Core,Desk {Add-AzTrafficManagerCustomHeaderToEndp…
Script     3.2.0                 Az.Websites                         Core,Desk {Add-AzWebAppAccessRestrictionRule, Add…
Script     2.13.0                Az.Websites                         Core,Desk {Get-AzAppServicePlan, Set-AzAppService…
Script     5.1.2                 Azure                               Desk      {Get-AzureAutomationCertificate, Get-Az…

Error output

No response

msJinLei commented 1 month ago

May be the same issue with https://github.com/Azure/azure-powershell/issues/25069 and will check it later.

gsuttie commented 2 weeks ago

Hi folks

Is there any update on this item?

Thanks Gregor

gsuttie commented 1 day ago

Hi there any update on this?

msJinLei commented 1 day ago

Sorry for late response.

Could do the following steps and copy the debug log here. Remember to remove your personal information

$DebugPreference='Continue'

Connect-AzAccount -Tenant $TenantId -SubscriptionId $SubscriptionId 

Get-AzStorageAccountKey -ResourceGroupName -AccountName
BastiaanMolsbeck commented 1 day ago

Hi @msJinLei ,

Thank you for your reply. I tried your script and miraculously it works without the error! So, to summarize: When I do this:

Connect-AzAccount -TenantId $TenantId 
Select-AzSubscription -SubscriptionId $SubscriptionId
Get-AzStorageAccountKey -ResourceGroupName $resourceGroup -AccountName $storageAccountName

Then I get the error: The client 'REDACTED' with object id 'REDACTED' does not have authorization to perform action 'Microsoft.Storage/storageAccounts/listKeys/action' over scope '/subscriptions/REDACTED/resourceGroups/REDACTED/providers/Microsoft.Storage/storageAccounts/REDACTED' or the scope is invalid. If access was recently granted, please refresh your credentials.

But when I do this:

Connect-AzAccount -Tenant $TenantId -SubscriptionId $SubscriptionId 
Get-AzStorageAccountKey -ResourceGroupName $resourceGroup -AccountName $storageAccountName

It works correctly! This looks like a bug in the PowerShell cmdlet, don't you think?

msJinLei commented 1 day ago

@BastiaanMolsbeck

The first script should be equivalent to the second. Could you run with

$DebugPreference='Continue'
Connect-AzAccount -TenantId $TenantId 
Select-AzSubscription -SubscriptionId $SubscriptionId
Get-AzStorageAccountKey -ResourceGroupName $resourceGroup -AccountName $storageAccountName

copy the debug log here?

BastiaanMolsbeck commented 10 hours ago

This is the redacted debug log:

DEBUG: 15:40:47 - ConnectAzureRmAccountCommand begin processing with ParameterSet 'UserWithSubscriptionId'.
DEBUG: 15:40:47 - [ConfigManager] Got [False] from [DisplayBreakingChangeWarning], Module = [], Cmdlet = [].
DEBUG: 15:40:47 - [ConfigManager] Got nothing from [DefaultSubscriptionForLogin], Module = [], Cmdlet = []. Returning default value [].
DEBUG: 15:40:47 - Autosave setting from startup session: 'CurrentUser'
DEBUG: 15:40:47 - No autosave setting detected in environment variable 'AzContextAutoSave'. 
DEBUG: 15:40:47 - Using Autosave scope 'CurrentUser'
DEBUG: 15:40:47 - [InteractiveUserAuthenticator] Calling InteractiveBrowserCredential.AuthenticateAsync with TenantId:'*REDACTED*', Scopes:'https://management.core.windows.net//.default', AuthorityHost:'https://login.microsoftonline
.com/', RedirectUri:'http://localhost:8400/'
DEBUG: InteractiveBrowserCredential.Authenticate invoked. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId: 
DEBUG: Executing interactive authentication workflow inline.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:47Z - *REDACTED*] MSAL MSAL.Desktop with assembly version '4.49.1.0'. CorrelationId(*REDACTED*)
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:47Z - *REDACTED*] === InteractiveParameters Data ===
LoginHint provided: False
User provided: False
UseEmbeddedWebView: NotSpecified
ExtraScopesToConsent: 
Prompt: select_account
HasCustomWebUi: False

DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:47Z - *REDACTED*] 
=== Request Data ===
Authority Provided? - True
Scopes - https://management.core.windows.net//.default
Extra Query Params Keys (space separated) - 
ApiId - AcquireTokenInteractive
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - False
HomeAccountId - False
CorrelationId - *REDACTED*
UserAssertion set: False
LongRunningOboCacheKey set: False
Region configured: 

DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:47Z - *REDACTED*] === Token Acquisition (InteractiveRequest) started:
     Scopes: https://management.core.windows.net//.default
    Authority Host: login.microsoftonline.com
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:47Z - *REDACTED*] [Instance Discovery] Instance discovery is enabled and will be performed
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:47Z - *REDACTED*] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:47Z - *REDACTED*] Using legacy embedded browser.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:50Z - *REDACTED*] [Legacy WebView] Redirect URI was reached. Stopping WebView navigation...
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:50Z - *REDACTED*] An authorization code was retrieved from the /authorize endpoint. 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:50Z - *REDACTED*] Exchanging the auth code for tokens. 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:50Z - *REDACTED*] === InteractiveParameters Data ===
LoginHint provided: False
User provided: False
UseEmbeddedWebView: NotSpecified
ExtraScopesToConsent: 
Prompt: select_account
HasCustomWebUi: False

DEBUG: Request [700a067e-cfda-47db-b0bb-e541eb1e9413] POST https://login.microsoftonline.com/*REDACTED*/oauth2/v2.0/token
x-client-SKU:REDACTED
x-client-Ver:REDACTED
x-client-CPU:REDACTED
x-client-OS:REDACTED
x-anchormailbox:REDACTED
x-client-current-telemetry:REDACTED
x-client-last-telemetry:REDACTED
x-ms-lib-capability:REDACTED
client-request-id:REDACTED
return-client-request-id:REDACTED
x-app-name:REDACTED
x-app-ver:REDACTED
Content-Type:application/x-www-form-urlencoded
x-ms-client-request-id:700a067e-cfda-47db-b0bb-e541eb1e9413
x-ms-return-client-request-id:true
User-Agent:azsdk-net-Identity/1.6.1 (.NET Framework 4.8.9241.0; Microsoft Windows 10.0.19045 )
client assembly: Azure.Identity
DEBUG: Response [700a067e-cfda-47db-b0bb-e541eb1e9413] 200 OK (00.4s)
Pragma:no-cache
Strict-Transport-Security:REDACTED
X-Content-Type-Options:REDACTED
client-request-id:REDACTED
x-ms-request-id:df3dd97b-a93d-476d-9f1d-73e5fb66a700
x-ms-ests-server:REDACTED
x-ms-clitelem:REDACTED
x-ms-srs:REDACTED
X-XSS-Protection:REDACTED
Cache-Control:no-store, no-cache
Content-Type:application/json; charset=utf-8
Expires:-1
P3P:REDACTED
Set-Cookie:REDACTED
Date:Fri, 05 Jul 2024 13:40:50 GMT
Content-Length:6094

DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] Checking client info returned from the server..
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] Saving token response to cache..
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] [SaveTokenResponseAsync] Saving AT in cache and removing overlapping ATs...
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] Looking for scopes for the authority in the cache which intersect with https://management.core.windows.net//.default
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] Intersecting scope entries count - 1
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] Matching entries after filtering by user - 1
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] [SaveTokenResponseAsync] Saving Id Token and Account in cache ...
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] [SaveTokenResponseAsync] Saving RT in cache...
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] Not writing FRT in ADAL legacy cache. 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] 
    === Token Acquisition finished successfully:
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*]  AT expiration time: 5-7-2024 14:45:33 +00:00, scopes: https://management.core.windows.net//user_impersonation https://ma
nagement.core.windows.net//.default. source: IdentityProvider
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] Fetched access token from host login.microsoftonline.com. 
DEBUG: InteractiveBrowserCredential.Authenticate succeeded. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId:  ExpiresOn: 2024-07-05T14:45:33.3063704+00:00
DEBUG: 15:40:51 - [MsalAccessToken] Calling InteractiveBrowserCredential.GetTokenAsync - Scopes:'https://management.core.windows.net//.default'
DEBUG: InteractiveBrowserCredential.GetToken invoked. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId: 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] MSAL MSAL.Desktop with assembly version '4.49.1.0'. CorrelationId(*REDACTED*)
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] === AcquireTokenSilent Parameters ===
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] LoginHint provided: False
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] Account provided: True
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] ForceRefresh: False
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] 
=== Request Data ===
Authority Provided? - True
Scopes - https://management.core.windows.net//.default
Extra Query Params Keys (space separated) - 
ApiId - AcquireTokenSilent
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - False
HomeAccountId - False
CorrelationId - *REDACTED*
UserAssertion set: False
LongRunningOboCacheKey set: False
Region configured: 

DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] === Token Acquisition (SilentRequest) started:
     Scopes: https://management.core.windows.net//.default
    Authority Host: login.microsoftonline.com
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] Access token is not expired. Returning the found cache entry. [Current time (07/05/2024 13:40:51) - Expiration Time (07/0
5/2024 14:45:33 +00:00) - Extended Expiration Time (07/05/2024 14:45:33 +00:00)]
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] Returning access token found in cache. RefreshOn exists ? False
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] 
    === Token Acquisition finished successfully:
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*]  AT expiration time: 5-7-2024 14:45:33 +00:00, scopes: https://management.core.windows.net//user_impersonation https://ma
nagement.core.windows.net//.default. source: Cache
DEBUG: InteractiveBrowserCredential.GetToken succeeded. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId:  ExpiresOn: 2024-07-05T14:45:33.0000000+00:00
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com/subscriptions?api-version=2021-01-01

Headers:
x-ms-client-request-id        : f7a05574-0ee6-443d-bf11-380935dfc20f
accept-language               : en-US

Body:

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

Status Code:
OK

Headers:
Pragma                        : no-cache
x-ms-ratelimit-remaining-tenant-reads: 249
x-ms-request-id               : 92cdc1cd-ed77-4d78-a9cf-a4d216ef93a9
x-ms-correlation-request-id   : 92cdc1cd-ed77-4d78-a9cf-a4d216ef93a9
x-ms-routing-request-id       : WESTEUROPE:20240705T134051Z:92cdc1cd-ed77-4d78-a9cf-a4d216ef93a9
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
X-Cache                       : CONFIG_NOCACHE
X-MSEdge-Ref                  : Ref A: 346FA25823E94D05925F4166C3070D7D Ref B: AMS231020615025 Ref C: 2024-07-05T13:40:51Z
Cache-Control                 : no-cache
Date                          : Fri, 05 Jul 2024 13:40:50 GMT

Body:
{
  "value": [
    {
      "id": "/subscriptions/*REDACTED*",
      "authorizationSource": "RoleBased",
      "managedByTenants": [
        {
          "tenantId": "*REDACTED*"
        },
        {
          "tenantId": "*REDACTED*"
        }
      ],
      "subscriptionId": "*REDACTED*",
      "tenantId": "*REDACTED*",
      "displayName": "*REDACTED*",
      "state": "Enabled",
      "subscriptionPolicies": {
        "locationPlacementId": "Public_2014-09-01",
        "quotaId": "*REDACTED*",
        "spendingLimit": "Off"
      }
    }
  ],
  "count": {
    "type": "Total",
    "value": 1
  }
}

DEBUG: AzureQoSEvent:  Module: Az.Accounts:2.11.1; CommandName: Connect-AzAccount; PSVersion: 5.1.19041.4522; IsSuccess: True; Duration: 00:00:04.1183034
DEBUG: 15:40:51 - [ConfigManager] Got [True] from [EnableDataCollection], Module = [], Cmdlet = [].
DEBUG: 15:40:51 - ConnectAzureRmAccountCommand end processing.
DEBUG: 15:40:51 - SetAzureRMContextCommand begin processing with ParameterSet 'Subscription'.
DEBUG: 15:40:51 - using account id '*REDACTED*'...
DEBUG: 15:40:51 - [ConfigManager] Got [False] from [DisplayBreakingChangeWarning], Module = [], Cmdlet = [].
DEBUG: 15:40:51 - Autosave setting from startup session: 'CurrentUser'
DEBUG: 15:40:51 - No autosave setting detected in environment variable 'AzContextAutoSave'. 
DEBUG: 15:40:51 - Using Autosave scope 'CurrentUser'
DEBUG: 15:40:51 - [SilentAuthenticator] Calling SharedTokenCacheCredential.GetTokenAsync - TenantId:'*REDACTED*', Scopes:'https://management.core.windows.net//.default', AuthorityHost:'https://login.microsoftonline.com/', UserId:'*REDACTED*'
DEBUG: SharedTokenCacheCredential.GetToken invoked. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId: 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z] [WamBroker] WAM supported OS.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z] [WamBroker] ListWindowsWorkAndSchoolAccounts option was not enabled.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z] Found 1 cache accounts and 0 broker accounts
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z] Returning 1 accounts
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] MSAL MSAL.Desktop with assembly version '4.49.1.0'. CorrelationId(*REDACTED*)
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] === AcquireTokenSilent Parameters ===
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] LoginHint provided: False
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] Account provided: True
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] ForceRefresh: False
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] 
=== Request Data ===
Authority Provided? - True
Scopes - https://management.core.windows.net//.default
Extra Query Params Keys (space separated) - 
ApiId - AcquireTokenSilent
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - True
HomeAccountId - False
CorrelationId - *REDACTED*
UserAssertion set: False
LongRunningOboCacheKey set: False
Region configured: 

DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] === Token Acquisition (SilentRequest) started:
     Scopes: https://management.core.windows.net//.default
    Authority Host: login.microsoftonline.com
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] Access token is not expired. Returning the found cache entry. [Current time (07/05/2024 13:40:51) - Expiration Time (07/0
5/2024 14:45:33 +00:00) - Extended Expiration Time (07/05/2024 14:45:33 +00:00)]
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] Returning access token found in cache. RefreshOn exists ? False
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] 
    === Token Acquisition finished successfully:
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*]  AT expiration time: 5-7-2024 14:45:33 +00:00, scopes: https://management.core.windows.net//user_impersonation https://ma
nagement.core.windows.net//.default. source: Cache
DEBUG: SharedTokenCacheCredential.GetToken succeeded. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId:  ExpiresOn: 2024-07-05T14:45:33.0000000+00:00
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com/tenants?api-version=2021-01-01

Headers:
x-ms-client-request-id        : b24d19e9-4fa6-4238-ab90-0d42a3f5f77f
accept-language               : en-US

Body:

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

Status Code:
OK

Headers:
Pragma                        : no-cache
x-ms-ratelimit-remaining-tenant-reads: 249
x-ms-request-id               : 4ff7d5e4-d99c-4c88-bb98-f0b7c1378edc
x-ms-correlation-request-id   : 4ff7d5e4-d99c-4c88-bb98-f0b7c1378edc
x-ms-routing-request-id       : WESTEUROPE:20240705T134051Z:4ff7d5e4-d99c-4c88-bb98-f0b7c1378edc
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
X-Cache                       : CONFIG_NOCACHE
X-MSEdge-Ref                  : Ref A: 417EBAF47069421B9F98353B97582F39 Ref B: AMS231032607047 Ref C: 2024-07-05T13:40:51Z
Cache-Control                 : no-cache
Date                          : Fri, 05 Jul 2024 13:40:50 GMT

Body:
{
  "value": [
    {
      "id": "/tenants/*REDACTED*",
      "tenantId": "*REDACTED*",
      "countryCode": "NL",
      "displayName": "*REDACTED*",
      "domains": [
        "*REDACTED*"
      ],
      "tenantCategory": "Home",
      "defaultDomain": "*REDACTED*",
      "tenantType": "AAD",
      "tenantBrandingLogoUrl": "*REDACTED*"
    }
  ]
}

DEBUG: 15:40:51 - [SilentAuthenticator] Calling SharedTokenCacheCredential.GetTokenAsync - TenantId:'*REDACTED*', Scopes:'https://management.core.windows.net//.default', AuthorityHost:'https://login.microsoftonline.com/', UserId:'*REDACTED*'
DEBUG: SharedTokenCacheCredential.GetToken invoked. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId: 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z] [WamBroker] WAM supported OS.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z] [WamBroker] ListWindowsWorkAndSchoolAccounts option was not enabled.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z] Found 1 cache accounts and 0 broker accounts
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z] Returning 1 accounts
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] MSAL MSAL.Desktop with assembly version '4.49.1.0'. CorrelationId(*REDACTED*)
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] === AcquireTokenSilent Parameters ===
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] LoginHint provided: False
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] Account provided: True
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] ForceRefresh: False
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] 
=== Request Data ===
Authority Provided? - True
Scopes - https://management.core.windows.net//.default
Extra Query Params Keys (space separated) - 
ApiId - AcquireTokenSilent
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - True
HomeAccountId - False
CorrelationId - *REDACTED*
UserAssertion set: False
LongRunningOboCacheKey set: False
Region configured: 

DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] === Token Acquisition (SilentRequest) started:
     Scopes: https://management.core.windows.net//.default
    Authority Host: login.microsoftonline.com
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] Access token is not expired. Returning the found cache entry. [Current time (07/05/2024 13:40:51) - Expiration Time (07/0
5/2024 14:57:24 +00:00) - Extended Expiration Time (07/05/2024 14:57:24 +00:00)]
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] Returning access token found in cache. RefreshOn exists ? False
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] 
    === Token Acquisition finished successfully:
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*]  AT expiration time: 5-7-2024 14:57:24 +00:00, scopes: https://management.core.windows.net//user_impersonation https://ma
nagement.core.windows.net//.default. source: Cache
DEBUG: SharedTokenCacheCredential.GetToken succeeded. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId:  ExpiresOn: 2024-07-05T14:57:24.0000000+00:00
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com/subscriptions/*REDACTED*?api-version=2021-01-01

Headers:
x-ms-client-request-id        : b24d19e9-4fa6-4238-ab90-0d42a3f5f77f
accept-language               : en-US

Body:

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

Status Code:
OK

Headers:
Pragma                        : no-cache
x-ms-ratelimit-remaining-subscription-reads: 249
x-ms-ratelimit-remaining-subscription-global-reads: 3749
x-ms-request-id               : a30bbb0d-dc66-4f06-af66-640307a17b43
x-ms-correlation-request-id   : a30bbb0d-dc66-4f06-af66-640307a17b43
x-ms-routing-request-id       : WESTEUROPE:20240705T134051Z:a30bbb0d-dc66-4f06-af66-640307a17b43
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
X-Cache                       : CONFIG_NOCACHE
X-MSEdge-Ref                  : Ref A: EB4D6D0F7326478DAC27F1B21BD4A7D0 Ref B: AMS231020512047 Ref C: 2024-07-05T13:40:51Z
Cache-Control                 : no-cache
Date                          : Fri, 05 Jul 2024 13:40:51 GMT

Body:
{
  "id": "/subscriptions/*REDACTED*",
  "authorizationSource": "RoleBased",
  "managedByTenants": [
    {
      "tenantId": "*REDACTED*"
    },
    {
      "tenantId": "*REDACTED*"
    }
  ],
  "subscriptionId": "*REDACTED*",
  "tenantId": "*REDACTED*",
  "displayName": "*REDACTED*",
  "state": "Enabled",
  "subscriptionPolicies": {
    "locationPlacementId": "Public_2014-09-01",
    "quotaId": "*REDACTED*",
    "spendingLimit": "Off"
  }
}

Account                SubscriptionName         TenantId                             Environment
-------                ----------------         --------                             -----------
*REDACTED* *REDACTED* *REDACTED* AzureCloud 

Name               : *REDACTED* (*REDACTED*) - *REDACTED* - *REDACTED*
Account            : *REDACTED*
Environment        : AzureCloud
Subscription       : *REDACTED*
Tenant             : *REDACTED*
TokenCache         : 
VersionProfile     : 
ExtendedProperties : {}

DEBUG: AzureQoSEvent:  Module: Az.Accounts:2.11.1; CommandName: Set-AzContext; PSVersion: 5.1.19041.4522; IsSuccess: True; Duration: 00:00:00.2935485
DEBUG: 15:40:51 - [ConfigManager] Got [True] from [EnableDataCollection], Module = [], Cmdlet = [].
DEBUG: 15:40:51 - SetAzureRMContextCommand end processing.
DEBUG: 15:40:51 - GetAzureStorageAccountKeyCommand begin processing with ParameterSet '__AllParameterSets'.
DEBUG: 15:40:51 - using account id '*REDACTED*'...
DEBUG: 15:40:51 - [ConfigManager] Got [False] from [DisplayBreakingChangeWarning], Module = [], Cmdlet = [].
DEBUG: [Common.Authentication]: Authenticating using Account: '*REDACTED*', environment: 'AzureCloud', tenant: '*REDACTED*'
DEBUG: 15:40:51 - [SilentAuthenticator] Calling SharedTokenCacheCredential.GetTokenAsync - TenantId:'*REDACTED*', Scopes:'https://management.core.windows.net//.default', AuthorityHost:'https://login.microsoftonline.com/', UserId:'*REDACTED*'
DEBUG: SharedTokenCacheCredential.GetToken invoked. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId: 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z] [WamBroker] WAM supported OS.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z] [WamBroker] ListWindowsWorkAndSchoolAccounts option was not enabled.
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z] Found 1 cache accounts and 0 broker accounts
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z] Returning 1 accounts
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] MSAL MSAL.Desktop with assembly version '4.49.1.0'. CorrelationId(*REDACTED*)
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] === AcquireTokenSilent Parameters ===
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] LoginHint provided: False
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] Account provided: True
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] ForceRefresh: False
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] 
=== Request Data ===
Authority Provided? - True
Scopes - https://management.core.windows.net//.default
Extra Query Params Keys (space separated) - 
ApiId - AcquireTokenSilent
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - True
HomeAccountId - False
CorrelationId - *REDACTED*
UserAssertion set: False
LongRunningOboCacheKey set: False
Region configured: 

DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] === Token Acquisition (SilentRequest) started:
     Scopes: https://management.core.windows.net//.default
    Authority Host: login.microsoftonline.com
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] Access token is not expired. Returning the found cache entry. [Current time (07/05/2024 13:40:51) - Expiration Time (07/0
5/2024 14:57:24 +00:00) - Extended Expiration Time (07/05/2024 14:57:24 +00:00)]
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] Returning access token found in cache. RefreshOn exists ? False
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*] 
    === Token Acquisition finished successfully:
DEBUG: False MSAL 4.49.1.0 MSAL.Desktop 4.8 or later Windows 10 Enterprise [2024-07-05 13:40:51Z - *REDACTED*]  AT expiration time: 5-7-2024 14:57:24 +00:00, scopes: https://management.core.windows.net//user_impersonation https://ma
nagement.core.windows.net//.default. source: Cache
DEBUG: SharedTokenCacheCredential.GetToken succeeded. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId:  ExpiresOn: 2024-07-05T14:57:24.0000000+00:00
DEBUG: [Common.Authentication]: Received token with LoginType 'User', Tenant: '*REDACTED*', UserId: '*REDACTED*'
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
POST

Absolute Uri:
https://management.azure.com/subscriptions/*REDACTED*/resourceGroups/*REDACTED*/providers/Microsoft.Storage/storageAccounts/*REDACTED*/listKeys?api-version=2022-09-01

Headers:
x-ms-client-request-id        : efebd1e4-7f58-4a2f-b884-0e855d652832
accept-language               : en-US

Body:

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

Status Code:
Forbidden

Headers:
Pragma                        : no-cache
x-ms-failure-cause            : gateway
x-ms-request-id               : 8ec622d8-3d6c-47df-a605-bbe85c8bb47a
x-ms-correlation-request-id   : 8ec622d8-3d6c-47df-a605-bbe85c8bb47a
x-ms-routing-request-id       : WESTEUROPE:20240705T134051Z:8ec622d8-3d6c-47df-a605-bbe85c8bb47a
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
X-Cache                       : CONFIG_NOCACHE
X-MSEdge-Ref                  : Ref A: 605EEF5DCF644DB49DD20DA35E32F20D Ref B: AMS231032609047 Ref C: 2024-07-05T13:40:51Z
Cache-Control                 : no-cache
Date                          : Fri, 05 Jul 2024 13:40:51 GMT

Body:
{
  "error": {
    "code": "AuthorizationFailed",
    "message": "The client '*REDACTED*' with object id '*REDACTED*' does not have authorization to perform action 'Microsoft.Storage/storageAccounts/listKeys/action' over scope '/subscriptions/*REDACTED*/resourceGroups/*REDACTED*/providers/Microsoft.Storage/storageAccounts/*REDACTED*' or the scope is invalid. If access was recently granted, please refresh your credentials."
  }
}

DEBUG: 15:40:51 - [ConfigManager] Got [True] from [EnableDataCollection], Module = [], Cmdlet = [].
Get-AzStorageAccountKey : The client '*REDACTED*' with object id '*REDACTED*' does not have authorization to perform action 'Microsoft.Storage/storageAccounts/listKeys/action' over scope '/subscriptions/*REDACTED*/resourceGroups/*REDACTED*/providers/Microsoft.Storage/storageAccounts/*REDACTED*' or the scope is invalid. If access was recently granted, please refresh your credentials.
At line:3 char:1
+ Get-AzStorageAccountKey -ResourceGroupName $resourceGroup -AccountNam ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Get-AzStorageAccountKey], CloudException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountKeyCommand

DEBUG: 15:40:51 - [ConfigManager] Got [False] from [DisplayBreakingChangeWarning], Module = [], Cmdlet = [].
DEBUG: AzureQoSEvent:  Module: Az.Storage:5.3.0; CommandName: Get-AzStorageAccountKey; PSVersion: 5.1.19041.4522; IsSuccess: False; Duration: 00:00:00.1268979; Exception: The client '*REDACTED*' with object id 'b9c65a45-ef03-4df3-9de9-e66cd880a0e
0' does not have authorization to perform action 'Microsoft.Storage/storageAccounts/listKeys/action' over scope '/subscriptions/*REDACTED*/resourceGroups/*REDACTED*/providers/Microsoft.Storage/storageAccounts/*REDACTED*' or the scope is invalid. If access was recently granted, please refresh your credentials.;
DEBUG: 15:40:51 - GetAzureStorageAccountKeyCommand end processing.