Comments (25)
Can you share the permissions granted on the app registration you are using in the pipeline?
from intunecd.
- DeviceManagementApps.Read.All
- DeviceManagementConfiguration.ReadWrite.All
- DeviceManagementManagedDevices.Read.All
- DeviceManagementServiceConfig.Read.All
- Group.Read.All
- Policy.Read.All
- Policy.Read.ConditionalAccess
- User.Read
Adminconsent is granted. There is also a screenshot in my initial post.
from intunecd.
Sorry missed the screen shot 😬 the permissions are granted as delegated but they have to be "application" instead
from intunecd.
Oh I missed that completely. Now I'm getting further, but also an error 403:
Traceback (most recent call last):
File "/home/vsts/.local/bin/IntuneCD-startbackup", line 8, in <module>
sys.exit(start())
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/run_backup.py", line 370, in start
run_backup(args.path, args.output, exclude, token)
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/run_backup.py", line 270, in run_backup
results.append(savebackup(path, output, token))
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/backup_remoteAssistancePartner.py", line 28, in savebackup
data = makeapirequest(ENDPOINT, token)
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/graph_request.py", line 84, in makeapirequest
raise Exception(
Exception: ('Request failed with ', 403, ' - ', '{"error":{"code":"Forbidden","message":"{\\r\\n \\"_version\\": 3,\\r\\n \\"Message\\": \\"An error has occurred - Operation ID (for customer support): 00000000-0000-0000-0000-000000000000 - Activity ID: f6c95f9c-ee09-458a-95c3-cb1db532d474 - Url: https://fef.msub03.manage.microsoft.com/RemoteAssistService/StatelessRemoteAssistService/deviceManagement/remoteAssistancePartners?api-version=5022-08-15 - CustomApiErrorPhrase: Forbidden\\",\\r\\n \\"CustomApiErrorPhrase\\": \\"Forbidden\\",\\r\\n \\"RetryAfter\\": null,\\r\\n \\"ErrorSourceService\\": \\"\\",\\r\\n \\"HttpHeaders\\": \\"{}\\"\\r\\n}","innerError":{"date":"2023-07-07T13:01:36","request-id":"f6c95f9c-ee09-458a-95c3-cb1db532d474","client-request-id":"f6c95f9c-ee09-458a-95c3-cb1db532d474"}}}')
##[error]Bash exited with code '1'.
Finishing: Run IntuneCD backup
from intunecd.
Looks like the same issue as in #120, do you have a partner configured?
from intunecd.
Yes, these three are configured:
from intunecd.
For whatever reason it seems like the permissions is not enough when the teamviewer connector is present. Can you for now try to exclude it from the backup?
I will have to take a deeper look at this when I'm back from vacation
from intunecd.
I've changed the script entry to - script: IntuneCD-startbackup -m 1 -o yaml -e RemoteAssistancePartner
Now I'm getting this:
Traceback (most recent call last):
File "/home/vsts/.local/bin/IntuneCD-startbackup", line 8, in <module>
sys.exit(start())
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/run_backup.py", line 370, in start
run_backup(args.path, args.output, exclude, token)
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/run_backup.py", line 304, in run_backup
get_group_report(path, output)
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/assignment_report.py", line 95, in get_group_report
groups = collect_groups(path)
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/assignment_report.py", line 87, in collect_groups
process_file(
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/assignment_report.py", line 30, in process_file
data = load_file(name, f)
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/load_file.py", line 24, in load_file
repo_data = json.load(file)
File "/usr/lib/python3.10/json/__init__.py", line 293, in load
return loads(fp.read(),
File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
##[error]Bash exited with code '1'.
Finishing: Run IntuneCD backup
from intunecd.
Is it possible for you to try a run locally and not in a pipeline to see if there's any difference?
from intunecd.
I can't get it to run locally in general. I'm absolutely no python pro either. I'll wait until after your vacation, hoping that it will work via pipelines then.
from intunecd.
Bug has been verified in #120, the backup works with interactive auth but not when running with application permissions which it should. I need to bring this to Microsoft.
from intunecd.
Hi @new-it, can you do a new run including the remote management partner and provide me with the ActivityID of the failed run?
from intunecd.
Sorry for the late response, I was on holiday.
Traceback (most recent call last):
File "/home/vsts/.local/bin/IntuneCD-startbackup", line 8, in <module>
sys.exit(start())
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/run_backup.py", line 370, in start
run_backup(args.path, args.output, exclude, token)
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/run_backup.py", line 270, in run_backup
results.append(savebackup(path, output, token))
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/backup_remoteAssistancePartner.py", line 28, in savebackup
data = makeapirequest(ENDPOINT, token)
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/graph_request.py", line 68, in makeapirequest
raise Exception("Request failed with ", response.status_code, " - ", response.text)
Exception: ('Request failed with ', 403, ' - ', '{"error":{"code":"Forbidden","message":"{\\r\\n \\"_version\\": 3,\\r\\n \\"Message\\": \\"An error has occurred - Operation ID (for customer support): 00000000-0000-0000-0000-000000000000 - Activity ID: c9e18294-d8f2-499d-a521-81c5bb3adf42 - Url: https://fef.msub03.manage.microsoft.com/RemoteAssistService/StatelessRemoteAssistService/deviceManagement/remoteAssistancePartners?api-version=5022-08-15 - CustomApiErrorPhrase: Forbidden\\",\\r\\n \\"CustomApiErrorPhrase\\": \\"Forbidden\\",\\r\\n \\"RetryAfter\\": null,\\r\\n \\"ErrorSourceService\\": \\"\\",\\r\\n \\"HttpHeaders\\": \\"{}\\"\\r\\n}","innerError":{"date":"2023-09-15T12:48:44","request-id":"c9e18294-d8f2-499d-a521-81c5bb3adf42","client-request-id":"c9e18294-d8f2-499d-a521-81c5bb3adf42"}}}')
##[error]Bash exited with code '1'.
Finishing: Run IntuneCD backup
from intunecd.
@almenscorner Any update on this?
from intunecd.
Hi - I am still waiting on a reply from Microsoft on this issue. I'll ping them and ask for an update.
from intunecd.
Is there any option to exclude the teamviewer connector from the backup?
from intunecd.
Yes, you can use the -e RemoteAssistancePartner
argument in the backup command
from intunecd.
Sadly, we are now facing an issue with another profile.
Backing up Quality Update profile: Quality updates enforcement - last month
Traceback (most recent call last):
File "/home/vsts/.local/bin/IntuneCD-startbackup", line 8, in <module>
sys.exit(start())
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/run_backup.py", line 379, in start
run_backup(args.path, args.output, exclude, token, args.prefix)
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/run_backup.py", line 332, in run_backup
get_group_report(path, output)
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/assignment_report.py", line 93, in get_group_report
groups = collect_groups(path)
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/assignment_report.py", line 85, in collect_groups
process_file(
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/assignment_report.py", line 30, in process_file
data = load_file(name, f)
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/load_file.py", line 24, in load_file
repo_data = json.load(file)
File "/usr/lib/python3.10/json/__init__.py", line 293, in load
return loads(fp.read(),
File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
##[error]Bash exited with code '1'.
Finishing: Run IntuneCD backup
from intunecd.
It looks like you have an empty JSON file somewhere causing the assignment report module to fail. Can you check if there is any JSON files in your repo with no content?
from intunecd.
We've cloned this repo without making any changes to it. We've also tried to run the flow with an empty repo.
from intunecd.
We're running into the problem even if we exclude the specific object.
- script: IntuneCD-startbackup -m 1 -o yaml -e windowsQualityUpdates RemoteAssistancePartner
env:
REPO_DIR: $(REPO_DIR)
TENANT_NAME: $(TENANT_NAME)
CLIENT_ID: $(CLIENT_ID)
CLIENT_SECRET: $(CLIENT_SECRET)
displayName: Run IntuneCD backup
Backing up Quality Update profile: Quality updates enforcement - last month
Traceback (most recent call last):
File "/home/vsts/.local/bin/IntuneCD-startbackup", line 8, in <module>
sys.exit(start())
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/run_backup.py", line 386, in start
run_backup(
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/run_backup.py", line 337, in run_backup
get_group_report(path, output)
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/assignment_report.py", line 93, in get_group_report
groups = collect_groups(path)
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/assignment_report.py", line 85, in collect_groups
process_file(
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/assignment_report.py", line 30, in process_file
data = load_file(name, f)
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/load_file.py", line 24, in load_file
repo_data = json.load(file)
File "/usr/lib/python3.10/json/__init__.py", line 293, in load
return loads(fp.read(),
File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
##[error]Bash exited with code '1'.
from intunecd.
The error above is not necessarily tied to Quality update profiles as there might be an empty file somewhere else. It is the assignment report that fails. Are you getting the same error if you run a backup locally to a folder instead of a repo targeting the same environment?
from intunecd.
Running locally in pwsh with Py 3.11 via .\IntuneCD-startbackup.exe -m 1 -a .\auth.json -p .\out\ -e RemoteAssistancePartner
:
Backing up Proactive Remediation: [...]
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\lf\AppData\Roaming\Python\Python311\Scripts\IntuneCD-startbackup.exe\__main__.py", line 7, in <module>
File "C:\Users\lf\AppData\Roaming\Python\Python311\site-packages\IntuneCD\run_backup.py", line 386, in start
run_backup(
File "C:\Users\lf\AppData\Roaming\Python\Python311\site-packages\IntuneCD\run_backup.py", line 293, in run_backup
results.append(savebackup(path, output, exclude, token, prefix, append_id))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\lf\AppData\Roaming\Python\Python311\site-packages\IntuneCD\backup_proactiveRemediation.py", line 90, in savebackup
f.write(decoded)
File "C:\Program Files\Python311\Lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode character '\ufeff' in position 0: character maps to <undefined>
from intunecd.
Please follow this step and then run the backup: https://github.com/almenscorner/IntuneCD/wiki/FAQ#q-i-get-a-codec-cant-encode-character--when-running-the-backup
from intunecd.
I've managed to get it to work locally, and for some reason it just started working as a pipeline without any further changes. Thanks a lot for your help!
from intunecd.
Related Issues (20)
- [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 11
- [BUG] Backup fails after renewal of Apple Push Nofication certificate HOT 1
- [BUG] pip3 install IntuneCD installs not the latest version HOT 7
- [BUG] - Deletion of autopilot assignments HOT 11
- [FEATURE] Exit code handling HOT 1
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.