Connect-AzAccount AccountId parameter change?

Harfst, David 21 Reputation points
2023-06-30T17:03:05.5366667+00:00

I have a script that I've used before that used to work. Now I'm getting an error on Connect-AzAccount.

(AccountID parameter redacted)

Without the AccountID parameter, triggers the GUI prompt and works from there, but I want to skip that. Has something changed recently?

 PS C:\> Connect-AzAccount -Tenant $t1.Tenant -Subscription $t1.Subscription -AccountId "xxxxxx@xxxxx"
Connect-AzAccount : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Connect-AzAccount -Tenant $t1.Tenant -Subscription $t1.Subscription - ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Connect-AzAccount], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand
 
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,745 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,900 questions
{count} votes

Accepted answer
  1. Andreas Baumgarten 116.2K Reputation points MVP
    2023-06-30T20:22:36.6633333+00:00

    Hi @Harfst, David ,

    which version of the Az module are you using?

    I tested on PowerShell 5.1.22621.1778 with the latest Az module version, which is 10.0.0 and it works without any issue.

    Connect-AzAccount -Tenant $tId -Subscription $sID -AccountId "xxxxxxxxx@yyyyyyyyyy"
    

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards

    Andreas Baumgarten

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.