almenscorner / IntuneCD

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

[BUG] "HTTPError: Request failed with 200" if a ScopeTag is created #178

Closed CubeWT closed 6 months ago

CubeWT commented 6 months ago

Describe the bug If a ScopeTag is created for the first time in a Tenant, IntuneCD throws an error despite the ScopeTag gets imported successfully.

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\testuser\AppData\Local\Programs\Python\Python312\Scripts\IntuneCD-startupdate.exe\__main__.py", line 7, in <module>
  File "C:\Users\testuser\AppData\Local\Programs\Python\Python312\Lib\site-packages\IntuneCD\run_update.py", line 308, in start
    run_update(
  File "C:\Users\testuser\AppData\Local\Programs\Python\Python312\Lib\site-packages\IntuneCD\run_update.py", line 229, in run_update
    update_intune(
  File "C:\Users\testuser\AppData\Local\Programs\Python\Python312\Lib\site-packages\IntuneCD\update_intune.py", line 22, in update_intune
    update(path, token, assignment, report, create_groups, remove)
  File "C:\Users\testuser\AppData\Local\Programs\Python\Python312\Lib\site-packages\IntuneCD\update\Intune\update_scopeTags.py", line 128, in update
    post_request = makeapirequestPost(
                   ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\testuser\AppData\Local\Programs\Python\Python312\Lib\site-packages\IntuneCD\intunecdlib\graph_request.py", line 205, in makeapirequestPost
    raise requests.exceptions.HTTPError(
requests.exceptions.HTTPError: Request failed with 200 - {"@odata.context":"https://graph.microsoft.com/beta/$metadata#deviceManagement/roleScopeTags/$entity","id":"11","displayName":"TEST2","description":"","isBuiltIn":false}

To Reproduce

  1. Import a non existing ScopeTag in a Tenant

Expected behavior The ScopeTag gets imported without the error thrown.

Screenshots

image

Run type (please complete the following information):

Additional context