Microsoft365DSC
Microsoft365DSC copied to clipboard
TeamsOnlineVoicemailPolicy: MaximumRecordingLength type not correct in module
Description of the issue
@FabienTschanz Seems that you've changed the type of property MaximumRecordingLength from String to SInt32 in the schema file but missed changing it in the module so now I have a config with an integer but it fails when trying to deploy it, this resource was working before the breaking change.
Microsoft 365 DSC Version
1.26.408.1
Which workloads are affected
Teams
The DSC configuration
TeamsOnlineVoicemailPolicy "TeamsOnlineVoicemailPolicy-TeamsOnlineVoicemailPolicy_1"
{
ApplicationId = $TeamsApplicationId;
CertificateThumbprint = $TeamsCertThumbprint;
EnableEditingCallAnswerRulesSetting = $True;
EnableTranscription = $False;
EnableTranscriptionProfanityMasking = $False;
EnableTranscriptionTranslation = $True;
Ensure = "Present";
Identity = "TeamsOnlineVoicemailPolicy_1";
MaximumRecordingLength = 300;
ShareData = "Defer";
TenantId = $OrganizationName;
}
Verbose logs showing the problem
{"code":"ClientError","message":" Maximum recording length must be between \"30\" - \"600\" seconds.","action":"Please refer to documentation. CorrelationId: REDACTED","errorCode":40013,"innerError":{"ErrorCode":"OnlineVoicemailMaximumRecordingLengthOutOfRange","ErrorCodeMetadata":{"ParameterList":["30","600"]}}}
Environment Information + PowerShell Version
Win11/PS5.1
Proposed fix is now available in PR #7058: https://github.com/Microsoft365DSC/Microsoft365DSC/pull/7058
What was fixed
- Aligned
MaximumRecordingLengthtype inMSFT_TeamsOnlineVoicemailPolicy.psm1fromStringtoInt32(Get/Set/Test parameters). - Fixed conversion logic to interpret the integer value as seconds via
New-TimeSpan -Seconds ...before calling Teams cmdlets. - Added targeted unit-test assertions to verify the cmdlets receive the expected
TimeSpanvalue.
This addresses the schema/module mismatch and the invalid conversion behavior causing deployment failures for values like 300.