devops_pipelines's People
devops_pipelines's Issues
Powershell Throws error during "Find change author & commit the backup" section
Fails on backup_remoteAssistancePartner.py
Hi,
awesome tool, thanks a lot.
Failed for us first. Probably because we had in the past Teamviewer integrated.
A new exclude fixed it, didnt find a GRAPH API permission for it so far.
IntuneCD-startbackup \
--mode=1 \
--output=json \
--path="$(Build.SourcesDirectory)/$(BACKUP_FOLDER)" \
--exclude CompliancePartner RemoteAssistancePartner \
--append-id
Traceback (most recent call last):
File "/home/vsts/.local/bin/IntuneCD-startbackup", line 8, in
sys.exit(start())
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/run_backup.py", line 271, in start
run_backup(
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/run_backup.py", line 218, in run_backup
backup_intune(results, path, output, exclude, token, prefix, append_id, args)
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/backup_intune.py", line 118, in backup_intune
results.append(savebackup(path, output, token, append_id))
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/backup/Intune/backup_remoteAssistancePartner.py", line 29, in savebackup
data = makeapirequest(ENDPOINT, token)
File "/home/vsts/.local/lib/python3.10/site-packages/IntuneCD/intunecdlib/graph_request.py", line 85, in makeapirequest
raise requests.exceptions.HTTPError(
requests.exceptions.HTTPError: 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: 449918c1-d88c-4dbe-a359-cdee03985fea - Url: https://fef.msub05.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":"2024-01-14T18:43:40","request-id":"449918c1-d88c-4dbe-a359-cdee03985fea","client-request-id":"449918c1-d88c-4dbe-a359-cdee03985fea"}}}##[error]Bash exited with code '1'.
##[error]Bash wrote one or more lines to the standard error stream.
##[error]Traceback (most recent call last):
File "/home/vsts/.local/bin/IntuneCD-startbackup", line 8, in
Error 1 with git tag in Azure Devops
Issue:
Running pipeline in Azure Devops fails on git tag creation
Error:
Error no 1
Issue:
Identity permissions on pipeline's repository
Solution:
Service connection needs contribution access and tag creation permission to the repository.
Navigate to project settings -> repository -> -> Security
Change the service connection's permissions to Allow for 'Contribute' and 'Create tag'
Unable to find resourceId in '$file' file name, when running as pipeline
We have been running IntuneCD via DevOps pipeline successfully for many months. Followed the steps on https://doitpsway.com/how-to-easily-backup-your-intune-environment-using-intunecd-and-azure-devops-pipeline. On 2/13/2024, at 7:00 PM CST, the pipeline failed. It first failed at step "Create Intune Backup" and specified that the application needed to be granted DeviceManagementRBAC.Read.All rights. This was completed and the pipeline moved on past that step. Now at the step called "Find Change Author & Commit The Backup", it fails with the following error.
Exception: /home/vsts/work/_temp/163166ea-6cc7-4511-acd5-865f3d79e280.ps1:227
Line |
227 | throw "Unable to find resourceId in '$file' file name. Pipe โฆ
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Unable to find resourceId in 'prod-backup/Scope Tags/Default__0.json'
| file name. Pipeline code modification needed, because some changes in
| IntuneCD were made probably.
##[error]PowerShell exited with code '1'.
To Reproduce
Steps to reproduce the behavior: Run the pipeline described in https://doitpsway.com/how-to-easily-backup-your-intune-environment-using-intunecd-and-azure-devops-pipeline
It looks like a few files were updated on 2/13 and 2/14, and they may be the root cause. Thanks for looking into it.
Expected behavior
The expectation is that that step in the pipeline can complete successfully and move on in job.
Screenshots
If applicable, add screenshots to help explain your problem.
Run type (please complete the following information):
Mode: [e.g. 0 or 1]
Client [e.g. Pipeline, local machine] Pipeline
Version [e.g. 1.0.2] Setup.cfg says that it was updated 8 hours ago to 2.1.1
Get-MgAuditLogDirectoryAudit : The stream was already consumed. It cannot be read again.
Hi! I'm trying to run your pipeline but get the following error, the pipeline ran for over 8 hours could it be as per this issue that the access token needs refreshed? : https://github.com/microsoftgraph/msgraph-sdk-powershell/issues/1911
##[error]Get-MgAuditLogDirectoryAudit : The stream was already consumed. It cannot be read again.
At C:\a\_temp\561e9809-62b8-4fbf-845c-c93ab44c31a1.ps1:171 char:3
+ $modificationEvent = Get-MgAuditLogDirectoryAudit -All -Filter $eve ...
+ CategoryInfo : NotSpecified: (:) [Get-MgAuditLogDirectoryAudit_List], InvalidOperationException
+ FullyQualifiedErrorId : Microsoft.Graph.PowerShell.Cmdlets.GetMgAuditLogDirectoryAudit_List
##[debug]Processed: ##vso[task.logissue source=CustomerScript;type=error]Get-MgAuditLogDirectoryAudit : The stream was already consumed. It cannot be read again.
At C:\a\_temp\561e9809-62b8-4fbf-845c-c93ab44c31a1.ps1:171 char:3
+ $modificationEvent = Get-MgAuditLogDirectoryAudit -All -Filter $eve ...
+ CategoryInfo : NotSpecified: (:) [Get-MgAuditLogDirectoryAudit_List], InvalidOperationException
+ FullyQualifiedErrorId : Microsoft.Graph.PowerShell.Cmdlets.GetMgAuditLogDirectoryAudit_List
##[error]PowerShell exited with code '1'.
Failing at Create Intune Backup- unrecognized arguments: -t ***
Markdown Export to PDF failing
prod-as-built.html = $ md-to-pdf [options] path/to/file.md Options: -h, --help
Hi,
we uncommented the functionality for "Generate markdown document & commit" and the file prod-as-built.html only contains the command help output:
$ md-to-pdf [options] path/to/file.md Options: -h, --help ............... Output usage information -v, --version ............ Output version -w, --watch .............. Watch the current file(s) for changes --watch-options .......... Options for Chokidar's watch call --basedir ................ Base directory to be served by the file server --stylesheet ............. Path to a local or remote stylesheet (can be passed multiple times) --css .................... String of styles --document-title ......... Name of the HTML Document. --body-class ............. Classes to be added to the body tag (can be passed multiple times) --page-media-type ........ Media type to emulate the page with (default: screen
# Publish PDF & HTML documents as an artifacts
- job: publish
displayName: Publish as-built artifacts
dependsOn: tag
condition: and(succeeded(), eq(dependencies.backup_intune.outputs['commitAndsetVariable.CHANGE_DETECTED'], 1))
pool:
vmImage: ubuntu-latest
continueOnError: false
steps:
- checkout: self
persistCredentials: true
# Install md-to-pdf
# https://github.com/simonhaenisch/md-to-pdf
- task: Bash@3
displayName: Install md-to-pdf
inputs:
targetType: 'inline'
script: |
npm i --location=global md-to-pdf
workingDirectory: '$(Build.SourcesDirectory)'
failOnStderr: true
# Convert markdown document to HTML
- task: Bash@3
displayName: Convert markdown to HTML
inputs:
targetType: 'inline'
script: |
cat "$(Build.SourcesDirectory)/prod-as-built.md" | md-to-pdf --config-file "$(Build.SourcesDirectory)/md2pdf/htmlconfig.json" --as-html > "$(Build.SourcesDirectory)/prod-as-built.html"
workingDirectory: '$(Build.SourcesDirectory)'
failOnStderr: false
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: "$(Build.SourcesDirectory)/prod-as-built.html"
artifactName: "prod-as-built.html"
# Convert markdown document to PDF
- task: Bash@3
displayName: Convert markdown to PDF
inputs:
targetType: 'inline'
script: |
cat "$(Build.SourcesDirectory)/prod-as-built.md" | md-to-pdf --config-file "$(Build.SourcesDirectory)/md2pdf/pdfconfig.json" > "$(Build.SourcesDirectory)/prod-as-built.pdf"
workingDirectory: '$(Build.SourcesDirectory)'
failOnStderr: false
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: "$(Build.SourcesDirectory)/prod-as-built.pdf"
artifactName: "prod-as-built.pdf"
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.