Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.26k stars 3.86k forks source link

OSX Connect-AzAccount doesn't function #14478

Open ghost opened 3 years ago

ghost commented 3 years ago

Description

PS /Users/prestonc> Connect-azaccount WARNING: INITIALIZATION: Token cache encryption is not supported in current environment and token cache will be fallen back as plain text. WARNING: Unable to acquire token for tenant 'organizations' WARNING: Please run 'Connect-AzAccount -DeviceCode' if browser is not supported in this session. Connect-AzAccount: InteractiveBrowserCredential authentication failed: Persistence check failed. Inspect inner exception for details

Steps to reproduce

Environment data


PS /Users/prestonc> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.1.2
PSEdition                      Core
GitCommitId                    7.1.2
OS                             Darwin 19.6.0 Darwin Kernel Version 19.6.0: Tue Jan 12 22:13:05 PST 2021; root:xnu-6153.141.16~1/RELEASE_X86_64
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

PS /Users/prestonc> 

Module versions

PS /Users/prestonc> Get-Module -ListAvailable

    Directory: /Users/prestonc/.local/share/powershell/Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     5.5.0                 Az                                  Core,Desk 
Script     5.4.0                 Az                                  Core,Desk 
Script     5.1.0                 Az                                  Core,Desk 
Script     2.2.5                 Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzContextAutosave, …
Script     2.2.4                 Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzContextAutosave, …
Script     2.2.1                 Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzContextAutosave, …
Script     1.1.1                 Az.Advisor                          Core,Desk {Get-AzAdvisorRecommendation, Enable-AzAdvisorRecommen…
Script     2.0.2                 Az.Aks                              Core,Desk {Get-AzAksCluster, New-AzAksCluster, Remove-AzAksClust…
Script     2.0.1                 Az.Aks                              Core,Desk {Get-AzAksCluster, New-AzAksCluster, Remove-AzAksClust…
Script     1.1.4                 Az.AnalysisServices                 Core,Desk {Resume-AzAnalysisServicesServer, Suspend-AzAnalysisSe…
Script     2.2.0                 Az.ApiManagement                    Core,Desk {Add-AzApiManagementApiToGateway, Add-AzApiManagementA…
Script     2.1.0                 Az.ApiManagement                    Core,Desk {Add-AzApiManagementApiToGateway, Add-AzApiManagementA…
Script     1.0.0                 Az.AppConfiguration                 Core,Desk {Get-AzAppConfigurationStore, Get-AzAppConfigurationSt…
Script     1.1.0                 Az.ApplicationInsights              Core,Desk {Get-AzApplicationInsights, New-AzApplicationInsights,…
Script     1.4.3                 Az.Automation                       Core,Desk {Get-AzAutomationHybridWorkerGroup, Remove-AzAutomatio…
Script     1.4.2                 Az.Automation                       Core,Desk {Get-AzAutomationHybridWorkerGroup, Remove-AzAutomatio…
Script     1.4.0                 Az.Automation                       Core,Desk {Get-AzAutomationHybridWorkerGroup, Remove-AzAutomatio…
Script     3.1.0                 Az.Batch                            Core,Desk {Remove-AzBatchAccount, Get-AzBatchAccount, Get-AzBatc…
Script     2.0.0                 Az.Billing                          Core,Desk {Get-AzBillingInvoice, Get-AzBillingPeriod, Get-AzEnro…
Script     1.6.0                 Az.Cdn                              Core,Desk {Get-AzCdnProfile, Get-AzCdnProfileSsoUrl, New-AzCdnPr…
Script     1.8.0                 Az.CognitiveServices                Core,Desk {Get-AzCognitiveServicesAccount, Get-AzCognitiveServic…
Script     4.9.0                 Az.Compute                          Core,Desk {Remove-AzAvailabilitySet, Get-AzAvailabilitySet, New-…
Script     4.8.0                 Az.Compute                          Core,Desk {Remove-AzAvailabilitySet, Get-AzAvailabilitySet, New-…
Script     4.6.0                 Az.Compute                          Core,Desk {Remove-AzAvailabilitySet, Get-AzAvailabilitySet, New-…
Script     1.0.3                 Az.ContainerInstance                Core,Desk {New-AzContainerGroup, Get-AzContainerGroup, Remove-Az…
Script     2.2.1                 Az.ContainerRegistry                Core,Desk {New-AzContainerRegistry, Get-AzContainerRegistry, Upd…
Script     2.2.0                 Az.ContainerRegistry                Core,Desk {New-AzContainerRegistry, Get-AzContainerRegistry, Upd…
Script     2.1.0                 Az.ContainerRegistry                Core,Desk {New-AzContainerRegistry, Get-AzContainerRegistry, Upd…
Script     2.0.0                 Az.ContainerRegistry                Core,Desk {New-AzContainerRegistry, Get-AzContainerRegistry, Upd…
Script     1.0.0                 Az.CosmosDB                         Core,Desk {Get-AzCosmosDBSqlContainer, Get-AzCosmosDBSqlContaine…
Script     1.1.0                 Az.DataBoxEdge                      Core,Desk {Get-AzDataBoxEdgeJob, Get-AzDataBoxEdgeDevice, Invoke…
Script     1.1.0                 Az.Databricks                       Core,Desk {Get-AzDatabricksVNetPeering, Get-AzDatabricksWorkspac…
Script     1.0.2                 Az.Databricks                       Core,Desk {Get-AzDatabricksVNetPeering, Get-AzDatabricksWorkspac…
Script     1.0.1                 Az.Databricks                       Core,Desk {Get-AzDatabricksVNetPeering, Get-AzDatabricksWorkspac…
Script     1.11.3                Az.DataFactory                      Core,Desk {Set-AzDataFactoryV2, Update-AzDataFactoryV2, Get-AzDa…
Script     1.11.1                Az.DataFactory                      Core,Desk {Set-AzDataFactoryV2, Update-AzDataFactoryV2, Get-AzDa…
Script     1.0.2                 Az.DataLakeAnalytics                Core,Desk {Get-AzDataLakeAnalyticsDataSource, New-AzDataLakeAnal…
Script     1.3.0                 Az.DataLakeStore                    Core,Desk {Get-AzDataLakeStoreTrustedIdProvider, Remove-AzDataLa…
Script     1.0.0                 Az.DataShare                        Core,Desk {New-AzDataShareAccount, Get-AzDataShareAccount, Remov…
Script     1.1.0                 Az.DeploymentManager                Core,Desk {Get-AzDeploymentManagerArtifactSource, New-AzDeployme…
Script     2.1.1                 Az.DesktopVirtualization            Core,Desk {Disconnect-AzWvdUserSession, Expand-AzWvdMsixImage, G…
Script     2.0.1                 Az.DesktopVirtualization            Core,Desk {Disconnect-AzWvdUserSession, Expand-AzWvdMsixImage, G…
Script     1.0.2                 Az.DevTestLabs                      Core,Desk {Get-AzDtlAllowedVMSizesPolicy, Get-AzDtlAutoShutdownP…
Script     1.1.2                 Az.Dns                              Core,Desk {Get-AzDnsRecordSet, New-AzDnsRecordConfig, Remove-AzD…
Script     1.3.0                 Az.EventGrid                        Core,Desk {New-AzEventGridTopic, Get-AzEventGridTopic, Set-AzEve…
Script     1.7.1                 Az.EventHub                         Core,Desk {New-AzEventHubNamespace, Get-AzEventHubNamespace, Set…
Script     1.7.0                 Az.FrontDoor                        Core,Desk {New-AzFrontDoor, Get-AzFrontDoor, Set-AzFrontDoor, Re…
Script     1.6.1                 Az.FrontDoor                        Core,Desk {New-AzFrontDoor, Get-AzFrontDoor, Set-AzFrontDoor, Re…
Script     2.0.0                 Az.Functions                        Core,Desk {Get-AzFunctionApp, Get-AzFunctionAppAvailableLocation…
Script     4.2.0                 Az.HDInsight                        Core,Desk {Get-AzHDInsightJob, New-AzHDInsightSqoopJobDefinition…
Script     4.1.1                 Az.HDInsight                        Core,Desk {Get-AzHDInsightJob, New-AzHDInsightSqoopJobDefinition…
Script     4.1.0                 Az.HDInsight                        Core,Desk {Get-AzHDInsightJob, New-AzHDInsightSqoopJobDefinition…
Script     1.2.0                 Az.HealthcareApis                   Core,Desk {New-AzHealthcareApisService, Remove-AzHealthcareApisS…
Script     1.1.0                 Az.HealthcareApis                   Core,Desk {New-AzHealthcareApisService, Remove-AzHealthcareApisS…
Script     2.7.2                 Az.IotHub                           Core,Desk {Add-AzIotHubKey, Get-AzIotHubEventHubConsumerGroup, G…
Script     2.7.0                 Az.IotHub                           Core,Desk {Add-AzIotHubKey, Get-AzIotHubEventHubConsumerGroup, G…
Script     3.4.0                 Az.KeyVault                         Core,Desk {Add-AzKeyVaultCertificate, Update-AzKeyVaultCertifica…
Script     3.3.1                 Az.KeyVault                         Core,Desk {Add-AzKeyVaultCertificate, Update-AzKeyVaultCertifica…
Script     3.1.0                 Az.KeyVault                         Core,Desk {Add-AzManagedHsmKey, Get-AzManagedHsmKey, Remove-AzMa…
Script     1.0.1                 Az.Kusto                            Core,Desk {Add-AzKustoClusterLanguageExtension, Add-AzKustoDatab…
Script     1.0.0                 Az.Kusto                            Core,Desk {Add-AzKustoClusterLanguageExtension, Add-AzKustoDatab…
Script     1.5.0                 Az.LogicApp                         Core,Desk {Get-AzIntegrationAccountAgreement, Get-AzIntegrationA…
Script     1.4.0                 Az.LogicApp                         Core,Desk {Get-AzIntegrationAccountAgreement, Get-AzIntegrationA…
Script     1.1.3                 Az.MachineLearning                  Core,Desk {Move-AzMlCommitmentAssociation, Get-AzMlCommitmentAss…
Script     1.1.0                 Az.Maintenance                      Core,Desk {Get-AzApplyUpdate, Get-AzConfigurationAssignment, Get…
Script     2.0.0                 Az.ManagedServices                  Core,Desk {Get-AzManagedServicesAssignment, New-AzManagedService…
Script     1.0.2                 Az.MarketplaceOrdering              Core,Desk {Get-AzMarketplaceTerms, Set-AzMarketplaceTerms}
Script     1.1.1                 Az.Media                            Core,Desk {Sync-AzMediaServiceStorageKey, Set-AzMediaServiceKey,…
Script     2.4.0                 Az.Monitor                          Core,Desk {Get-AzMetricDefinition, Get-AzMetric, Remove-AzLogPro…
Script     2.2.0                 Az.Monitor                          Core,Desk {Get-AzMetricDefinition, Get-AzMetric, Remove-AzLogPro…
Script     4.6.0                 Az.Network                          Core,Desk {Add-AzApplicationGatewayAuthenticationCertificate, Ge…
Script     4.5.0                 Az.Network                          Core,Desk {Add-AzApplicationGatewayAuthenticationCertificate, Ge…
Script     4.3.0                 Az.Network                          Core,Desk {Add-AzApplicationGatewayAuthenticationCertificate, Ge…
Script     1.1.1                 Az.NotificationHubs                 Core,Desk {Get-AzNotificationHub, Get-AzNotificationHubAuthoriza…
Script     2.3.0                 Az.OperationalInsights              Core,Desk {New-AzOperationalInsightsAzureActivityLogDataSource, …
Script     1.4.1                 Az.PolicyInsights                   Core,Desk {Get-AzPolicyEvent, Get-AzPolicyState, Get-AzPolicySta…
Script     1.4.0                 Az.PolicyInsights                   Core,Desk {Get-AzPolicyEvent, Get-AzPolicyState, Get-AzPolicySta…
Script     1.3.1                 Az.PolicyInsights                   Core,Desk {Get-AzPolicyEvent, Get-AzPolicyState, Get-AzPolicySta…
Script     1.1.2                 Az.PowerBIEmbedded                  Core,Desk {Remove-AzPowerBIWorkspaceCollection, Get-AzPowerBIWor…
Script     1.0.3                 Az.PrivateDns                       Core,Desk {Get-AzPrivateDnsZone, Remove-AzPrivateDnsZone, Set-Az…
Script     3.4.0                 Az.RecoveryServices                 Core,Desk {Get-AzRecoveryServicesBackupProperty, Get-AzRecoveryS…
Script     3.3.0                 Az.RecoveryServices                 Core,Desk {Get-AzRecoveryServicesBackupProperty, Get-AzRecoveryS…
Script     3.0.1                 Az.RecoveryServices                 Core,Desk {Get-AzRecoveryServicesBackupProperty, Get-AzRecoveryS…
Script     1.4.0                 Az.RedisCache                       Core,Desk {Remove-AzRedisCachePatchSchedule, New-AzRedisCacheSch…
Script     1.0.3                 Az.Relay                            Core,Desk {New-AzRelayNamespace, Get-AzRelayNamespace, Set-AzRel…
Script     3.2.1                 Az.Resources                        Core,Desk {Get-AzProviderOperation, Remove-AzRoleAssignment, Get…
Script     3.2.0                 Az.Resources                        Core,Desk {Get-AzProviderOperation, Remove-AzRoleAssignment, Get…
Script     3.0.1                 Az.Resources                        Core,Desk {Get-AzProviderOperation, Remove-AzRoleAssignment, Get…
Script     1.4.1                 Az.ServiceBus                       Core,Desk {New-AzServiceBusNamespace, Get-AzServiceBusNamespace,…
Script     2.2.2                 Az.ServiceFabric                    Core,Desk {Add-AzServiceFabricClientCertificate, Add-AzServiceFa…
Script     2.2.0                 Az.ServiceFabric                    Core,Desk {Add-AzServiceFabricClientCertificate, Add-AzServiceFa…
Script     1.2.0                 Az.SignalR                          Core,Desk {New-AzSignalR, Get-AzSignalR, Get-AzSignalRKey, New-A…
Script     2.16.0                Az.Sql                              Core,Desk {Get-AzSqlDatabaseTransparentDataEncryption, Get-AzSql…
Script     2.15.0                Az.Sql                              Core,Desk {Get-AzSqlDatabaseTransparentDataEncryption, Get-AzSql…
Script     2.12.0                Az.Sql                              Core,Desk {Get-AzSqlDatabaseTransparentDataEncryption, Get-AzSql…
Script     1.1.0                 Az.SqlVirtualMachine                Core,Desk {New-AzSqlVM, Get-AzSqlVM, Update-AzSqlVM, Remove-AzSq…
Script     3.3.0                 Az.Storage                          Core,Desk {Get-AzStorageAccount, Get-AzStorageAccountKey, New-Az…
Script     3.2.1                 Az.Storage                          Core,Desk {Get-AzStorageAccount, Get-AzStorageAccountKey, New-Az…
Script     3.0.0                 Az.Storage                          Core,Desk {Get-AzStorageAccount, Get-AzStorageAccountKey, New-Az…
Script     1.4.0                 Az.StorageSync                      Core,Desk {Invoke-AzStorageSyncCompatibilityCheck, New-AzStorage…
Script     1.3.0                 Az.StorageSync                      Core,Desk {Invoke-AzStorageSyncCompatibilityCheck, New-AzStorage…
Script     1.0.1                 Az.StreamAnalytics                  Core,Desk {Get-AzStreamAnalyticsFunction, Get-AzStreamAnalyticsD…
Script     1.0.0                 Az.Support                          Core,Desk {Get-AzSupportService, Get-AzSupportProblemClassificat…
Script     1.0.4                 Az.TrafficManager                   Core,Desk {Add-AzTrafficManagerCustomHeaderToEndpoint, Remove-Az…
Script     2.3.0                 Az.Websites                         Core,Desk {Get-AzAppServicePlan, Set-AzAppServicePlan, New-AzApp…
Script     2.2.0                 Az.Websites                         Core,Desk {Get-AzAppServicePlan, Set-AzAppServicePlan, New-AzApp…
Script     2.1.0                 Az.Websites                         Core,Desk {Get-AzAppServicePlan, Set-AzAppServicePlan, New-AzApp…
Script     5.1.1                 Pester                              Desk      {Invoke-Pester, Describe, Context, It…}
Script     4.10.1                Pester                              Desk      {Describe, Context, It, Should…}
Script     0.67.1                PSKoans                             Core,Desk {Get-Blank, Get-Karma, Get-PSKoan, Get-PSKoanLocation…}

    Directory: /usr/local/Cellar/powershell/7.1.2/libexec/Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Manifest   1.2.5                 Microsoft.PowerShell.Archive        Desk      {Compress-Archive, Expand-Archive}
Manifest   7.0.0.0               Microsoft.PowerShell.Host           Core      {Start-Transcript, Stop-Transcript}
Manifest   7.0.0.0               Microsoft.PowerShell.Management     Core      {Add-Content, Clear-Content, Clear-ItemProperty, Join-…
Manifest   7.0.0.0               Microsoft.PowerShell.Security       Core      {Get-Credential, Get-ExecutionPolicy, Set-ExecutionPol…
Manifest   7.0.0.0               Microsoft.PowerShell.Utility        Core      {Export-Alias, Get-Alias, Import-Alias, New-Alias…}
Script     1.4.7                 PackageManagement                   Desk      {Find-Package, Get-Package, Get-PackageProvider, Get-P…
Script     2.2.5                 PowerShellGet                       Desk      {Find-Command, Find-DSCResource, Find-Module, Find-Rol…
Script     2.0.5                 PSDesiredStateConfiguration         Core      {Configuration, New-DscChecksum, Get-DscResource, Invo…
Script     2.1.0                 PSReadLine                          Desk      {Get-PSReadLineKeyHandler, Set-PSReadLineKeyHandler, R…
Binary     2.0.3                 ThreadJob                           Desk      Start-ThreadJob

Debug output

PS /Users/prestonc> Connect-AzAccount
DEBUG: 1:25:06 PM - ConnectAzureRmAccountCommand begin processing with ParameterSet 'UserWithSubscriptionId'.
DEBUG: 1:25:06 PM - Autosave setting from startup session: 'CurrentUser'
DEBUG: 1:25:06 PM - No autosave setting detected in environment variable 'AzContextAutoSave'. 
DEBUG: 1:25:06 PM - Using Autosave scope 'CurrentUser'
DEBUG: InteractiveBrowserCredential.Authenticate invoked. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId: 
DEBUG: InteractiveBrowserCredential.Authenticate was unable to retrieve an access token. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId:  Exception: Azure.Identity.AuthenticationFailedException (0x80131500): InteractiveBrowserCredential authentication failed: Persistence check failed. Inspect inner exception for details
 ---> Microsoft.Identity.Client.Extensions.Msal.MsalCachePersistenceException (0x80131500): Persistence check failed. Inspect inner exception for details
 ---> System.Exception (0x80131500): SecKeychainFindGenericPassword failed with error code: -25293
WARNING: Unable to acquire token for tenant 'organizations'
WARNING: Please run 'Connect-AzAccount -DeviceCode' if browser is not supported in this session.
DEBUG: Azure.Identity.AuthenticationFailedException: InteractiveBrowserCredential authentication failed: Persistence check failed. Inspect inner exception for details
 ---> Microsoft.Identity.Client.Extensions.Msal.MsalCachePersistenceException: Persistence check failed. Inspect inner exception for details
 ---> System.Exception: SecKeychainFindGenericPassword failed with error code: -25293
   at Microsoft.Identity.Client.Extensions.Msal.MacKeyChain.WriteKey(String serviceName, String accountName, Byte[] value)
   at Microsoft.Identity.Client.Extensions.Msal.MacKeychainAccessor.Write(Byte[] data)
   at Microsoft.Identity.Client.Extensions.Msal.MsalCacheStorage.VerifyPersistence()
   --- End of inner exception stack trace ---
   at Microsoft.Identity.Client.Extensions.Msal.MsalCacheStorage.VerifyPersistence()
   at Microsoft.Identity.Client.Extensions.Msal.MsalCacheHelper.VerifyPersistence()
   at Azure.Identity.PersistentTokenCache.GetCacheHelperAsync(Boolean async, CancellationToken cancellationToken)
   at Azure.Identity.PersistentTokenCache.RegisterCache(Boolean async, ITokenCache tokenCache, CancellationToken cancellationToken)
   at Azure.Identity.MsalClientBase`1.GetClientAsync(Boolean async, CancellationToken cancellationToken)
   at Azure.Identity.MsalPublicClient.AcquireTokenInteractiveAsync(String[] scopes, Prompt prompt, Boolean async, CancellationToken cancellationToken)
   at Azure.Identity.InteractiveBrowserCredential.GetTokenViaBrowserLoginAsync(String[] scopes, Boolean async, CancellationToken cancellationToken)
   at Azure.Identity.InteractiveBrowserCredential.AuthenticateImplAsync(Boolean async, TokenRequestContext requestContext, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at Azure.Identity.CredentialDiagnosticScope.FailWrapAndThrow(Exception ex)
   at Azure.Identity.InteractiveBrowserCredential.AuthenticateImplAsync(Boolean async, TokenRequestContext requestContext, CancellationToken cancellationToken)
   at Azure.Identity.InteractiveBrowserCredential.AuthenticateAsync(TokenRequestContext requestContext, CancellationToken cancellationToken)
   at Microsoft.Azure.PowerShell.Authenticators.MsalAccessToken.GetAccessTokenAsync(Task`1 authTask, TokenCredential tokenCredential, TokenRequestContext requestContext, CancellationToken cancellationToken)
   at Microsoft.Azure.Commands.Common.Authentication.Factories.AuthenticationFactory.Authenticate(IAzureAccount account, IAzureEnvironment environment, String tenant, SecureString password, String promptBehavior, Action`1 promptAction, IAzureTokenCache tokenCache, String resourceId)
   at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.AcquireAccessToken(IAzureAccount account, IAzureEnvironment environment, String tenantId, SecureString password, String promptBehavior, Action`1 promptAction)
   at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.ListAccountTenants(IAzureAccount account, IAzureEnvironment environment, SecureString password, String promptBehavior, Action`1 promptAction)
   at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.Login(IAzureAccount account, IAzureEnvironment environment, String tenantId, String subscriptionId, String subscriptionName, SecureString password, Boolean skipValidation, Action`1 promptAction, String name, Boolean shouldPopulateContextList, Int32 maxContextPopulation)
   at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass111_2.<ExecuteCmdlet>b__4()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass111_0.<ExecuteCmdlet>b__1(AzureRmProfile localProfile, RMProfileClient profileClient, String name)
Connect-AzAccount: InteractiveBrowserCredential authentication failed: Persistence check failed. Inspect inner exception for details
DEBUG: AzureQoSEvent: CommandName - Connect-AzAccount; IsSuccess - False; Duration - 00:00:00.0412792; Exception - Azure.Identity.AuthenticationFailedException: InteractiveBrowserCredential authentication failed: Persistence check failed. Inspect inner exception for details
 ---> Microsoft.Identity.Client.Extensions.Msal.MsalCachePersistenceException: Persistence check failed. Inspect inner exception for details
 ---> System.Exception: SecKeychainFindGenericPassword failed with error code: -25293
   at Microsoft.Identity.Client.Extensions.Msal.MacKeyChain.WriteKey(String serviceName, String accountName, Byte[] value)
   at Microsoft.Identity.Client.Extensions.Msal.MacKeychainAccessor.Write(Byte[] data)
   at Microsoft.Identity.Client.Extensions.Msal.MsalCacheStorage.VerifyPersistence()
   --- End of inner exception stack trace ---
   at Microsoft.Identity.Client.Extensions.Msal.MsalCacheStorage.VerifyPersistence()
   at Microsoft.Identity.Client.Extensions.Msal.MsalCacheHelper.VerifyPersistence()
   at Azure.Identity.PersistentTokenCache.GetCacheHelperAsync(Boolean async, CancellationToken cancellationToken)
   at Azure.Identity.PersistentTokenCache.RegisterCache(Boolean async, ITokenCache tokenCache, CancellationToken cancellationToken)
   at Azure.Identity.MsalClientBase`1.GetClientAsync(Boolean async, CancellationToken cancellationToken)
   at Azure.Identity.MsalPublicClient.AcquireTokenInteractiveAsync(String[] scopes, Prompt prompt, Boolean async, CancellationToken cancellationToken)
   at Azure.Identity.InteractiveBrowserCredential.GetTokenViaBrowserLoginAsync(String[] scopes, Boolean async, CancellationToken cancellationToken)
   at Azure.Identity.InteractiveBrowserCredential.AuthenticateImplAsync(Boolean async, TokenRequestContext requestContext, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at Azure.Identity.CredentialDiagnosticScope.FailWrapAndThrow(Exception ex)
   at Azure.Identity.InteractiveBrowserCredential.AuthenticateImplAsync(Boolean async, TokenRequestContext requestContext, CancellationToken cancellationToken)
   at Azure.Identity.InteractiveBrowserCredential.AuthenticateAsync(TokenRequestContext requestContext, CancellationToken cancellationToken)
   at Microsoft.Azure.PowerShell.Authenticators.MsalAccessToken.GetAccessTokenAsync(Task`1 authTask, TokenCredential tokenCredential, TokenRequestContext requestContext, CancellationToken cancellationToken)
   at Microsoft.Azure.Commands.Common.Authentication.Factories.AuthenticationFactory.Authenticate(IAzureAccount account, IAzureEnvironment environment, String tenant, SecureString password, String promptBehavior, Action`1 promptAction, IAzureTokenCache tokenCache, String resourceId)
   at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.AcquireAccessToken(IAzureAccount account, IAzureEnvironment environment, String tenantId, SecureString password, String promptBehavior, Action`1 promptAction)
   at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.ListAccountTenants(IAzureAccount account, IAzureEnvironment environment, SecureString password, String promptBehavior, Action`1 promptAction)
   at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.Login(IAzureAccount account, IAzureEnvironment environment, String tenantId, String subscriptionId, String subscriptionName, SecureString password, Boolean skipValidation, Action`1 promptAction, String name, Boolean shouldPopulateContextList, Int32 maxContextPopulation)
   at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass111_2.<ExecuteCmdlet>b__4()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass111_0.<ExecuteCmdlet>b__1(AzureRmProfile localProfile, RMProfileClient profileClient, String name)
   at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass118_0.<SetContextWithOverwritePrompt>b__0(AzureRmProfile prof, RMProfileClient client)
   at Microsoft.Azure.Commands.Profile.Common.AzureContextModificationCmdlet.ModifyContext(Action`2 contextAction)
   at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.SetContextWithOverwritePrompt(Action`3 setContextAction)
   at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.ExecuteCmdlet()
   at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.<ExecuteSynchronouslyOrAsJob>b__3_0(T c)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, Action`1 executor)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord();
DEBUG: Finish sending metric.
DEBUG: 1:25:06 PM - ConnectAzureRmAccountCommand end processing.

Error output

PS /Users/prestonc> Resolve-AzError
DEBUG: 1:37:28 PM - ResolveError begin processing with ParameterSet 'AnyErrorParameterSet'.
WARNING: Upcoming breaking changes in the cmdlet 'Resolve-AzError' :
The `Resolve-Error` alias will be removed in a future release.  Please change any scripts that use this alias to use `Resolve-AzError` instead.
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: 14

Message        : InteractiveBrowserCredential authentication failed: Persistence check failed. Inspect inner exception for details
StackTrace     :    at Azure.Identity.CredentialDiagnosticScope.FailWrapAndThrow(Exception ex)
                    at Azure.Identity.InteractiveBrowserCredential.AuthenticateImplAsync(Boolean async, TokenRequestContext 
                 requestContext, CancellationToken cancellationToken)
                    at Azure.Identity.InteractiveBrowserCredential.AuthenticateAsync(TokenRequestContext requestContext, 
                 CancellationToken cancellationToken)
                    at Microsoft.Azure.PowerShell.Authenticators.MsalAccessToken.GetAccessTokenAsync(Task`1 authTask, TokenCredential 
                 tokenCredential, TokenRequestContext requestContext, CancellationToken cancellationToken)
                    at Microsoft.Azure.Commands.Common.Authentication.Factories.AuthenticationFactory.Authenticate(IAzureAccount 
                 account, IAzureEnvironment environment, String tenant, SecureString password, String promptBehavior, Action`1 
                 promptAction, IAzureTokenCache tokenCache, String resourceId)
                    at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.AcquireAccessToken(IAzureAccount account, 
                 IAzureEnvironment environment, String tenantId, SecureString password, String promptBehavior, Action`1 promptAction)
                    at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.ListAccountTenants(IAzureAccount account, 
                 IAzureEnvironment environment, SecureString password, String promptBehavior, Action`1 promptAction)
                    at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.Login(IAzureAccount account, IAzureEnvironment 
                 environment, String tenantId, String subscriptionId, String subscriptionName, SecureString password, Boolean 
                 skipValidation, Action`1 promptAction, String name, Boolean shouldPopulateContextList, Int32 maxContextPopulation)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass111_2.<ExecuteCmdlet>b__4()
                    at System.Threading.Tasks.Task`1.InnerInvoke()
                    at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext 
                 executionContext, ContextCallback callback, Object state)
                 --- End of stack trace from previous location ---
                    at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
                 --- End of stack trace from previous location ---
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass111_0.<ExecuteCmdlet>b__1(AzureR
                 mProfile localProfile, RMProfileClient profileClient, String name)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass118_0.<SetContextWithOverwritePr
                 ompt>b__0(AzureRmProfile prof, RMProfileClient client)
                    at Microsoft.Azure.Commands.Profile.Common.AzureContextModificationCmdlet.ModifyContext(Action`2 contextAction)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.SetContextWithOverwritePrompt(Action`3 
                 setContextAction)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.ExecuteCmdlet()
                    at 
                 Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.<ExecuteSynchronouslyOrAsJob>b__3_0(T c)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, 
                 Action`1 executor)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception      : Azure.Identity.AuthenticationFailedException
InvocationInfo : {Connect-AzAccount}
Line           : Connect-AzAccount
Position       : At line:1 char:1
                 + Connect-AzAccount
                 + ~~~~~~~~~~~~~~~~~
HistoryId      : 14

Message        : Persistence check failed. Inspect inner exception for details
StackTrace     :    at Microsoft.Identity.Client.Extensions.Msal.MsalCacheStorage.VerifyPersistence()
                    at Microsoft.Identity.Client.Extensions.Msal.MsalCacheHelper.VerifyPersistence()
                    at Azure.Identity.PersistentTokenCache.GetCacheHelperAsync(Boolean async, CancellationToken cancellationToken)
                    at Azure.Identity.PersistentTokenCache.RegisterCache(Boolean async, ITokenCache tokenCache, CancellationToken 
                 cancellationToken)
                    at Azure.Identity.MsalClientBase`1.GetClientAsync(Boolean async, CancellationToken cancellationToken)
                    at Azure.Identity.MsalPublicClient.AcquireTokenInteractiveAsync(String[] scopes, Prompt prompt, Boolean async, 
                 CancellationToken cancellationToken)
                    at Azure.Identity.InteractiveBrowserCredential.GetTokenViaBrowserLoginAsync(String[] scopes, Boolean async, 
                 CancellationToken cancellationToken)
                    at Azure.Identity.InteractiveBrowserCredential.AuthenticateImplAsync(Boolean async, TokenRequestContext 
                 requestContext, CancellationToken cancellationToken)
Exception      : Microsoft.Identity.Client.Extensions.Msal.MsalCachePersistenceException
InvocationInfo : {Connect-AzAccount}
Line           : Connect-AzAccount
Position       : At line:1 char:1
                 + Connect-AzAccount
                 + ~~~~~~~~~~~~~~~~~
HistoryId      : 14

Message        : SecKeychainFindGenericPassword failed with error code: -25293
StackTrace     :    at Microsoft.Identity.Client.Extensions.Msal.MacKeyChain.WriteKey(String serviceName, String accountName, Byte[] 
                 value)
                    at Microsoft.Identity.Client.Extensions.Msal.MacKeychainAccessor.Write(Byte[] data)
                    at Microsoft.Identity.Client.Extensions.Msal.MsalCacheStorage.VerifyPersistence()
Exception      : System.Exception
InvocationInfo : {Connect-AzAccount}
Line           : Connect-AzAccount
Position       : At line:1 char:1
                 + Connect-AzAccount
                 + ~~~~~~~~~~~~~~~~~
HistoryId      : 14

   HistoryId: 9

Message        : DeviceCodeCredential authentication failed: Persistence check failed. Inspect inner exception for details
StackTrace     :    at Azure.Identity.CredentialDiagnosticScope.FailWrapAndThrow(Exception ex)
                    at Azure.Identity.DeviceCodeCredential.AuthenticateImplAsync(Boolean async, TokenRequestContext requestContext, 
                 CancellationToken cancellationToken)
                    at Azure.Identity.DeviceCodeCredential.AuthenticateAsync(TokenRequestContext requestContext, CancellationToken 
                 cancellationToken)
                    at Microsoft.Azure.PowerShell.Authenticators.MsalAccessToken.GetAccessTokenAsync(Task`1 authTask, TokenCredential 
                 tokenCredential, TokenRequestContext requestContext, CancellationToken cancellationToken)
                    at Microsoft.Azure.Commands.Common.Authentication.Factories.AuthenticationFactory.Authenticate(IAzureAccount 
                 account, IAzureEnvironment environment, String tenant, SecureString password, String promptBehavior, Action`1 
                 promptAction, IAzureTokenCache tokenCache, String resourceId)
                    at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.AcquireAccessToken(IAzureAccount account, 
                 IAzureEnvironment environment, String tenantId, SecureString password, String promptBehavior, Action`1 promptAction)
                    at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.Login(IAzureAccount account, IAzureEnvironment 
                 environment, String tenantId, String subscriptionId, String subscriptionName, SecureString password, Boolean 
                 skipValidation, Action`1 promptAction, String name, Boolean shouldPopulateContextList, Int32 maxContextPopulation)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass111_2.<ExecuteCmdlet>b__4()
                    at System.Threading.Tasks.Task`1.InnerInvoke()
                    at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext 
                 executionContext, ContextCallback callback, Object state)
                 --- End of stack trace from previous location ---
                    at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
                 --- End of stack trace from previous location ---
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass111_0.<ExecuteCmdlet>b__1(AzureR
                 mProfile localProfile, RMProfileClient profileClient, String name)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass118_0.<SetContextWithOverwritePr
                 ompt>b__0(AzureRmProfile prof, RMProfileClient client)
                    at Microsoft.Azure.Commands.Profile.Common.AzureContextModificationCmdlet.ModifyContext(Action`2 contextAction)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.SetContextWithOverwritePrompt(Action`3 
                 setContextAction)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.ExecuteCmdlet()
                    at 
                 Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.<ExecuteSynchronouslyOrAsJob>b__3_0(T c)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, 
                 Action`1 executor)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception      : Azure.Identity.AuthenticationFailedException
InvocationInfo : {Connect-AzAccount}
Line           : Connect-AzAccount -tenant xxxxxxxxxxremovedxxxxxxx -UseDeviceAuthentication
Position       : At line:1 char:1
                 + Connect-AzAccount -tenant xxxxxxxxxxremovedxxxxxxxx -UseDe …
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 9

Message        : Persistence check failed. Inspect inner exception for details
StackTrace     :    at Microsoft.Identity.Client.Extensions.Msal.MsalCacheStorage.VerifyPersistence()
                    at Microsoft.Identity.Client.Extensions.Msal.MsalCacheHelper.VerifyPersistence()
                    at Azure.Identity.PersistentTokenCache.GetCacheHelperAsync(Boolean async, CancellationToken cancellationToken)
                    at Azure.Identity.PersistentTokenCache.RegisterCache(Boolean async, ITokenCache tokenCache, CancellationToken 
                 cancellationToken)
                    at Azure.Identity.MsalClientBase`1.GetClientAsync(Boolean async, CancellationToken cancellationToken)
                    at Azure.Identity.MsalPublicClient.AcquireTokenWithDeviceCodeAsync(String[] scopes, Func`2 deviceCodeCallback, 
                 Boolean async, CancellationToken cancellationToken)
                    at Azure.Identity.DeviceCodeCredential.GetTokenViaDeviceCodeAsync(String[] scopes, Boolean async, 
                 CancellationToken cancellationToken)
                    at Azure.Identity.DeviceCodeCredential.AuthenticateImplAsync(Boolean async, TokenRequestContext requestContext, 
                 CancellationToken cancellationToken)
Exception      : Microsoft.Identity.Client.Extensions.Msal.MsalCachePersistenceException
InvocationInfo : {Connect-AzAccount}
Line           : Connect-AzAccount -tenant xxxxxremovedxxxxx -UseDeviceAuthentication
Position       : At line:1 char:1
                 + Connect-AzAccount -tenant xxxxxxremovedxxxxx -UseDe …
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 9

Message        : SecKeychainFindGenericPassword failed with error code: -25293
StackTrace     :    at Microsoft.Identity.Client.Extensions.Msal.MacKeyChain.WriteKey(String serviceName, String accountName, Byte[] 
                 value)
                    at Microsoft.Identity.Client.Extensions.Msal.MacKeychainAccessor.Write(Byte[] data)
                    at Microsoft.Identity.Client.Extensions.Msal.MsalCacheStorage.VerifyPersistence()
Exception      : System.Exception
InvocationInfo : {Connect-AzAccount}
Line           : Connect-AzAccount -tenant xxxxxremovedxxxxx -UseDeviceAuthentication
Position       : At line:1 char:1
                 + Connect-AzAccount -tenant xxxxxremovedxxxxx -UseDe …
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 9

   HistoryId: 8

Message        : DeviceCodeCredential authentication failed: Persistence check failed. Inspect inner exception for details
StackTrace     :    at Azure.Identity.CredentialDiagnosticScope.FailWrapAndThrow(Exception ex)
                    at Azure.Identity.DeviceCodeCredential.AuthenticateImplAsync(Boolean async, TokenRequestContext requestContext, 
                 CancellationToken cancellationToken)
                    at Azure.Identity.DeviceCodeCredential.AuthenticateAsync(TokenRequestContext requestContext, CancellationToken 
                 cancellationToken)
                    at Microsoft.Azure.PowerShell.Authenticators.MsalAccessToken.GetAccessTokenAsync(Task`1 authTask, TokenCredential 
                 tokenCredential, TokenRequestContext requestContext, CancellationToken cancellationToken)
                    at Microsoft.Azure.Commands.Common.Authentication.Factories.AuthenticationFactory.Authenticate(IAzureAccount 
                 account, IAzureEnvironment environment, String tenant, SecureString password, String promptBehavior, Action`1 
                 promptAction, IAzureTokenCache tokenCache, String resourceId)
                    at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.AcquireAccessToken(IAzureAccount account, 
                 IAzureEnvironment environment, String tenantId, SecureString password, String promptBehavior, Action`1 promptAction)
                    at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.ListAccountTenants(IAzureAccount account, 
                 IAzureEnvironment environment, SecureString password, String promptBehavior, Action`1 promptAction)
                    at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.Login(IAzureAccount account, IAzureEnvironment 
                 environment, String tenantId, String subscriptionId, String subscriptionName, SecureString password, Boolean 
                 skipValidation, Action`1 promptAction, String name, Boolean shouldPopulateContextList, Int32 maxContextPopulation)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass111_2.<ExecuteCmdlet>b__4()
                    at System.Threading.Tasks.Task`1.InnerInvoke()
                    at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext 
                 executionContext, ContextCallback callback, Object state)
                 --- End of stack trace from previous location ---
                    at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
                 --- End of stack trace from previous location ---
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass111_0.<ExecuteCmdlet>b__1(AzureR
                 mProfile localProfile, RMProfileClient profileClient, String name)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass118_0.<SetContextWithOverwritePr
                 ompt>b__0(AzureRmProfile prof, RMProfileClient client)
                    at Microsoft.Azure.Commands.Profile.Common.AzureContextModificationCmdlet.ModifyContext(Action`2 contextAction)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.SetContextWithOverwritePrompt(Action`3 
                 setContextAction)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.ExecuteCmdlet()
                    at 
                 Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.<ExecuteSynchronouslyOrAsJob>b__3_0(T c)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, 
                 Action`1 executor)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception      : Azure.Identity.AuthenticationFailedException
InvocationInfo : {Connect-AzAccount}
Line           : Connect-AzAccount -UseDeviceAuthentication
Position       : At line:1 char:1
                 + Connect-AzAccount -UseDeviceAuthentication
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 8

Message        : Persistence check failed. Inspect inner exception for details
StackTrace     :    at Microsoft.Identity.Client.Extensions.Msal.MsalCacheStorage.VerifyPersistence()
                    at Microsoft.Identity.Client.Extensions.Msal.MsalCacheHelper.VerifyPersistence()
                    at Azure.Identity.PersistentTokenCache.GetCacheHelperAsync(Boolean async, CancellationToken cancellationToken)
                    at Azure.Identity.PersistentTokenCache.RegisterCache(Boolean async, ITokenCache tokenCache, CancellationToken 
                 cancellationToken)
                    at Azure.Identity.MsalClientBase`1.GetClientAsync(Boolean async, CancellationToken cancellationToken)
                    at Azure.Identity.MsalPublicClient.AcquireTokenWithDeviceCodeAsync(String[] scopes, Func`2 deviceCodeCallback, 
                 Boolean async, CancellationToken cancellationToken)
                    at Azure.Identity.DeviceCodeCredential.GetTokenViaDeviceCodeAsync(String[] scopes, Boolean async, 
                 CancellationToken cancellationToken)
                    at Azure.Identity.DeviceCodeCredential.AuthenticateImplAsync(Boolean async, TokenRequestContext requestContext, 
                 CancellationToken cancellationToken)
Exception      : Microsoft.Identity.Client.Extensions.Msal.MsalCachePersistenceException
InvocationInfo : {Connect-AzAccount}
Line           : Connect-AzAccount -UseDeviceAuthentication
Position       : At line:1 char:1
                 + Connect-AzAccount -UseDeviceAuthentication
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 8

Message        : SecKeychainFindGenericPassword failed with error code: -25293
StackTrace     :    at Microsoft.Identity.Client.Extensions.Msal.MacKeyChain.WriteKey(String serviceName, String accountName, Byte[] 
                 value)
                    at Microsoft.Identity.Client.Extensions.Msal.MacKeychainAccessor.Write(Byte[] data)
                    at Microsoft.Identity.Client.Extensions.Msal.MsalCacheStorage.VerifyPersistence()
Exception      : System.Exception
InvocationInfo : {Connect-AzAccount}
Line           : Connect-AzAccount -UseDeviceAuthentication
Position       : At line:1 char:1
                 + Connect-AzAccount -UseDeviceAuthentication
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 8

   HistoryId: 7

Message        : UsernamePasswordCredential authentication failed: Persistence check failed. Inspect inner exception for details
StackTrace     :    at Azure.Identity.CredentialDiagnosticScope.FailWrapAndThrow(Exception ex)
                    at Azure.Identity.UsernamePasswordCredential.GetTokenImplAsync(Boolean async, TokenRequestContext requestContext, 
                 CancellationToken cancellationToken)
                    at Azure.Identity.UsernamePasswordCredential.AuthenticateImplAsync(Boolean async, TokenRequestContext 
                 requestContext, CancellationToken cancellationToken)
                    at Azure.Identity.CredentialDiagnosticScope.FailWrapAndThrow(Exception ex)
                    at Azure.Identity.UsernamePasswordCredential.AuthenticateImplAsync(Boolean async, TokenRequestContext 
                 requestContext, CancellationToken cancellationToken)
                    at Azure.Identity.UsernamePasswordCredential.AuthenticateAsync(TokenRequestContext requestContext, 
                 CancellationToken cancellationToken)
                    at Microsoft.Azure.PowerShell.Authenticators.MsalAccessToken.GetAccessTokenAsync(Task`1 authTask, TokenCredential 
                 tokenCredential, TokenRequestContext requestContext, CancellationToken cancellationToken)
                    at Microsoft.Azure.Commands.Common.Authentication.Factories.AuthenticationFactory.Authenticate(IAzureAccount 
                 account, IAzureEnvironment environment, String tenant, SecureString password, String promptBehavior, Action`1 
                 promptAction, IAzureTokenCache tokenCache, String resourceId)
                    at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.AcquireAccessToken(IAzureAccount account, 
                 IAzureEnvironment environment, String tenantId, SecureString password, String promptBehavior, Action`1 promptAction)
                    at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.Login(IAzureAccount account, IAzureEnvironment 
                 environment, String tenantId, String subscriptionId, String subscriptionName, SecureString password, Boolean 
                 skipValidation, Action`1 promptAction, String name, Boolean shouldPopulateContextList, Int32 maxContextPopulation)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass111_2.<ExecuteCmdlet>b__4()
                    at System.Threading.Tasks.Task`1.InnerInvoke()
                    at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext 
                 executionContext, ContextCallback callback, Object state)
                 --- End of stack trace from previous location ---
                    at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
                 --- End of stack trace from previous location ---
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass111_0.<ExecuteCmdlet>b__1(AzureR
                 mProfile localProfile, RMProfileClient profileClient, String name)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass118_0.<SetContextWithOverwritePr
                 ompt>b__0(AzureRmProfile prof, RMProfileClient client)
                    at Microsoft.Azure.Commands.Profile.Common.AzureContextModificationCmdlet.ModifyContext(Action`2 contextAction)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.SetContextWithOverwritePrompt(Action`3 
                 setContextAction)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.ExecuteCmdlet()
                    at 
                 Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.<ExecuteSynchronouslyOrAsJob>b__3_0(T c)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, 
                 Action`1 executor)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception      : Azure.Identity.AuthenticationFailedException
InvocationInfo : {Connect-AzAccount}
Line           : Connect-AzAccount -tenant xxxxxremovedxxxxx -Credential $cred
Position       : At line:1 char:1
                 + Connect-AzAccount -tenant xxxxxremovedxxxxx -Crede …
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 7

Message        : Persistence check failed. Inspect inner exception for details
StackTrace     :    at Microsoft.Identity.Client.Extensions.Msal.MsalCacheStorage.VerifyPersistence()
                    at Microsoft.Identity.Client.Extensions.Msal.MsalCacheHelper.VerifyPersistence()
                    at Azure.Identity.PersistentTokenCache.GetCacheHelperAsync(Boolean async, CancellationToken cancellationToken)
                    at Azure.Identity.PersistentTokenCache.RegisterCache(Boolean async, ITokenCache tokenCache, CancellationToken 
                 cancellationToken)
                    at Azure.Identity.MsalClientBase`1.GetClientAsync(Boolean async, CancellationToken cancellationToken)
                    at Azure.Identity.MsalPublicClient.AcquireTokenByUsernamePasswordAsync(String[] scopes, String username, 
                 SecureString password, Boolean async, CancellationToken cancellationToken)
                    at Azure.Identity.UsernamePasswordCredential.GetTokenImplAsync(Boolean async, TokenRequestContext requestContext, 
                 CancellationToken cancellationToken)
Exception      : Microsoft.Identity.Client.Extensions.Msal.MsalCachePersistenceException
InvocationInfo : {Connect-AzAccount}
Line           : Connect-AzAccount -tenant xxxxxremovedxxxxx -Credential $cred
Position       : At line:1 char:1
                 + Connect-AzAccount -tenant xxxxxremovedxxxxx -Crede …
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 7

Message        : SecKeychainFindGenericPassword failed with error code: -25293
StackTrace     :    at Microsoft.Identity.Client.Extensions.Msal.MacKeyChain.WriteKey(String serviceName, String accountName, Byte[] 
                 value)
                    at Microsoft.Identity.Client.Extensions.Msal.MacKeychainAccessor.Write(Byte[] data)
                    at Microsoft.Identity.Client.Extensions.Msal.MsalCacheStorage.VerifyPersistence()
Exception      : System.Exception
InvocationInfo : {Connect-AzAccount}
Line           : Connect-AzAccount -tenant xxxxxremovedxxxxx -Credential $cred
Position       : At line:1 char:1
                 + Connect-AzAccount -tenant xxxxxremovedxxxxx -Crede …
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 7

   HistoryId: 4

Message        : InteractiveBrowserCredential authentication failed: Persistence check failed. Inspect inner exception for details
StackTrace     :    at Azure.Identity.CredentialDiagnosticScope.FailWrapAndThrow(Exception ex)
                    at Azure.Identity.InteractiveBrowserCredential.AuthenticateImplAsync(Boolean async, TokenRequestContext 
                 requestContext, CancellationToken cancellationToken)
                    at Azure.Identity.InteractiveBrowserCredential.AuthenticateAsync(TokenRequestContext requestContext, 
                 CancellationToken cancellationToken)
                    at Microsoft.Azure.PowerShell.Authenticators.MsalAccessToken.GetAccessTokenAsync(Task`1 authTask, TokenCredential 
                 tokenCredential, TokenRequestContext requestContext, CancellationToken cancellationToken)
                    at Microsoft.Azure.Commands.Common.Authentication.Factories.AuthenticationFactory.Authenticate(IAzureAccount 
                 account, IAzureEnvironment environment, String tenant, SecureString password, String promptBehavior, Action`1 
                 promptAction, IAzureTokenCache tokenCache, String resourceId)
                    at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.AcquireAccessToken(IAzureAccount account, 
                 IAzureEnvironment environment, String tenantId, SecureString password, String promptBehavior, Action`1 promptAction)
                    at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.Login(IAzureAccount account, IAzureEnvironment 
                 environment, String tenantId, String subscriptionId, String subscriptionName, SecureString password, Boolean 
                 skipValidation, Action`1 promptAction, String name, Boolean shouldPopulateContextList, Int32 maxContextPopulation)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass111_2.<ExecuteCmdlet>b__4()
                    at System.Threading.Tasks.Task`1.InnerInvoke()
                    at System.Threading.Tasks.Task.<>c.<.cctor>b__277_0(Object obj)
                    at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext 
                 executionContext, ContextCallback callback, Object state)
                 --- End of stack trace from previous location ---
                    at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext 
                 executionContext, ContextCallback callback, Object state)
                    at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
                 --- End of stack trace from previous location ---
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass111_0.<ExecuteCmdlet>b__1(AzureR
                 mProfile localProfile, RMProfileClient profileClient, String name)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass118_0.<SetContextWithOverwritePr
                 ompt>b__0(AzureRmProfile prof, RMProfileClient client)
                    at Microsoft.Azure.Commands.Profile.Common.AzureContextModificationCmdlet.ModifyContext(Action`2 contextAction)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.SetContextWithOverwritePrompt(Action`3 
                 setContextAction)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.ExecuteCmdlet()
                    at 
                 Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.<ExecuteSynchronouslyOrAsJob>b__3_0(T c)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, 
                 Action`1 executor)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception      : Azure.Identity.AuthenticationFailedException
InvocationInfo : {Connect-AzAccount}
Line           : Connect-AzAccount -tenant xxxxxremovedxxxxx
Position       : At line:1 char:1
                 + Connect-AzAccount -tenant xxxxxremovedxxxxx
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 4

Message        : Persistence check failed. Inspect inner exception for details
StackTrace     :    at Microsoft.Identity.Client.Extensions.Msal.MsalCacheStorage.VerifyPersistence()
                    at Microsoft.Identity.Client.Extensions.Msal.MsalCacheHelper.VerifyPersistence()
                    at Azure.Identity.PersistentTokenCache.GetCacheHelperAsync(Boolean async, CancellationToken cancellationToken)
                    at Azure.Identity.PersistentTokenCache.RegisterCache(Boolean async, ITokenCache tokenCache, CancellationToken 
                 cancellationToken)
                    at Azure.Identity.MsalClientBase`1.GetClientAsync(Boolean async, CancellationToken cancellationToken)
                    at Azure.Identity.MsalPublicClient.AcquireTokenInteractiveAsync(String[] scopes, Prompt prompt, Boolean async, 
                 CancellationToken cancellationToken)
                    at Azure.Identity.InteractiveBrowserCredential.GetTokenViaBrowserLoginAsync(String[] scopes, Boolean async, 
                 CancellationToken cancellationToken)
                    at Azure.Identity.InteractiveBrowserCredential.AuthenticateImplAsync(Boolean async, TokenRequestContext 
                 requestContext, CancellationToken cancellationToken)
Exception      : Microsoft.Identity.Client.Extensions.Msal.MsalCachePersistenceException
InvocationInfo : {Connect-AzAccount}
Line           : Connect-AzAccount -tenant xxxxxremovedxxxxx
Position       : At line:1 char:1
                 + Connect-AzAccount -tenant xxxxxremovedxxxxx
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 4

Message        : SecKeychainFindGenericPassword failed with error code: -25293
StackTrace     :    at Microsoft.Identity.Client.Extensions.Msal.MacKeyChain.WriteKey(String serviceName, String accountName, Byte[] 
                 value)
                    at Microsoft.Identity.Client.Extensions.Msal.MacKeychainAccessor.Write(Byte[] data)
                    at Microsoft.Identity.Client.Extensions.Msal.MsalCacheStorage.VerifyPersistence()
Exception      : System.Exception
InvocationInfo : {Connect-AzAccount}
Line           : Connect-AzAccount -tenant xxxxxremovedxxxxx
Position       : At line:1 char:1
                 + Connect-AzAccount -tenant xxxxxremovedxxxxx
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 4

   HistoryId: 3

Message        : The term 'gConnect-AzAccount' is not recognized as a name of a cmdlet, function, script file, or executable program.
                 Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
StackTrace     :    at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, 
                 SearchResolutionOptions searchResolutionOptions, CommandOrigin commandOrigin, ExecutionContext context)
                    at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandOrigin 
                 commandOrigin, ExecutionContext context)
                    at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandOrigin 
                 commandOrigin)
                    at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin 
                 commandOrigin, Nullable`1 useLocalScope)
                    at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource)
                    at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] 
                 commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context)
                    at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, 
                 CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] 
                 commandRedirections, FunctionContext funcContext)
                    at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
                    at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
Exception      : System.Management.Automation.CommandNotFoundException
InvocationInfo : {}
Line           : gConnect-AzAccount -tenant xxxxxremovedxxxxx
Position       : At line:1 char:1
                 + gConnect-AzAccount -tenant xxxxxremovedxxxxx
                 + ~~~~~~~~~~~~~~~~~~
HistoryId      : 3

   HistoryId: 2

Message        : The term 'start-trace' is not recognized as a name of a cmdlet, function, script file, or executable program.
                 Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
StackTrace     :    at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, 
                 SearchResolutionOptions searchResolutionOptions, CommandOrigin commandOrigin, ExecutionContext context)
                    at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandOrigin 
                 commandOrigin, ExecutionContext context)
                    at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandOrigin 
                 commandOrigin)
                    at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin 
                 commandOrigin, Nullable`1 useLocalScope)
                    at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource)
                    at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] 
                 commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context)
                    at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, 
                 CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] 
                 commandRedirections, FunctionContext funcContext)
                    at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
                    at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
Exception      : System.Management.Automation.CommandNotFoundException
InvocationInfo : {}
Line           : start-trace
Position       : At line:1 char:1
                 + start-trace
                 + ~~~~~~~~~~~
HistoryId      : 2

   HistoryId: 1

Message        : InteractiveBrowserCredential authentication failed: Persistence check failed. Inspect inner exception for details
StackTrace     :    at Azure.Identity.CredentialDiagnosticScope.FailWrapAndThrow(Exception ex)
                    at Azure.Identity.InteractiveBrowserCredential.AuthenticateImplAsync(Boolean async, TokenRequestContext 
                 requestContext, CancellationToken cancellationToken)
                    at Azure.Identity.InteractiveBrowserCredential.AuthenticateAsync(TokenRequestContext requestContext, 
                 CancellationToken cancellationToken)
                    at Microsoft.Azure.PowerShell.Authenticators.MsalAccessToken.GetAccessTokenAsync(Task`1 authTask, TokenCredential 
                 tokenCredential, TokenRequestContext requestContext, CancellationToken cancellationToken)
                    at Microsoft.Azure.Commands.Common.Authentication.Factories.AuthenticationFactory.Authenticate(IAzureAccount 
                 account, IAzureEnvironment environment, String tenant, SecureString password, String promptBehavior, Action`1 
                 promptAction, IAzureTokenCache tokenCache, String resourceId)
                    at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.AcquireAccessToken(IAzureAccount account, 
                 IAzureEnvironment environment, String tenantId, SecureString password, String promptBehavior, Action`1 promptAction)
                    at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.ListAccountTenants(IAzureAccount account, 
                 IAzureEnvironment environment, SecureString password, String promptBehavior, Action`1 promptAction)
                    at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.Login(IAzureAccount account, IAzureEnvironment 
                 environment, String tenantId, String subscriptionId, String subscriptionName, SecureString password, Boolean 
                 skipValidation, Action`1 promptAction, String name, Boolean shouldPopulateContextList, Int32 maxContextPopulation)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass111_2.<ExecuteCmdlet>b__4()
                    at System.Threading.Tasks.Task`1.InnerInvoke()
                    at System.Threading.Tasks.Task.<>c.<.cctor>b__277_0(Object obj)
                    at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext 
                 executionContext, ContextCallback callback, Object state)
                 --- End of stack trace from previous location ---
                    at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext 
                 executionContext, ContextCallback callback, Object state)
                    at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
                 --- End of stack trace from previous location ---
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass111_0.<ExecuteCmdlet>b__1(AzureR
                 mProfile localProfile, RMProfileClient profileClient, String name)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass118_0.<SetContextWithOverwritePr
                 ompt>b__0(AzureRmProfile prof, RMProfileClient client)
                    at Microsoft.Azure.Commands.Profile.Common.AzureContextModificationCmdlet.ModifyContext(Action`2 contextAction)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.SetContextWithOverwritePrompt(Action`3 
                 setContextAction)
                    at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.ExecuteCmdlet()
                    at 
                 Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.<ExecuteSynchronouslyOrAsJob>b__3_0(T c)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, 
                 Action`1 executor)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception      : Azure.Identity.AuthenticationFailedException
InvocationInfo : {Connect-AzAccount}
Line           : Connect-azaccount
Position       : At line:1 char:1
                 + Connect-azaccount
                 + ~~~~~~~~~~~~~~~~~
HistoryId      : 1

Message        : Persistence check failed. Inspect inner exception for details
StackTrace     :    at Microsoft.Identity.Client.Extensions.Msal.MsalCacheStorage.VerifyPersistence()
                    at Microsoft.Identity.Client.Extensions.Msal.MsalCacheHelper.VerifyPersistence()
                    at Azure.Identity.PersistentTokenCache.GetCacheHelperAsync(Boolean async, CancellationToken cancellationToken)
                    at Azure.Identity.PersistentTokenCache.RegisterCache(Boolean async, ITokenCache tokenCache, CancellationToken 
                 cancellationToken)
                    at Azure.Identity.MsalClientBase`1.GetClientAsync(Boolean async, CancellationToken cancellationToken)
                    at Azure.Identity.MsalPublicClient.AcquireTokenInteractiveAsync(String[] scopes, Prompt prompt, Boolean async, 
                 CancellationToken cancellationToken)
                    at Azure.Identity.InteractiveBrowserCredential.GetTokenViaBrowserLoginAsync(String[] scopes, Boolean async, 
                 CancellationToken cancellationToken)
                    at Azure.Identity.InteractiveBrowserCredential.AuthenticateImplAsync(Boolean async, TokenRequestContext 
                 requestContext, CancellationToken cancellationToken)
Exception      : Microsoft.Identity.Client.Extensions.Msal.MsalCachePersistenceException
InvocationInfo : {Connect-AzAccount}
Line           : Connect-azaccount
Position       : At line:1 char:1
                 + Connect-azaccount
                 + ~~~~~~~~~~~~~~~~~
HistoryId      : 1

Message        : SecKeychainFindGenericPassword failed with error code: -25293
StackTrace     :    at Microsoft.Identity.Client.Extensions.Msal.MacKeyChain.WriteKey(String serviceName, String accountName, Byte[] 
                 value)
                    at Microsoft.Identity.Client.Extensions.Msal.MacKeychainAccessor.Write(Byte[] data)
                    at Microsoft.Identity.Client.Extensions.Msal.MsalCacheStorage.VerifyPersistence()
Exception      : System.Exception
InvocationInfo : {Connect-AzAccount}
Line           : Connect-azaccount
Position       : At line:1 char:1
                 + Connect-azaccount
                 + ~~~~~~~~~~~~~~~~~
HistoryId      : 1

The Azure PowerShell team is listening, please let us know how we are doing: https://aka.ms/azpssurvey?Q_CHL=ERROR.

DEBUG: AzureQoSEvent: CommandName - Resolve-AzError; IsSuccess - True; Duration - 00:00:00.0468060
DEBUG: Finish sending metric.
DEBUG: 1:37:29 PM - ResolveError end processing.
ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Wmengmsft, @MehaKaushik, @shurd, @anfeldma-ms

erich-wang commented 3 years ago

@bgavrilMS, could you please take a look? It seems similar to #13714

bgavrilMS commented 3 years ago

@erich-wang, is PowerShell from this work item using https://www.nuget.org/packages/Microsoft.Identity.Client.Extensions.Msal/ version 2.18.0? I.e. did you patch it with the latest extensions lib?

Arunbalaji-Srinivasan commented 3 years ago

I have been debugging this exact issue for a few days now and it is being a major blocker for me. I have tried the MSAL library update as well and that doesn't seem to fix the issue on my machine. Could you please let me know the version of PWSH and Az module (Az.Accounts as well) that you're using? Any help is appreciated. @dcaro @bgavrilMS @erich-wang

Please find below the stack trace of this exception that I'm facing.

TargetSite : System.Exception FailWrapAndThrow(System.Exception) StackTrace : at Azure.Identity.CredentialDiagnosticScope.FailWrapAndThrow(Exception ex) at Azure.Identity.InteractiveBrowserCredential.AuthenticateImplAsync(Boolean async, TokenRequestContext requestContext, CancellationToken cancellationToken) at Azure.Identity.InteractiveBrowserCredential.AuthenticateAsync(TokenRequestContext requestContext, CancellationToken cancellationToken) at Microsoft.Azure.PowerShell.Authenticators.MsalAccessToken.GetAccessTokenAsync(Task1 authTask, TokenCredential tokenCredential, TokenRequestContext requestContext, CancellationToken cancellationToken) at Microsoft.Azure.Commands.Common.Authentication.Factories.AuthenticationFactory.Authenticate(IAzureAccount account, IAzureEnvironment environment, String tenant, SecureString password, String promptBehavior, Action1 promptAction, IAzureTokenCache tokenCache, String resourceId) at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.AcquireAccessToken(IAzureAccount account, IAzureEnvironment environment, String tenantId, SecureString password, String promptBehavior, Action1 promptAction) at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.ListAccountTenants(IAzureAccount account, IAzureEnvironment environment, SecureString password, String promptBehavior, Action1 promptAction) at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.Login(IAzureAccount account, IAzureEnvironment environment, String tenantId, String subscriptionId, String subscriptionName, SecureString password, Boolean skipValidation, Action1 promptAction, String name, Boolean shouldPopulateContextList, Int32 maxContextPopulation) at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>cDisplayClass111_2.b4() at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>cDisplayClass111_0.b1(AzureRmProfile localProfile, RMProfileClient profileClient, String name) at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass118_0.b0( AzureRmProfile prof, RMProfileClient client) at Microsoft.Azure.Commands.Profile.Common.AzureContextModificationCmdlet.ModifyContext(Action2 contextAction) at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.SetContextWithOverwritePrompt(Action3 setContextAction) at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.ExecuteCmdlet() at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c31.b__3_0(T c) at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, Action1 executor) at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet) at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() Message : InteractiveBrowserCredential authentication failed: Persistence check failed. Inspect inner exception for details Data : {} InnerException : Microsoft.Identity.Client.Extensions.Msal.MsalCachePersistenceException: Persistence check failed. Inspect inner exception for details ---> System.Exception: SecKeychainFindGenericPassword failed with error code: -25293 at Microsoft.Identity.Client.Extensions.Msal.MacKeyChain.WriteKey(String serviceName, String accountName, Byte[] value) at Microsoft.Identity.Client.Extensions.Msal.MacKeychainAccessor.Write(Byte[] data) at Microsoft.Identity.Client.Extensions.Msal.MsalCacheStorage.VerifyPersistence() --- End of inner exception stack trace --- at Microsoft.Identity.Client.Extensions.Msal.MsalCacheStorage.VerifyPersistence() at Microsoft.Identity.Client.Extensions.Msal.MsalCacheHelper.VerifyPersistence() at Azure.Identity.PersistentTokenCache.GetCacheHelperAsync(Boolean async, CancellationToken cancellationToken) at Azure.Identity.PersistentTokenCache.RegisterCache(Boolean async, ITokenCache tokenCache, CancellationToken cancellationToken) at Azure.Identity.MsalClientBase`1.GetClientAsync(Boolean async, CancellationToken cancellationToken) at Azure.Identity.MsalPublicClient.AcquireTokenInteractiveAsync(String[] scopes, Prompt prompt, Boolean async, CancellationToken cancellationToken) at Azure.Identity.InteractiveBrowserCredential.GetTokenViaBrowserLoginAsync(String[] scopes, Boolean async, CancellationToken cancellationToken) at Azure.Identity.InteractiveBrowserCredential.AuthenticateImplAsync(Boolean async, TokenRequestContext requestContext, CancellationToken cancellationToken) HelpLink : Source : Azure.Identity HResult : -2146233088

TargetSite : Void VerifyPersistence() StackTrace : at Microsoft.Identity.Client.Extensions.Msal.MsalCacheStorage.VerifyPersistence() at Microsoft.Identity.Client.Extensions.Msal.MsalCacheHelper.VerifyPersistence() at Azure.Identity.PersistentTokenCache.GetCacheHelperAsync(Boolean async, CancellationToken cancellationToken) at Azure.Identity.PersistentTokenCache.RegisterCache(Boolean async, ITokenCache tokenCache, CancellationToken cancellationToken) at Azure.Identity.MsalClientBase`1.GetClientAsync(Boolean async, CancellationToken cancellationToken) at Azure.Identity.MsalPublicClient.AcquireTokenInteractiveAsync(String[] scopes, Prompt prompt, Boolean async, CancellationToken cancellationToken) at Azure.Identity.InteractiveBrowserCredential.GetTokenViaBrowserLoginAsync(String[] scopes, Boolean async, CancellationToken cancellationToken) at Azure.Identity.InteractiveBrowserCredential.AuthenticateImplAsync(Boolean async, TokenRequestContext requestContext, CancellationToken cancellationToken) Message : Persistence check failed. Inspect inner exception for details Data : {} InnerException : System.Exception: SecKeychainFindGenericPassword failed with error code: -25293 at Microsoft.Identity.Client.Extensions.Msal.MacKeyChain.WriteKey(String serviceName, String accountName, Byte[] value) at Microsoft.Identity.Client.Extensions.Msal.MacKeychainAccessor.Write(Byte[] data) at Microsoft.Identity.Client.Extensions.Msal.MsalCacheStorage.VerifyPersistence() HelpLink : Source : Microsoft.Identity.Client.Extensions.Msal HResult : -2146233088

erich-wang commented 3 years ago

@prestoncook00 , could you please follow steps to verify if latest version of MSAL lib (MSAL 4.27, MSAL extension 2.18, I updated file in step 4 below) fix your issue:

  1. Make sure you have installed Az.Accounts 2.2.x, the latest version is 2.2.6
  2. Run Clear-AzContext
  3. Restart pwsh
  4. Download upgraded MSAL libraries from below link: https://erich20diag.blob.core.windows.net/erich/Microsoft.Identity.Client.Extensions.Msal.dll https://erich20diag.blob.core.windows.net/erich/Microsoft.Identity.Client.dll
  5. Copy the above two libs to override the ones under Az.Accounts, the destination folder should be like /Users/yourname/.local/share/powershell/Modules/Az.Accounts/2.2.x/NetCoreAssemblies/, you need replace with real value for bold part in the path.
  6. Try Connect-AzAccount to see if issue remains.
ghost commented 3 years ago

Didn’t work, after running a brew update and brew upgrade I was at 2.2.5 and pwsh 7.1.2. Ran the recommended steps and the issue remains

PS /Users/prestonc> connect-azaccount

WARNING: INITIALIZATION: Token cache encryption is not supported in current environment and token cache will be fallen back as plain text.

WARNING: Unable to acquire token for tenant 'organizations'

WARNING: Please run 'Connect-AzAccount -DeviceCode' if browser is not supported in this session.

Connect-AzAccount: InteractiveBrowserCredential authentication failed: Persistence check failed. Reason: KeyChain authorization/authentication failed. .Error code: -25293. OS error code -25293.

PS /Users/prestonc>

Preston Cook | Cloud Engineer II | Global Technology Services Herbalife Nutrition | 14944 Pony Express Dr., Bluffdale, UT 84065webextlink://14944%20Pony%20Express%20Dr.,%20Bluffdale,%20UT%2084065 310 410 9600 x 74127013 | Direct 310 258 7013 | Cell 310 357 4826 @.**@.> Learn about the many ways we do it at IAmHerbalifeNutrition.com.

From: erich-wang @.> Date: Friday, March 12, 2021 at 07:24 To: Azure/azure-powershell @.> Cc: Preston Cook @.>, Mention @.> Subject: [External] Re: [Azure/azure-powershell] OSX Connect-AzAccount doesn't function (#14478) CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

@prestoncook00https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fprestoncook00&data=04%7C01%7Cprestonc%40herbalife.com%7C48fd5110413f45e58b2e08d8e5629a35%7C101f87a76d6b4c6c9d9c223592a2ba50%7C0%7C0%7C637511558952282095%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=1dBqI%2F5oEUd9J1OZ5VGTQRzDaJkpZEZjAz97NPi1jq0%3D&reserved=0 , could you please follow steps to verify if latest version of MSAL lib (MSAL 4.27, MSAL extension 2.18, I updated file in step 4 below) fix your issue:

  1. Make sure you have installed Az.Accounts 2.2.x, the latest version is 2.2.6
  2. Run Clear-AzContext
  3. Restart pwsh
  4. Download upgraded MSAL libraries from below link: https://erich20diag.blob.core.windows.net/erich/Microsoft.Identity.Client.Extensions.Msal.dllhttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Ferich20diag.blob.core.windows.net%2Ferich%2FMicrosoft.Identity.Client.Extensions.Msal.dll&data=04%7C01%7Cprestonc%40herbalife.com%7C48fd5110413f45e58b2e08d8e5629a35%7C101f87a76d6b4c6c9d9c223592a2ba50%7C0%7C0%7C637511558952292092%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Q9Dt0bxnGniodXHYWDNyAxwCabNyocanj6yHKVNCeyU%3D&reserved=0 https://erich20diag.blob.core.windows.net/erich/Microsoft.Identity.Client.dllhttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Ferich20diag.blob.core.windows.net%2Ferich%2FMicrosoft.Identity.Client.dll&data=04%7C01%7Cprestonc%40herbalife.com%7C48fd5110413f45e58b2e08d8e5629a35%7C101f87a76d6b4c6c9d9c223592a2ba50%7C0%7C0%7C637511558952302082%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=jeFSAI021zO7MIXF98BR0fMs6WCgcPZxlMbI6%2FGa7kE%3D&reserved=0
  5. Copy the above two libs to override the ones under Az.Accounts, the destination folder should be like /Users/yourname/.local/share/powershell/Modules/Az.Accounts/2.2.x/NetCoreAssemblies/, you need replace with real value for bold part in the path.
  6. Try Connect-AzAccount to see if issue remains.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2Fazure-powershell%2Fissues%2F14478%23issuecomment-797521672&data=04%7C01%7Cprestonc%40herbalife.com%7C48fd5110413f45e58b2e08d8e5629a35%7C101f87a76d6b4c6c9d9c223592a2ba50%7C0%7C0%7C637511558952302082%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=PedE6aZf0Ep4jY1CyDdvQ1aMmzIMQSvXzZiRdMB%2FVjw%3D&reserved=0, or unsubscribehttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FATERNET2VS37PJZWQYF4NYTTDIP3HANCNFSM4Y2DFSBQ&data=04%7C01%7Cprestonc%40herbalife.com%7C48fd5110413f45e58b2e08d8e5629a35%7C101f87a76d6b4c6c9d9c223592a2ba50%7C0%7C0%7C637511558952302082%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=bxFwbEuttKcnRGvPWbPdnTReahRhj%2BxsYlfFq1rNGCE%3D&reserved=0.

erich-wang commented 3 years ago

@bgavrilMS, the user still get the error after using MSAL 4.27 + MSAL extension 2.18, could you please take a look?

bgavrilMS commented 3 years ago

I am not sure what the next steps are, we may have to contact Apple to get some help. Some folks have reported solving the issue by restarting the machine.

It may be an issue with how PowerShell is signed on Mac.

ghost commented 3 years ago

Rebooting doesn’t help.

Preston Cook | Cloud Engineer II | Global Technology Services Herbalife Nutrition | 14944 Pony Express Dr., Bluffdale, UT 84065webextlink://14944%20Pony%20Express%20Dr.,%20Bluffdale,%20UT%2084065 310 410 9600 x 74127013 | Direct 310 258 7013 | Cell 310 357 4826 @.**@.> Learn about the many ways we do it at IAmHerbalifeNutrition.com.

From: Bogdan Gavril @.> Date: Monday, March 15, 2021 at 00:13 To: Azure/azure-powershell @.> Cc: Preston Cook @.>, Mention @.> Subject: [External] Re: [Azure/azure-powershell] OSX Connect-AzAccount doesn't function (#14478) CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

I am not sure what the next steps are, we may have to contact Apple to get some help. Some folks have reported solving the issue by restarting the machine.

It may be an issue with how PowerShell is signed on Mac.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2Fazure-powershell%2Fissues%2F14478%23issuecomment-799175178&data=04%7C01%7Cprestonc%40herbalife.com%7C968d4fccbee343a4e4e308d8e781cfca%7C101f87a76d6b4c6c9d9c223592a2ba50%7C0%7C0%7C637513892017128577%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=wy0122X4Xh5pktPAEhgWO7HT7%2Bg5d5flni2E9m9kaIU%3D&reserved=0, or unsubscribehttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FATERNESFF3PDJWH6PZKUB3DTDWXQ7ANCNFSM4Y2DFSBQ&data=04%7C01%7Cprestonc%40herbalife.com%7C968d4fccbee343a4e4e308d8e781cfca%7C101f87a76d6b4c6c9d9c223592a2ba50%7C0%7C0%7C637513892017128577%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=pFZfbYuElzkbAWZleNAkfcnQ%2Fl%2Bv6VhJ4kwQmxb%2BT%2B4%3D&reserved=0.

bgavrilMS commented 3 years ago

Apollogies for the delay, I'm working on creating a diagnostics app that will try to access various keychain locations, to see what's going on.

ghost commented 3 years ago

no prob, this is very low urgency

Preston Cook | Cloud Engineer II | Global Technology Services Herbalife Nutrition | 14944 Pony Express Dr., Bluffdale, UT 84065webextlink://14944%20Pony%20Express%20Dr.,%20Bluffdale,%20UT%2084065 310 410 9600 x 74127013 | Direct 310 258 7013 | Cell 310 357 4826 @.**@.> Learn about the many ways we do it at IAmHerbalifeNutrition.com.

From: Bogdan Gavril @.> Date: Monday, March 22, 2021 at 09:59 To: Azure/azure-powershell @.> Cc: Preston Cook @.>, Mention @.> Subject: [External] Re: [Azure/azure-powershell] OSX Connect-AzAccount doesn't function (#14478) CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Apollogies for the delay, I'm working on creating a diagnostics app that will try to access various keychain locations, to see what's going on.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2Fazure-powershell%2Fissues%2F14478%23issuecomment-804183596&data=04%7C01%7Cprestonc%40herbalife.com%7C9ed23af140564650484008d8ed4b89f3%7C101f87a76d6b4c6c9d9c223592a2ba50%7C0%7C0%7C637520255989222195%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=R6aa0A0y9wbvS1Fqf2jRFMv%2B3GxBRiJ3iXJQFhG%2FZq8%3D&reserved=0, or unsubscribehttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FATERNETGJMCBLWMC2RFDM2DTE5SPXANCNFSM4Y2DFSBQ&data=04%7C01%7Cprestonc%40herbalife.com%7C9ed23af140564650484008d8ed4b89f3%7C101f87a76d6b4c6c9d9c223592a2ba50%7C0%7C0%7C637520255989222195%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=D1y4NfwkO%2F%2Bsc9p76mExPjfYeuzEpnEWLXPq3QKV84Q%3D&reserved=0.

bgavrilMS commented 3 years ago

In your KeyChain entries, do you have one named "Microsoft.Developer.IdentityService" already? Could you try to manually delete this entry first?

image

And also make sure your login KeyChain is not locked:

image

ghost commented 3 years ago

There were two. I tried the command again, same result. I noticed it recreated the two I deleted after I tried that.

PS /Users/prestonc> connect-azaccount

WARNING: INITIALIZATION: Token cache encryption is not supported in current environment and token cache will be fallen back as plain text.

WARNING: Unable to acquire token for tenant 'organizations'

WARNING: Please run 'Connect-AzAccount -DeviceCode' if browser is not supported in this session.

Connect-AzAccount: InteractiveBrowserCredential authentication failed: Persistence check failed. Inspect inner exception for details

PS /Users/prestonc>

Preston Cook | Cloud Engineer II | Global Technology Services Herbalife Nutrition | 14944 Pony Express Dr., Bluffdale, UT 84065webextlink://14944%20Pony%20Express%20Dr.,%20Bluffdale,%20UT%2084065 310 410 9600 x 74127013 | Direct 310 258 7013 | Cell 310 357 4826 @.**@.> Learn about the many ways we do it at IAmHerbalifeNutrition.com.

From: Bogdan Gavril @.> Date: Monday, March 22, 2021 at 11:12 To: Azure/azure-powershell @.> Cc: Preston Cook @.>, Mention @.> Subject: [External] Re: [Azure/azure-powershell] OSX Connect-AzAccount doesn't function (#14478) CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

In your KeyChain entries, do you have one named "Microsoft.Developer.IdentityService" already? Could you try to manually delete this entry first?

[image]https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F12273384%2F112029156-d7ca9100-8b30-11eb-836d-3dc71439031e.png&data=04%7C01%7Cprestonc%40herbalife.com%7C62b60a76a6664078d93408d8ed55bc59%7C101f87a76d6b4c6c9d9c223592a2ba50%7C0%7C0%7C637520299785653184%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=uSSdtN3WpBSBKDqskqRbiDtX%2BcYLLa1FhpaGQsSugoA%3D&reserved=0

And also make sure your login KeyChain is not locked:

[image]https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F12273384%2F112030053-c3d35f00-8b31-11eb-8669-e64c68c007ab.png&data=04%7C01%7Cprestonc%40herbalife.com%7C62b60a76a6664078d93408d8ed55bc59%7C101f87a76d6b4c6c9d9c223592a2ba50%7C0%7C0%7C637520299785663178%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=OxqRQyMMFQeNudikEHVTg%2FdR967w2rGXABJFN%2FoV6sc%3D&reserved=0

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2Fazure-powershell%2Fissues%2F14478%23issuecomment-804240702&data=04%7C01%7Cprestonc%40herbalife.com%7C62b60a76a6664078d93408d8ed55bc59%7C101f87a76d6b4c6c9d9c223592a2ba50%7C0%7C0%7C637520299785663178%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=sT%2FUDjV8z9YjZZH0cw8p3pWfBsvuiShA9aLXrx5lZrk%3D&reserved=0, or unsubscribehttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FATERNERUKWD25Q25IHY4NHTTE53BPANCNFSM4Y2DFSBQ&data=04%7C01%7Cprestonc%40herbalife.com%7C62b60a76a6664078d93408d8ed55bc59%7C101f87a76d6b4c6c9d9c223592a2ba50%7C0%7C0%7C637520299785673171%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=zFqs1xAjFO8sYgR7unC28xk2rBt6UM6v1PBbBqX0TAQ%3D&reserved=0.

bgavrilMS commented 3 years ago

Do you have Visual Studio for Mac installed and running or any other Microsoft dev app running?

Otherwise, I've created a small console app that writes to the KeyChain in a similar matter as PowerShell, I was hoping you could try it...

https://github.com/AzureAD/microsoft-authentication-extensions-for-dotnet/tree/master/tests/KeyChainTestApp

ghost commented 3 years ago

Sorry I have been slammed, do you still want me to run this tool? Do I need .NET or .NET core?

I’m just running visual studio code and Azure storage explorer, batch explorer, and whatever comes with office.

Preston Cook | Cloud Engineer II | Global Technology Services Herbalife Nutrition | 14944 Pony Express Dr., Bluffdale, UT 84065webextlink://14944%20Pony%20Express%20Dr.,%20Bluffdale,%20UT%2084065 310 410 9600 x 74127013 | Direct 310 258 7013 | Cell 310 357 4826 @.**@.> Learn about the many ways we do it at IAmHerbalifeNutrition.com.

From: Bogdan Gavril @.> Date: Monday, March 22, 2021 at 16:02 To: Azure/azure-powershell @.> Cc: Preston Cook @.>, Mention @.> Subject: [External] Re: [Azure/azure-powershell] OSX Connect-AzAccount doesn't function (#14478) CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Do you have Visual Studio for Mac installed and running or any other Microsoft dev app running?

Otherwise, I've created a small console app that writes to the KeyChain in a similar matter as PowerShell, I was hoping you could try it...

https://github.com/AzureAD/microsoft-authentication-extensions-for-dotnet/tree/master/tests/KeyChainTestApphttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzureAD%2Fmicrosoft-authentication-extensions-for-dotnet%2Ftree%2Fmaster%2Ftests%2FKeyChainTestApp&data=04%7C01%7Cprestonc%40herbalife.com%7C54f2c7c2ca9c409e446608d8ed7e2aff%7C101f87a76d6b4c6c9d9c223592a2ba50%7C0%7C0%7C637520473432910657%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=X8R%2FCInmeCDzGA07SND5qZhFPneYKts%2FWw5%2FdbstI7c%3D&reserved=0

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2Fazure-powershell%2Fissues%2F14478%23issuecomment-804424932&data=04%7C01%7Cprestonc%40herbalife.com%7C54f2c7c2ca9c409e446608d8ed7e2aff%7C101f87a76d6b4c6c9d9c223592a2ba50%7C0%7C0%7C637520473432910657%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=B9PngSpJ5cQ9B3Pp54TxUKjyuKrUxmF9%2B1Rof4kE6%2Fo%3D&reserved=0, or unsubscribehttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FATERNETVECQUMPHO6QQ2FSDTE6463ANCNFSM4Y2DFSBQ&data=04%7C01%7Cprestonc%40herbalife.com%7C54f2c7c2ca9c409e446608d8ed7e2aff%7C101f87a76d6b4c6c9d9c223592a2ba50%7C0%7C0%7C637520473432920648%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=KTgJ%2FOgo%2Bnj%2F%2BsykmS0LvGEvJ8OvZHpEiMf9WKvUvyo%3D&reserved=0.