Skip to content

Commit

Permalink
TeamsGroupPolicyAssignment Exported configuration cannot be used beca…
Browse files Browse the repository at this point in the history
…use of duplicated key value

Fixes microsoft#3054
  • Loading branch information
andikrueger committed Mar 22, 2023
1 parent 0f22b64 commit dc72827
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change log for Microsoft365DSC

# Breaking Changes (APRIL 5TH RELEASE)

* TeamsGroupPolicyAssignment change of key and required parameters
* [BREAKING CHANGE] Setting GroupId and PolicyType as Key parameters
FIXES [#3054](https://github.com/microsoft/Microsoft365DSC/issues/3054)

# UNRELEASED

* AADRoleSetting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ function Get-TargetResource
[System.String]
$GroupDisplayName,

[Parameter()]
[Parameter(Mandatory = $true)]
[System.String]
$GroupId,

[Parameter()]
[Parameter(Mandatory = $true)]
[ValidateSet('CallingLineIdentity', 'TeamsAppSetupPolicy', 'TeamsAudioConferencingPolicy', 'TeamsCallingPolicy', 'TeamsCallParkPolicy', 'TeamsChannelsPolicy', 'TeamsComplianceRecordingPolicy', 'TenantDialPlan', 'TeamsMeetingBroadcastPolicy', 'TeamsMeetingPolicy', 'TeamsMessagingPolicy', 'TeamsShiftsPolicy', 'TeamsUpdateManagementPolicy', 'TeamsVerticalPackagePolicy')]
[System.String]
$PolicyType,
Expand All @@ -21,7 +21,7 @@ function Get-TargetResource
[System.String]
$PolicyName,

[Parameter(Mandatory = $true)]
[Parameter()]
[System.String]
$Priority,

Expand Down Expand Up @@ -128,11 +128,11 @@ function Set-TargetResource
[System.String]
$GroupDisplayName,

[Parameter()]
[Parameter(Mandatory = $true)]
[System.String]
$GroupId,

[Parameter()]
[Parameter(Mandatory = $true)]
[ValidateSet('CallingLineIdentity', 'TeamsAppSetupPolicy', 'TeamsAudioConferencingPolicy', 'TeamsCallingPolicy', 'TeamsCallParkPolicy', 'TeamsChannelsPolicy', 'TeamsComplianceRecordingPolicy', 'TenantDialPlan', 'TeamsMeetingBroadcastPolicy', 'TeamsMeetingPolicy', 'TeamsMessagingPolicy', 'TeamsShiftsPolicy', 'TeamsUpdateManagementPolicy', 'TeamsVerticalPackagePolicy')]
[System.String]
$PolicyType,
Expand All @@ -141,7 +141,7 @@ function Set-TargetResource
[System.String]
$PolicyName,

[Parameter(Mandatory = $true)]
[Parameter()]
[System.String]
$Priority,

Expand Down Expand Up @@ -271,11 +271,11 @@ function Test-TargetResource
[System.String]
$GroupDisplayName,

[Parameter()]
[Parameter(Mandatory = $true)]
[System.String]
$GroupId,

[Parameter()]
[Parameter(Mandatory = $true)]
[ValidateSet('CallingLineIdentity', 'TeamsAppSetupPolicy', 'TeamsAudioConferencingPolicy', 'TeamsCallingPolicy', 'TeamsCallParkPolicy', 'TeamsChannelsPolicy', 'TeamsComplianceRecordingPolicy', 'TenantDialPlan', 'TeamsMeetingBroadcastPolicy', 'TeamsMeetingPolicy', 'TeamsMessagingPolicy', 'TeamsShiftsPolicy', 'TeamsUpdateManagementPolicy', 'TeamsVerticalPackagePolicy')]
[System.String]
$PolicyType,
Expand All @@ -284,7 +284,7 @@ function Test-TargetResource
[System.String]
$PolicyName,

[Parameter(Mandatory = $true)]
[Parameter()]
[System.String]
$Priority,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
class MSFT_TeamsGroupPolicyAssignment : OMI_BaseResource
{
[Write, Description("Group Displayname of the group the policys are assigned to")] string GroupDisplayName;
[Write, Description("GroupId, alternatively to Group Displayname")] String GroupId;
[Write, Description("Teams PolicyType. The type of the policy to be assigned. Possible values:"), ValueMap{"CallingLineIdentity","TeamsAppSetupPolicy","TeamsAudioConferencingPolicy","TeamsCallingPolicy","TeamsCallParkPolicy","TeamsChannelsPolicy","TeamsComplianceRecordingPolicy","TenantDialPlan","TeamsMeetingBroadcastPolicy","TeamsMeetingPolicy","TeamsMessagingPolicy","TeamsShiftsPolicy","TeamsUpdateManagementPolicy","TeamsVerticalPackagePolicy"}, Values{"CallingLineIdentity","TeamsAppSetupPolicy","TeamsAudioConferencingPolicy","TeamsCallingPolicy","TeamsCallParkPolicy","TeamsChannelsPolicy","TeamsComplianceRecordingPolicy","TenantDialPlan","TeamsMeetingBroadcastPolicy","TeamsMeetingPolicy","TeamsMessagingPolicy","TeamsShiftsPolicy","TeamsUpdateManagementPolicy","TeamsVerticalPackagePolicy"}] String PolicyType;
[Key, Description("GroupId, alternatively to Group Displayname")] String GroupId;
[Key, Description("Teams PolicyType. The type of the policy to be assigned. Possible values:"), ValueMap{"CallingLineIdentity","TeamsAppSetupPolicy","TeamsAudioConferencingPolicy","TeamsCallingPolicy","TeamsCallParkPolicy","TeamsChannelsPolicy","TeamsComplianceRecordingPolicy","TenantDialPlan","TeamsMeetingBroadcastPolicy","TeamsMeetingPolicy","TeamsMessagingPolicy","TeamsShiftsPolicy","TeamsUpdateManagementPolicy","TeamsVerticalPackagePolicy"}, Values{"CallingLineIdentity","TeamsAppSetupPolicy","TeamsAudioConferencingPolicy","TeamsCallingPolicy","TeamsCallParkPolicy","TeamsChannelsPolicy","TeamsComplianceRecordingPolicy","TenantDialPlan","TeamsMeetingBroadcastPolicy","TeamsMeetingPolicy","TeamsMessagingPolicy","TeamsShiftsPolicy","TeamsUpdateManagementPolicy","TeamsVerticalPackagePolicy"}] String PolicyType;
[Write, Description("Teams PolicyName. The name of the policy to be assigned.")] string PolicyName;
[Key, Description("Teams Priority. The rank of the policy assignment, relative to other group policy assignments for the same policy type")] string Priority;
[Write, Description("Teams Priority. The rank of the policy assignment, relative to other group policy assignments for the same policy type")] string Priority;
[Write, Description("Present ensures the group policy assignment exists, absent ensures it is removed."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure;
[Write, Description("Credentials of the Teams Admin"), EmbeddedInstance("MSFT_Credential")] string Credential;
[Write, Description("Id of the Azure Active Directory application to authenticate with.")] String ApplicationId;
Expand Down

0 comments on commit dc72827

Please sign in to comment.