You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update-MgApplication : Request contains a property with duplicate values.
At C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.621.1\modules\M365DSCPermissions.psm1:1485 char:9+Update-MgApplication-ApplicationId ($azureADApp.Id) `+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ ApplicationId...phApplication }:<>f__AnonymousType0`2) [Update-MgApplication_UpdateExpanded1], RestException`1+ FullyQualifiedErrorId : DuplicateValue,Microsoft.Graph.PowerShell.Cmdlets.UpdateMgApplication_UpdateExpanded1
From what I can see the Update-M365DSCAzureAdApplication cmdlet is creating multiple entries against the same API, causing the Update-MgApplication to fail.
if ($null-ne$currentAPIAccess-and$allRequiredAccess-notcontains$currentAPIAccess)
This checks if the $allRequiredAccess variable exists; if so, it checks against the hash table entry being processed to see if the App ID already exists and appends permissions against it if so, or creates a new $currentAPIAccess if it doesn't. The line change to 1474 ensures a duplicate isn't added to $allRequiredAccess.
The text was updated successfully, but these errors were encountered:
Details of the scenario you tried and the problem that is occurring
I've attempted to update an App Registration using the Update-M365DSCAzureAdApplication cmdlet as follows:
We kept receiving the following error:
From what I can see the Update-M365DSCAzureAdApplication cmdlet is creating multiple entries against the same API, causing the Update-MgApplication to fail.
Suggested solution to the issue
At Line 1448 of M365DSCPermissions.psm1, replace:
with
and change Line 1474:
to
This checks if the
$allRequiredAccess
variable exists; if so, it checks against the hash table entry being processed to see if the App ID already exists and appends permissions against it if so, or creates a new $currentAPIAccess if it doesn't. The line change to 1474 ensures a duplicate isn't added to$allRequiredAccess
.The text was updated successfully, but these errors were encountered: