Forum Discussion
How to get rid of warning 'Unable to acquire token for tenant 76a47f06...' with Connect-AzAccount?
Hi, Robert.
All I can offer is some guesswork here since I can't reproduce this issue.
With respect to the Clear-AzContext commandlet, make sure you set -Scope to CurrentUser. For example:
Clear-AzContext -Scope CurrentUser -Force;
Disconnect-AzAccount;
Be sure to close the PowerShell session and open a new one after doing this. The following are also useful commandlets for checking current settings:
- Get-AzContext -ListAvailable
- Get-AzContextAutosaveSetting -Scope CurrentUser
Also ensure you're on the latest version. You can read more about some of the version-specific issues below (somewhat dated now but possibly still relevant) - this warning being one of them - that manifested when Microsoft cut over from using the ADAL endpoint to the newer MSAL endpoint.
Cheers,
Lain
- Robert KJul 06, 2022Brass Contributor
LainRobertson Thanks for the tips. Unfortunately, they did not help. The problem still exists. I think I am also up to date with the AZ.* cmdlets.
Get-Module -ListAvailable AZ.* Verzeichnis: C:\Program Files\WindowsPowerShell\Modules ModuleType Version Name ExportedCommands ---------- ------- ---- ---------------- Script 2.8.0 Az.Accounts {Disable-AzDataCollection, Disable-AzContextAutosave, Enab... Script 1.1.2 Az.Advisor {Get-AzAdvisorRecommendation, Enable-AzAdvisorRecommendati... Script 4.1.0 Az.Aks {Get-AzAksCluster, New-AzAksCluster, Remove-AzAksCluster, ... Script 1.1.4 Az.AnalysisServices {Resume-AzAnalysisServicesServer, Suspend-AzAnalysisServic... Script 3.0.0 Az.ApiManagement {Add-AzApiManagementApiToGateway, Add-AzApiManagementApiTo... Script 1.1.0 Az.AppConfiguration {Get-AzAppConfigurationStore, Get-AzAppConfigurationStoreK... Script 2.0.0 Az.ApplicationInsights {Get-AzApplicationInsights, Get-AzApplicationInsightsApiKe... Script 1.0.0 Az.Attestation {New-AzAttestation, Get-AzAttestation, Remove-AzAttestatio... Script 1.7.3 Az.Automation {Get-AzAutomationHybridWorkerGroup, Remove-AzAutomationHyb... Script 3.2.0 Az.Batch {Remove-AzBatchAccount, Get-AzBatchAccount, Get-AzBatchAcc... Script 2.0.0 Az.Billing {Get-AzBillingInvoice, Get-AzBillingPeriod, Get-AzEnrollme... Script 2.1.0 Az.Cdn {Clear-AzCdnEndpointContent, Clear-AzFrontDoorCdnEndpointC... Script 1.1.0 Az.CloudService {Get-AzCloudService, Get-AzCloudServiceInstanceView, Get-A... Script 1.11.0 Az.CognitiveServices {Get-AzCognitiveServicesAccount, Get-AzCognitiveServicesAc... Script 4.27.0 Az.Compute {Remove-AzAvailabilitySet, Get-AzAvailabilitySet, New-AzAv... Script 3.1.0 Az.ContainerInstance {Add-AzContainerInstanceOutput, Get-AzContainerGroup, Get-... Script 3.0.0 Az.ContainerRegistry {New-AzContainerRegistry, Get-AzContainerRegistry, Update-... Script 1.8.0 Az.CosmosDB {Get-AzCosmosDBSqlContainer, Get-AzCosmosDBSqlContainerThr... Script 1.1.0 Az.DataBoxEdge {Get-AzDataBoxEdgeJob, Get-AzDataBoxEdgeDevice, Invoke-AzD... Script 1.2.0 Az.Databricks {Get-AzDatabricksOutboundNetworkDependenciesEndpoint, Get-... Script 1.16.7 Az.DataFactory {Set-AzDataFactoryV2, Update-AzDataFactoryV2, Get-AzDataFa... Script 1.0.2 Az.DataLakeAnalytics {Get-AzDataLakeAnalyticsDataSource, New-AzDataLakeAnalytic... Script 1.3.0 Az.DataLakeStore {Get-AzDataLakeStoreTrustedIdProvider, Remove-AzDataLakeSt... Script 1.0.1 Az.DataShare {New-AzDataShareAccount, Get-AzDataShareAccount, Remove-Az... Script 1.1.0 Az.DeploymentManager {Get-AzDeploymentManagerArtifactSource, New-AzDeploymentMa... Script 3.1.0 Az.DesktopVirtualization {Disconnect-AzWvdUserSession, Expand-AzWvdMsixImage, Get-A... Script 1.0.2 Az.DevTestLabs {Get-AzDtlAllowedVMSizesPolicy, Get-AzDtlAutoShutdownPolic... Script 1.1.2 Az.Dns {Get-AzDnsRecordSet, New-AzDnsRecordConfig, Remove-AzDnsRe... Script 1.3.0 Az.EventGrid {New-AzEventGridTopic, Get-AzEventGridTopic, Set-AzEventGr... Script 2.0.0 Az.EventHub {New-AzEventHubNamespace, Get-AzEventHubNamespace, Set-AzE... Script 1.9.0 Az.FrontDoor {New-AzFrontDoor, Get-AzFrontDoor, Set-AzFrontDoor, Remove... Script 4.0.3 Az.Functions {Get-AzFunctionApp, Get-AzFunctionAppAvailableLocation, Ge... Script 5.0.1 Az.HDInsight {Get-AzHDInsightJob, New-AzHDInsightSqoopJobDefinition, Wa... Script 2.0.0 Az.HealthcareApis {Get-AzHealthcareApisService, Get-AzHealthcareApisWorkspac... Script 2.7.4 Az.IotHub {Add-AzIotHubKey, Get-AzIotHubEventHubConsumerGroup, Get-A... Script 4.5.0 Az.KeyVault {Add-AzKeyVaultCertificate, Update-AzKeyVaultCertificate, ... Script 2.1.0 Az.Kusto {Add-AzKustoClusterLanguageExtension, Add-AzKustoDatabaseP... Script 1.5.0 Az.LogicApp {Get-AzIntegrationAccountAgreement, Get-AzIntegrationAccou... Script 1.1.3 Az.MachineLearning {Move-AzMlCommitmentAssociation, Get-AzMlCommitmentAssocia... Script 1.2.0 Az.Maintenance {Get-AzApplyUpdate, Get-AzConfigurationAssignment, Get-AzM... Script 1.0.0 Az.ManagedServiceIdentity {Get-AzSystemAssignedIdentity, Get-AzUserAssignedIdentity,... Script 3.0.0 Az.ManagedServices {Get-AzManagedServicesAssignment, Get-AzManagedServicesDef... Script 1.0.2 Az.MarketplaceOrdering {Get-AzMarketplaceTerms, Set-AzMarketplaceTerms} Script 1.1.1 Az.Media {Sync-AzMediaServiceStorageKey, Set-AzMediaServiceKey, Get... Script 1.1.2 Az.Migrate {Get-AzMigrateDiscoveredServer, Get-AzMigrateJob, Get-AzMi... Script 3.0.1 Az.Monitor {Get-AzMetricDefinition, Get-AzMetric, Remove-AzLogProfile... Script 1.0.0 Az.MySql {Get-AzMySqlConfiguration, Get-AzMySqlConnectionString, Ge... Script 4.17.0 Az.Network {Add-AzApplicationGatewayAuthenticationCertificate, Get-Az... Script 1.1.1 Az.NotificationHubs {Get-AzNotificationHub, Get-AzNotificationHubAuthorization... Script 3.1.0 Az.OperationalInsights {New-AzOperationalInsightsAzureActivityLogDataSource, New-... Script 1.5.0 Az.PolicyInsights {Get-AzPolicyEvent, Get-AzPolicyState, Get-AzPolicyStateSu... Script 1.1.0 Az.PostgreSql {Get-AzPostgreSqlConfiguration, Get-AzPostgreSqlConnection... Script 1.1.2 Az.PowerBIEmbedded {Remove-AzPowerBIWorkspaceCollection, Get-AzPowerBIWorkspa... Script 1.0.3 Az.PrivateDns {Get-AzPrivateDnsZone, Remove-AzPrivateDnsZone, Set-AzPriv... Script 5.4.0 Az.RecoveryServices {Get-AzRecoveryServicesBackupProperty, Get-AzRecoveryServi... Script 1.6.0 Az.RedisCache {Remove-AzRedisCachePatchSchedule, New-AzRedisCacheSchedul... Script 1.0.0 Az.RedisEnterpriseCache {Export-AzRedisEnterpriseCache, Get-AzRedisEnterpriseCache... Script 1.0.3 Az.Relay {New-AzRelayNamespace, Get-AzRelayNamespace, Set-AzRelayNa... Script 1.1.0 Az.ResourceMover {Add-AzResourceMoverMoveResource, Get-AzResourceMoverMoveC... Script 6.0.0 Az.Resources {Get-AzProviderOperation, Remove-AzRoleAssignment, Get-AzR... Script 1.3.0 Az.Security {Get-AzSecuritySolution, Get-AzSecuritySolutionsReferenceD... Script 1.1.0 Az.SecurityInsights {Get-AzSentinelAlertRuleAction, New-AzSentinelAlertRuleAct... Script 1.9.0 Az.ServiceBus {New-AzServiceBusNamespace, Get-AzServiceBusNamespace, Set... Script 3.0.2 Az.ServiceFabric {Add-AzServiceFabricClientCertificate, Add-AzServiceFabric... Script 1.4.1 Az.SignalR {New-AzSignalR, Get-AzSignalR, Get-AzSignalRKey, New-AzSig... Script 3.9.0 Az.Sql {Get-AzSqlDatabaseTransparentDataEncryption, Get-AzSqlData... Script 1.1.0 Az.SqlVirtualMachine {New-AzSqlVM, Get-AzSqlVM, Update-AzSqlVM, Remove-AzSqlVM...} Script 1.1.1 Az.StackHCI {Register-AzStackHCI, Unregister-AzStackHCI, Test-AzStackH... Script 4.6.0 Az.Storage {Get-AzStorageAccount, Get-AzStorageAccountKey, New-AzStor... Script 1.7.0 Az.StorageSync {Invoke-AzStorageSyncCompatibilityCheck, New-AzStorageSync... Script 2.0.0 Az.StreamAnalytics {Get-AzStreamAnalyticsCluster, Get-AzStreamAnalyticsCluste... Script 1.0.0 Az.Support {Get-AzSupportService, Get-AzSupportProblemClassification,... Script 1.4.0 Az.Synapse {Get-AzSynapseSparkJob, Stop-AzSynapseSparkJob, Submit-AzS... Script 1.1.0 Az.TrafficManager {Add-AzTrafficManagerCustomHeaderToEndpoint, Remove-AzTraf... Script 2.11.2 Az.Websites {Get-AzAppServicePlan, Set-AzAppServicePlan, New-AzAppServ...
- LainRobertsonJul 06, 2022Silver Contributor
While I don't have any further guesses for resolving the root cause of the issue, does the following version of Connect-AzAccount avoid the symptoms? (i.e. all those warnings)
Connect-AzAccount -SkipContextPopulation
Cheers,
Lain
- Robert KJul 07, 2022Brass ContributorThank you. I have tried it out. Unfortunately, does not work either. The warnings remain.