Comments (12)
Ahh, based on that line it seems like it only checks for the key to be present and not having any value so when I changed line 149 locally here to:
for key, val in list.items() if 'templateId' in key and val != None]
It actually worked and created the policy without issue this time!
from intunecd.
Interesting, I will add those changes and run some tests as well. If I don't see any issues I will add it to the next update!
Thank you for testing and reporting back
from intunecd.
Hi,
I tried with the configuration you sent as an example and it was created as a new configuration just fine in my environment and I was able to update the configuration.
In what scenario do you get this error? i.e. is it when trying to deploy to a new env without any configs or updating the config in a current env where it exists?
from intunecd.
Hi there,
Thanks for checking it out :)
The scenario I am testing in has a pure dev tenant and a test tenant that as of now do not have the config (this test tenant is safe to delete any all policies as needed by testing, so I usually clean it up first and test on a clean slate).
The error has me a bit stumped at the moment since it gives so few details on what actually failed where all the other policy types I tested worked really well. I also tried renaming the policy and testing if the name had any impact on the error but not really any difference, it always fails out on that one error.
During testing I also removed all other policy types from the backup folder to narrow it down to this category as well.
It does not seem to matter much which of the subtypes of management intent it is I try to upload, they all backed up fine but refuse to run through the update process
from intunecd.
Interesting, I just published 5 encryption manifests as new configs to test and it worked π€
Can you verify the permissions the Azure AD app registrations have in your test env you are trying to publish to?
from intunecd.
I just double checked all the permissions now and also verified I was able to import back to the dev environment too, so that narrowed it down to simply this other test tenant.
I did find something really strange when digging further using the graph API, as in this test tenant I get back lots of response objects that are not visible in the management portal at Microsoft. And they all lack a proper value for template id so it makes sense with the none error:
Example:
id : 98b3d3c2-adc5-44bb-ac2f-9df8d3bd54b9
displayName : My-Policy-Name-Here
description : Application control
isAssigned : False
lastModifiedDateTime : 15.08.2022 18:33:16
templateId :
roleScopeTagIds : {0, 1}
If entries without a template id could be ignored I wonder if this would most likely work in such cases too.
(I verified I could query out all these using the same application id and secret I am trying to use for the update)
from intunecd.
I ran into that myself some time ago and did add a check for null template id here:
IntuneCD/src/IntuneCD/graph_batch.py
Line 153 in cb37cf7
I'm trying to figure out a way I can replicate this and implement a fix for the scenario :)
from intunecd.
Nice catch, I'll add that fix as part of some other updates due to be pushed tomorrow
from intunecd.
Thanks for all the help in putting me on the right track here and making this wonderful project too! π
from intunecd.
When testing to see if there could be any more issues, I found that if I run it once more, so it has to try to overwrite it gives the following error:
Traceback (most recent call last):
File "C:\Python\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Python\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Python\Scripts\IntuneCD-startupdate.exe_main.py", line 7, in
File "C:\Python\lib\site-packages\IntuneCD\run_update.py", line 207, in start
run_update(args.path, token, args.u, exclude)
File "C:\Python\lib\site-packages\IntuneCD\run_update.py", line 152, in run_update
diff_count += update(path, token, assignment)
File "C:\Python\lib\site-packages\IntuneCD\update_managementIntents.py", line 39, in update
intent_responses = batch_intents(intents, token)
File "C:\Python\lib\site-packages\IntuneCD\graph_batch.py", line 166, in batch_intents
settings_ids = [val for list in categories_responses if intent['templateId'] in list['@odata.context']
File "C:\Python\lib\site-packages\IntuneCD\graph_batch.py", line 166, in
settings_ids = [val for list in categories_responses if intent['templateId'] in list['@odata.context']
TypeError: 'in ' requires string as left operand, not NoneType
from intunecd.
I deliberately forced a None value on the template Id but even then I don't get this error. Would really like to be able to replicate and narrow down what is happening
from intunecd.
It is definitely a very strange error indeed, after trying and failing a bit more here I got it to work by changing line 160 as well to the following:
settings_ids = [val for list in categories_responses if intent['templateId'] != None and intent['templateId'] in list['@odata.context']
Not sure if that is the cleanest way to write this, but now it successfully both creates the item if missing and updated the setting just fine too. Tested editing it in the test environment and running a new update and it forced back the proper value from the backup as expected π
from intunecd.
Related Issues (20)
- [FEATURE] --exclude option for lastHeartbeatDateTime in CompliancePartner
- [BUG] resourceId is not added to scope tags json file name HOT 4
- [BUG] Scope Tag Assignments not always reported in the same order HOT 5
- [BUG] "Scope Tag Deleted" if the ScopeTagIDs differ between tenants HOT 21
- [BUG] "HTTPError: Request failed with 200" if a ScopeTag is created
- Intune Custom Compliance Scripts HOT 15
- [FEATURE] Change "Device Filter" import priority HOT 1
- [BUG] 504 errors and other bash issues HOT 1
- [BUG] Failed to create the "Windows Driver Update" Profile with Version 2.3.0b2 HOT 3
- [BUG] Scripts: No changes foun -> Script changed HOT 7
- [FEATURE] Add support for Azure DevOps Federating identity authentication HOT 9
- [BUG] Exclude of "assignments" not supported HOT 3
- [BUG] Convert markdown to PDF HOT 5
- [BUG] Error in pipeline when running update HOT 11
- [BUG] V2.3.0 - Auditing not being added to commits HOT 10
- [BUG] MobileApp Create By... being created without --audit HOT 2
- Update Documentation doesn't include --create-groups argument HOT 1
- [FEATURE] Update group settings HOT 3
- [BUG] Updating a macOS software update policy with group inclusions and exclusions HOT 2
- [BUG] Compliance Policies not being added to Assignment report for new groups HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from intunecd.