azsk/ADOScanner

Cannot add a member with the name "subjectDescriptor" because a member with that name already exists

Closed this issue · 4 comments

$member | Add-Member -NotePropertyName subjectDescriptor -NotePropertyValue $currentGroup.descriptor

Hello Team, I found this error when I followed the ADOScanner blog and ran the tool in Azure Function.
The error message is the below. Are you able to have a look? Thanks.

Result: ERROR: Add-Member : Cannot add a member with the name "subjectDescriptor" because a member with that name already exists. To overwrite the member anyway, add the Force parameter to your command.
At /home/.local/share/powershell/Modules/AzSK.ADO/1.13.0/Framework/Core/SVT/ADO/ADO.Project.ps1:2301 char:39
+ ...   $member | Add-Member -NotePropertyName subjectDescriptor -NotePrope ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (@{identityId=4b21ef\u2026MDcyLTAtMC0wLTgtOA}:PSObject) [Add-Member], InvalidOperationException
+ FullyQualifiedErrorId : MemberAlreadyExists,Microsoft.PowerShell.Commands.AddMemberCommand
 
Script stack trace:
   at <ScriptBlock>, /home/.local/share/powershell/Modules/AzSK.ADO/1.13.0/Framework/Core/SVT/ADO/ADO.Project.ps1: line 2301
   at CheckInactiveUsersInAdminRoles, /home/.local/share/powershell/Modules/AzSK.ADO/1.13.0/Framework/Core/SVT/ADO/ADO.Project.ps1: line 2294
   at RunControl, /home/.local/share/powershell/Modules/AzSK.ADO/1.13.0/Framework/Abstracts/SVTBase.ps1: line 701
   at <ScriptBlock>, /home/.local/share/powershell/Modules/AzSK.ADO/1.13.0/Framework/Abstracts/SVTBase.ps1: line 611
   at GetAutomatedSecurityStatus, /home/.local/share/powershell/Modules/AzSK.ADO/1.13.0/Framework/Abstracts/SVTBase.ps1: line 602
   at EvaluateAllControls, /home/.local/share/powershell/Modules/AzSK.ADO/1.13.0/Framework/Abstracts/SVTBase.ps1: line 323
   at <ScriptBlock>, /home/.local/share/powershell/Modules/AzSK.ADO/1.13.0/Framework/Abstracts/ServicesSecurityStatus.ps1: line 331
   at RunForAllResources, /home/.local/share/powershell/Modules/AzSK.ADO/1.13.0/Framework/Abstracts/ServicesSecurityStatus.ps1: line 236
   at RunAllControls, /home/.local/share/powershell/Modules/AzSK.ADO/1.13.0/Framework/Abstracts/ServicesSecurityStatus.ps1: line 463
   at InvokeFunction, /home/.local/share/powershell/Modules/AzSK.ADO/1.13.0/Framework/Abstracts/CommandBase.ps1: line 142
   at InvokeFunction, /home/.local/share/powershell/Modules/AzSK.ADO/1.13.0/Framework/Abstracts/CommandBase.ps1: line 102
   at EvaluateControlStatus, /home/.local/share/powershell/Modules/AzSK.ADO/1.13.0/Framework/Abstracts/SVTCommandBase.ps1: line 102
   at Get-AzSKADOSecurityStatus<Process>, /home/.local/share/powershell/Modules/AzSK.ADO/1.13.0/SVT/SVT.ps1: line 535
   at <ScriptBlock>, <No file>: line 1
   at <ScriptBlock>, /home/site/wwwroot/RunADOSecurityScan/run.ps1: line 399

System.InvalidOperationException: Cannot add a member with the name "subjectDescriptor" because a member with that name already exists. To overwrite the member anyway, add the Force parameter to your command.


Exception: Cannot add a member with the name "subjectDescriptor" because a member with that name already exists. To overwrite the member anyway, add the Force parameter to your command.
Stack:  

@DanielHRio Thanks for reaching out. Can you please share the scan logs at azskadosup@microsoft.com? You can find the logs in your storage account created during CA setup -> containers -> ado-scan-logs. We will take a look into this and inform you with further updates.

@DanielHRio Thanks for reaching out. Can you please share the scan logs at azskadosup@microsoft.com? You can find the logs in your storage account created during CA setup -> containers -> ado-scan-logs. We will take a look into this and inform you with further updates.

Thank you @juhi037. I have sent the log to the email.

@DanielHRio can you please check if you are getting this error via local scan from your machine as well?
From a PS console on your machine please run the following commands:
IPMO AzSK.ADO
GADS -oz org_name -pn proj_name -sar

@DanielHRio we have fixed this issue in the newest version AzSK.ADO 1.14.0. The exceptions should not occur now, hence closing this issue. Please feel free to open another issue in case you face any problems.