Azure / Azure/azure-powershell

Connect-AzAccount

Open
#27,941 2 comments 0 reactions 0 assignees View on GitHub
bug customer-reported needs-team-attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
3d 14h
Merged PRs (30d)
54

Description

### Description

Connect-AzAccount : DeviceCodeCredential authentication failed: Retry failed after 4 tries. Retry settings can be
adjusted in ClientOptions.Retry or by configuring a custom retry policy in ClientOptions.RetryPolicy.
Could not find tenant id for provided tenant domain 'b8975b80-d2c5-4e2d-a2a3-7bcb41bf140d'. Please ensure that the
provided user is found in the provided tenant domain.
At line:1 char:1
+ Connect-AzAccount -SubscriptionId $Subscription -TenantId $Tenant -De ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Connect-AzAccount], ArgumentNullException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand

### Issue script & Debug output

```PowerShell
This out put I am getting after giving my Subcription id, tenent id and resource group.
Can anyone please check why this error is coming.
```

### Environment data

```PowerShell
PS C:\Users\Administrator> $PSVersionTable

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

### Module versions

```PowerShell
PS C:\Users\Administrator> Get-Module Az*

ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 4.0.2 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear...
```

### Error output

```PowerShell

```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing Connect-AzAccount with the reported subscription and tenant values in Windows PowerShell 5.1, using Az.Accounts 4.0.2. Read the authentication and tenant-resolution path implicated by the error, then verify whether the failure is reproducible and whether the reported inputs are accepted. Done means identifying a confirmed module defect or documenting that the tenant information or environment is invalid.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell
Domain
authentication, cli, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.