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

MSFT_AADServicePrincipal: Sends "ApplicationSecret" parameter #2615

Closed
jamacneil opened this issue Dec 1, 2022 · 0 comments · Fixed by #2636 or #2667
Closed

MSFT_AADServicePrincipal: Sends "ApplicationSecret" parameter #2615

jamacneil opened this issue Dec 1, 2022 · 0 comments · Fixed by #2636 or #2667
Labels
Bug Something isn't working Entra ID V1.22.1130.1 Version 1.22.1130.1

Comments

@jamacneil
Copy link

jamacneil commented Dec 1, 2022

Details of the scenario you tried and the problem that is occurring

When using AADServicePrincipal resource to create/update service principal the "ApplicationSecret" parameter is not removed from $CurrentParameters.

Verbose logs showing the problem

2022-12-01 15_05_25-Server1 on KEPPLER - Virtual Machine Connection

A parameter cannot be found that matches parameter name 'ApplicationSecret'.                                                
+ CategoryInfo             : InvalidArgument: (:) [], CimException                                                         
+ FullyQualifiedErrorId : NamedParameterNotFound,Update-MgServicePrincipal                                              
 PSComputerName       : localhost  

Suggested solution to the issue

In my testing removing 'ApplicationSecret' from $CurrentParameters has resolved this issue.

$currentAADServicePrincipal = Get-TargetResource @PSBoundParameters
$currentParameters = $PSBoundParameters
$currentParameters.Remove('ApplicationId') | Out-Null
$currentParameters.Remove('ApplicationSecret') | Out-Null
$currentParameters.Remove('TenantId') | Out-Null

2022-12-01 15_20_57-Clipboard

The DSC configuration that is used to reproduce the issue (as detailed as possible)

AADServicePrincipal "ServicePrincipalName" {
                AppId             = $Application.AppId
                AccountEnabled    = $false
                Ensure            = "Present"
                TenantId          = $TenantId
                ApplicationId     = $ApplicationId
                ApplicationSecret = $ApplicationSecret
            }

The operating system the target node is running

OsName               : Microsoft Windows 11 Enterprise
OsOperatingSystemSKU : EnterpriseEdition
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 22000.1.amd64fre.co_release.210604-1628
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

Version of the DSC module that was used ('dev' if using current dev branch)

Version: 1.22.1130.1

@andikrueger andikrueger added Bug Something isn't working Entra ID V1.22.1130.1 Version 1.22.1130.1 labels Dec 2, 2022
NikCharlebois added a commit to NikCharlebois/Microsoft365DSC that referenced this issue Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Entra ID V1.22.1130.1 Version 1.22.1130.1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants