AsBuiltReport / AsBuiltReport.Microsoft.Azure

Repository for AsBuiltReport Microsoft Azure module
MIT License
11 stars 11 forks source link

UsernamePasswordCredential authentication failed: ROPC does not support MSA accounts #5

Closed rebelinux closed 1 year ago

rebelinux commented 1 year ago

Bug description

The report does not work if run with a personal login account only Azure AD account works.

https://themicrosoftcloudblog.com/2021/08/03/error-connecting-to-azure-via-powershell-azure-cli-using-a-personal-account/

Invoke-AsBuiltReport.Microsoft.Azure : UsernamePasswordCredential authentication failed: ROPC does not support MSA accounts. See https://aka.ms/msal-net-ropc for details. 
See the troubleshooting guide for more information. https://aka.ms/azsdk/net/identity/usernamepasswordcredential/troubleshoot
At C:\Program Files\WindowsPowerShell\Modules\AsBuiltReport.Core\1.3.0\Src\Public\New-AsBuiltReport.ps1:390 char:21
+ ...             & "Invoke-$($ReportModuleName)" -Target $Target -Credenti ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-AsBuiltReport.Microsoft.Azure

Command-line input

New-AsBuiltReport -Report Microsoft.Azure -OutputFolderPath C:\Users\jocolon\AsBuiltReport\ -AsBuiltConfigFilePath C:\Users\jocolon\AsBuiltReport\AsBuiltReport.json -EnableHealthCheck -Target xxxxx -Username xxxxx@gmail.com -Password xxxxx -Format HTML -ReportConfigFilePath C:\Users\jocolon\AsBuiltReport\AsBuiltReport.Microsoft.Azure.json

Steps to reproduce

  1. Run the report with an personal account type
  2. Apocalipsis

Expected behaviour

Report the limitation under known issues

Screenshots

No response

Operating System

Windows 10 x64

PowerShell Version

PS C:\Users\jocolon> $PSVersionTable

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

PS C:\Users\jocolon>

PowerShell Modules

PS C:\Users\jocolon> Get-Module -ListAvailable @("AsBuiltReport.Core";"AsBuiltReport.Microsoft.Azure";"Az";"PScribo") | Select Name, Version

Name                          Version
----                          -------
AsBuiltReport.Core            1.3.0
AsBuiltReport.Microsoft.Azure 0.1.2
PScribo                       0.10.0

PS C:\Users\jocolon>

Additional Context

No response

Before submitting