-
Notifications
You must be signed in to change notification settings - Fork 523
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
IntuneWindowsAutopilotDeploymentProfileAzureAD{,Hybrid}Joined, IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10: Resources cannot set Assignments property #3892
Comments
I already raised #3893 to remove the Id from $ValuesToCheck :) |
@William-Francillette It seems that IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10 is also affected by the same problem and Assignments are not applied. |
What do you know... IntuneDeviceConfigurationPolicyWindows10 is also not working for setting up the Assignments, this one fails with Bad request instead of Forbidden
|
Is your group id correct? |
I wouldn't raise the issue if it wasn't :) I exported the config from another tenant and replaced the groupIds with the correct Ids from the target tenant, it doesn't matter which ones I choose it always fail, as in the policy is deployed but without setting Assignments. |
As an example IntuneApplicationControlPolicyWindows10 and IntuneDeviceCompliancePolicyAndroid are working as it should. |
ok fair enough, I'll check why those aren't working |
Right, I just tested and IntuneDeviceConfigurationEndpointProtectionPolicyWindows10 is actually working and setting up Assignments property, but then again that one suffers from other problems which makes it not be in desired state as well... |
The Id issue was merged in Dev today |
Yep, I know I tested the affected version without your change but in verbose mode the target values looked oddly suspicious along with the Id problem. I'll confirm if it still has any issues or not when I get back home, nevertheless if it has I'll raise a separate issue for that one, otherwise if it works I'll just let you know here. |
🤔 Assignments have changed in the API - the action assign doesn't exist anymore so have to rethink how to manage those |
Oh the perks of using beta APIs, I feel your pain! |
Ouch the API doc is not up to date |
Hi @peombwa, hope you're keeping well 1- This doc (sdk) is missing the parameter WindowsAutopilotDeploymentProfileAssignmentId 2- Using Get-MgBetaDeviceManagementWindowsAutopilotDeploymentProfileAssignment, is there a way to retrieve the groupId of the assignment other than parsing the assignment id? 3- It seems like there was a change in the API in regards of Assignments for some Intune policies like this one DeviceManagementWindowsAutopilotDeploymentProfile: the assign action was replaced by assignments 4- There is some discrepancies now between the published documentation and the API such as this doc https://learn.microsoft.com/en-us/graph/api/intune-shared-windowsautopilotdeploymentprofile-assign?view=graph-rest-beta |
@William-Francillette Just to confirm that IntuneDeviceConfigurationEndpointProtectionPolicyWindows10 is working perfectly now, on the other hand I found yet another problem with IntuneRoleDefinition 😭 |
By the way I'm testing and finding all this stuff with my own pipeline and throwing examples at it to make real deployments, but it would definitely be something that would help the project having it automated directly here in this repo instead every time a new resource is added. See discussion #3458 about this with @andikrueger |
IntuneDeviceEnrollmentStatusPageWindows10 is also affected but additionally also prints out problems with every property inside the assignments, this is just an example below but removing the affected property then complains about the next one.
|
Quick update: |
@William-Francillette Great! Are you using their new API? Did you find documentation for it? What about these 2 below? At least IntuneDeviceConfigurationPolicyWindows10 knocks several policies that I cannot use because of this issue. IntuneDeviceConfigurationPolicyWindows10 |
I went back using the sdk, this makes assignment management more tedious but no real choice and we need a stable solution btw this policy (autopilot) is very restrictive compared to other in Intune, for example you can't delete a policy if it's assigned, or can't exclude collection if AllDevices is part of the included assignments. The API error messages are very generic and don't give you any information |
Maybe this is a bit of help: https://learn.microsoft.com/en-us/troubleshoot/mem/intune/device-enrollment/troubleshoot-windows-enrollment-errors#an-error-occurred-while-creating-autopilot-profile
Are there any error codes within the API responses or really nothing at all - which would be really bad practice. From a M365DSC standpoint, we should try to support all scenarios: CRUD. If delete or create a not an option for certain scenarios, it would be best practice to handle these cases (if this is possible). Otherwise we should look into a good documentation for this resource which would outline common mistakes. |
Any chance to expand the category information? |
will check in the evening |
Looks like this request is related to this issue: Azure/autorest.powershell#888 |
Unfortunately this is true to other resources which also suffer from the "same problem", from the ones I mention in #3458 that don't have an issue yet raised many of them also output the same error message but clearly the problem at hand it's actually something else not related to each other. Graph really should return a proper error message when things go south. |
@ricmestre, could you check this sdk command please for me on your tenant It looks broken - I'm receiving a 400 error - is it same for you? |
Quick update: I have a solution I'm happy with and updated
@ykuijs The solution incorporate the groupDisplayName as well so it should be fairly easy to push that to the rest of the resources I've got confused and mixed the resources so missed IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10 |
@William-Francillette Hi, just tested it and for me it's actually working.
|
Can you try with an ESP policy? |
yes, still works. you just need to Id.Split('_')[1] and call Get-MgGroup on it to get the group's display name if that's what you're looking for.
|
just realised there was a typo in my extract and was missing a character in the policyId 🤦♂️ |
It's actually better than just splitting the id (I was initially doing that) - there's an issue with the display rendering of the object but the attribute are populated |
@ricmestre can you try removing an assignment using I'm getting a 400 error from the sdk and Graph explorer - also the Intune Portal uses the action assign but the documentation shows using CRUD with assignments Get and List work fine but Create and Delete fail |
That generic error message from Graph we all love and hate! I'll try it out later on today and will provide you feedback. Thank you a ton for taking care of this! |
No dice, I'm also getting error 400.
|
Yep I think the API is broken as I get the same result in the Graph Explorer Will continue this discussion in the other issue :D |
Good news PR posted and fixed IntuneDeviceEnrollmentStatusPageWindows10 by using the assign action from the API |
Looks great to me :D Additionally you're also removing the Id property from Test-TargetResource on IntuneWindowsAutopilotDeploymentProfileAzureAD{,Hybrid}Joined but that is to solve something else and I already have PR #3893 to solve that, in fact there's a few more resources I found so far that also require the same treatment. |
Description of the issue
IntuneWindowsAutopilotDeploymentProfileAzureADJoined, IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined and IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10 resources cannot apply the Assignments property, this seems to be due to an incorrect endpoint used in cmdlet Update-DeviceConfigurationPolicyAssignment (from M365DSCDRGUtil.psm1), according to https://learn.microsoft.com/en-us/graph/api/intune-enrollment-windowsautopilotdeploymentprofileassignment-update?view=graph-rest-beta it should be "deviceManagement/windowsAutopilotDeviceIdentities" instead of "deviceManagement/windowsAutopilotDeploymentProfiles", nevertheless the rest of the URI is also different and works differently since it must used POST for creating the assignments and PATCH to update them, whereas currently the cmdlet only uses POST.
This means that these resources always show up as not being in desired state since Assignments is not correct, I have a diff which I'll create a PR for that solves the problem with the Id property but that's a separate issue.
Minimal reproducer provided with the reference blueprint below, no errors will be displayed while configuration is deployed but Event Viewer shows the following below, but please bear in mind that the apps I use for deployment don't have problems with other resources and they already have scope 'DeviceManagementServiceConfig.ReadWrite.All' assigned which should be sufficient to perform this task so this is not a permission issue from my side.
@William-Francillette Could you please have a look?
Microsoft 365 DSC Version
1.23.1108.1
Which workloads are affected
other
The DSC configuration
Verbose logs showing the problem
Environment Information + PowerShell Version
The text was updated successfully, but these errors were encountered: