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

[SCSensitivityLabel] A parameter cannot be found that matches parameter name 'ApplicationId'. #3050

Closed
lpercetti opened this issue Mar 21, 2023 · 5 comments · Fixed by #3051, #3053 or #3061
Assignees
Labels

Comments

@lpercetti
Copy link

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

I am trying to deploy a SensitivityLabel using an Application Registration (SPN).
However, the DSC does not proceed and I receive the following error:
A parameter cannot be found that matches parameter name 'ApplicationId'.

The documentation is showing this parameter as implemented.
https://microsoft365dsc.com/resources/security-compliance/SCSensitivityLabel/

Verbose logs showing the problem

VERBOSE: [MS365DSC]: [[SCSensitivityLabel]LABEL-INTERNAL] Creating Label {internal}
A parameter cannot be found that matches parameter name 'ApplicationId'.
+ CategoryInfo : InvalidArgument: (:) [], CimException
+ FullyQualifiedErrorId : NamedParameterNotFound,New-Label
+ PSComputerName : localhost

Suggested solution to the issue

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

SCSensitivityLabel 'LABEL-INTERNAL'
        {
			TenantId								= $TenantId;
			ApplicationId							= $ApplicationId;
			CertificateThumbprint					= $CertificateThumbprint;

			Ensure									= "Present";
			Name									= "internal";

			Comment									= "";
			Disabled								= $False;
			DisplayName								= "Internal";
			Priority								= 3;
			Tooltip									= "This label will encrypt the document, set access privilege to Co-Owner level (Full Control), and restrict access to those with a valid internal email address.";
			AdvancedSettings     = @(
				MSFT_SCLabelSetting
				{
					Key   = 'contenttype'
					Value = 'File  Email'
				}
				MSFT_SCLabelSetting
				{
					Key   = 'tooltip'
					Value = 'This label will encrypt the document set access privilege to Co-Owner level (Full Control) and restrict access to those with a valid internal email address.'
				}
				MSFT_SCLabelSetting
				{
					Key   = 'isparent'
					Value = 'False'
				}
			);
        }

The operating system the target node is running

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

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

ModuleType Version Name ExportedCommands


Manifest 1.23.315.1 Microsoft365DSC {Add-M365DSCEvent, Add-M365DSCTelemetryEvent, Assert-M365D...

Installing DSCParser version {1.3.0.6}
Installing ExchangeOnlineManagement version {3.1.0}
Installing Microsoft.Graph.Applications version {1.23.0}
Installing Microsoft.Graph.Authentication version {1.23.0}
Installing Microsoft.Graph.DeviceManagement version {1.23.0}
Installing Microsoft.Graph.DeviceManagement.Administration version {1.23.0}
Installing Microsoft.Graph.DeviceManagement.Enrolment version {1.23.0}
Installing Microsoft.Graph.Devices.CorporateManagement version {1.23.0}
Installing Microsoft.Graph.Groups version {1.23.0}
Installing Microsoft.Graph.Identity.DirectoryManagement version {1.23.0}
Installing Microsoft.Graph.Identity.Governance version {1.23.0}
Installing Microsoft.Graph.Identity.SignIns version {1.23.0}
Installing Microsoft.Graph.Planner version {1.23.0}
Installing Microsoft.Graph.Teams version {1.23.0}
Installing Microsoft.Graph.Users version {1.23.0}
Installing Microsoft.Graph.Users.Actions version {1.23.0}
Installing Microsoft.PowerApps.Administration.PowerShell version {2.0.156}
Installing MicrosoftTeams version {5.0.0}
Installing MSCloudLoginAssistant version {1.0.105}
Installing PnP.PowerShell version {1.12.0}
Installing ReverseDSC version {2.0.0.14}

@andikrueger
Copy link
Collaborator

Thank you for reporting this issue. This issue is caused here:

https://github.com/microsoft/Microsoft365DSC/blob/Dev/Modules/Microsoft365DSC/DSCResources/MSFT_SCSensitivityLabel/MSFT_SCSensitivityLabel.psm1#L840-L843

Not all authentication parameters are properly removed from the creation params of the cmdLet. This needs to be fixed.

@andikrueger andikrueger self-assigned this Mar 21, 2023
@ykuijs
Copy link
Member

ykuijs commented Mar 21, 2023

Don't forget to update these lines as well:

$SetParams.Remove('Credential') | Out-Null
$SetParams.Remove('Ensure') | Out-Null
$SetParams.Remove('Name') | Out-Null
$SetParams.Remove('Disabled') | Out-Null
😉

@lpercetti
Copy link
Author

Near lines 1172-1176 too?

@andikrueger
Copy link
Collaborator

andikrueger commented Mar 21, 2023

Hope I did so...Yes, I did.

@andikrueger
Copy link
Collaborator

Missed the Test-Method. Will create a new PR for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants