almenscorner / IntuneCD

Tool to backup, update and document configurations in Intune
MIT License
289 stars 38 forks source link

[BUG] Scope Tag Assignments not always reported in the same order #174

Closed Wob76 closed 8 months ago

Wob76 commented 8 months ago

Describe the bug The order of the assignments in the Scope Tag files is not returned in a consistent order, this results in changes being logged even when no change exists.

I was undecided if I should call this a bug or a feature request, feel free to redefine.

I am not sure if this happens to other config files, but I noticed it last night in the scope tags.

To Reproduce Steps to reproduce the behavior: Run several backups and monitor for changes.

Expected behavior We should not see changes when there are no real changes.

Screenshots If applicable, add screenshots to help explain your problem. You can see below a remove and a add has been detected for the same groupname image

I think if the groupname results were sorted before being stored this would solve this issue.

Run type (please complete the following information):

almenscorner commented 8 months ago

Do you only see this behaviour in the beta or also in stable version? is there any failed batch retries occurring when this change happens in the ordering?

Wob76 commented 8 months ago

Hi, at this stage I have only seen it on the Beta, and it hasn't been consistent, I'll tun some backups with the stable and report back.

almenscorner commented 8 months ago

I just want to make sure I am not doing any changes that in the end would mean new commits for hundreds of setups that are not seeing this behaviour today

Wob76 commented 8 months ago

No problem at all, completely understand. I have been trying to debug more between other tasks, I have been able to get the same thing to happen in both Beta (pipeline) and Stable (local), but it is rare, less than 1 in 10 runs.

I also can't be 100% sure it isn't being triggered by some change in our environment, there is not matching Intune audit event linked to a user, but as with a group name change this could be something happening outside Intune, eg in AAD. That said there is no change in the overall config, just some of the assignment groups move.

I have not seen it outside of the Scope Tags, and it is only impacting a small set, we have 158 scope tags and I have only seen < 5 in any one event.

I will try and fire up a new test pipeline running the stable release and have it trigger more frequently than the main one which is once a day, and see if I can narrow down the issue some more. In the mean time if you can think of anything you would like me to test I am more than happy to try.

Wob76 commented 8 months ago

I will close this off for now, I have been running a stability test pipeline (every three hours) and this hasn't triggered for almost two weeks, I can't pin down the cause yet or say it isn't due to changes in the environment, I will re-open if I can pin this issue down or if it happens more frequently.