diff --git a/CHANGELOG.md b/CHANGELOG.md index ab8076be04..ad8f07468f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ # UNRELEASED +* AADServicePrincipal + * FIXES [#5549](https://github.com/microsoft/Microsoft365DSC/issues/5549) * AADDeviceRegistrationPolicy * Fixes an error when trying to disable AAD join. * FabricAdminTenantSettings diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADServicePrincipal/MSFT_AADServicePrincipal.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADServicePrincipal/MSFT_AADServicePrincipal.psm1 index 0ec87681ed..cc05842a86 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADServicePrincipal/MSFT_AADServicePrincipal.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADServicePrincipal/MSFT_AADServicePrincipal.psm1 @@ -309,7 +309,7 @@ function Get-TargetResource } $result = @{ - AppId = $appInstance.DisplayName + AppId = $AADServicePrincipal.AppId AppRoleAssignedTo = $AppRoleAssignedToValues ObjectID = $AADServicePrincipal.Id DisplayName = $AADServicePrincipal.DisplayName diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADServicePrincipal.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADServicePrincipal.Tests.ps1 index d603524a7d..b00ef17dec 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADServicePrincipal.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADServicePrincipal.Tests.ps1 @@ -215,7 +215,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name 'The app exists and values are already in the desired state' -Fixture { BeforeAll { $testParams = @{ - AppId = 'App1' + AppId = 'b4f08c68-7276-4cb8-b9ae-e75fca5ff834' DisplayName = 'App1' AlternativeNames = 'AlternativeName1', 'AlternativeName2' AccountEnabled = $true