Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AADServicePrincipal: AppRoleAssignedTo parameter referencing issue #5717

Closed
abhisri13 opened this issue Feb 3, 2025 · 0 comments · Fixed by #5724 or #5732
Closed

AADServicePrincipal: AppRoleAssignedTo parameter referencing issue #5717

abhisri13 opened this issue Feb 3, 2025 · 0 comments · Fixed by #5724 or #5732

Comments

@abhisri13
Copy link

Description of the issue

DSC running into errors when referencing AppRoleAssignedTo parameter for AADServicePrincipal.

We are getting the below error:

##[error]Cannot bind argument to parameter 'ReferenceObject' because it is null.
    + CategoryInfo          : InvalidData: (:) [], CimException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.CompareObje 
   ctCommand
    + PSComputerName        : localhost

Upon further investigation it looks like the module has a bug at this location in the module.

Microsoft 365 DSC Version

V1.25.122.2

Which workloads are affected

other

The DSC configuration

AADServicePrincipal 'AADServicePrincipal-SERVICEPRINCIPALNAME' {
    DependsOn                   = @(
                '[AADApplication]AADApplication-Microsoft365DSC'
    )
    AppId                       = 'SERVICE-PRINCIPAL-ID'
    AppRoleAssignmentRequired   = $False;
    DisplayName                 = 'SERVICEPRINCIPALNAME'
    Ensure                      = 'Present'
    ServicePrincipalType        = 'Application'
    AppRoleAssignedTo           = @(
        MSFT_AADServicePrincipalRoleAssignment {
            PrincipalType = 'User'
            Identity      = 'tenantUser'
        }
        MSFT_AADServicePrincipalRoleAssignment {
            PrincipalType = 'Group'
            Identity      = 'tenantGroup'
        }
    );
    AccountEnabled              = $True;
    ApplicationId               = $ApplicationId
    TenantId                    = $TenantId
    CertificateThumbprint       = $Thumbprint
}

Verbose logs showing the problem

VERBOSE: [[AADServicePrincipal]AADServicePrincipal-SERVICEPRINCIPAL::[AzureAD]AzureAD_Configuration] Performing the operation "Update-MgServicePrincipal_UpdateExpanded" on target
 "Call remote 'PATCH /servicePrincipals/{servicePrincipal-id}' operation".
##[error]Cannot bind argument to parameter 'ReferenceObject' because it is null.
    + CategoryInfo          : InvalidData: (:) [], CimException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.CompareObje 
   ctCommand
    + PSComputerName        : localhost

Environment Information + PowerShell Version

OsName               : Microsoft Windows Server 2022 Datacenter
OsOperatingSystemSKU : DatacenterServerEdition
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 20348.1.amd64fre.fe_release.210507-1500
OsLanguage           : en-US
OsMuiLanguages       : {en-US}




Name                           Value
----                           -----
PSVersion                      5.1.20348.2849
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.20348.2849
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant