Sync from dev @ 252c1cf

Source: main (252c1cf)
Excluded: live tenant exports, generated artifacts, and dev-only tooling.
This commit is contained in:
2026-04-17 15:57:35 +02:00
commit 17d745bdac
52 changed files with 15601 additions and 0 deletions

30
md2pdf/README.md Normal file
View File

@@ -0,0 +1,30 @@
# Automated Microsoft Intune backup and as-built
A template repository that you can clone to enable a Microsoft Intune tenant backup and as-built report using [IntuneCD](https://github.com/almenscorner/IntuneCD) and [md-to-pdf](https://github.com/simonhaenisch/md-to-pdf).
To learn how to use this repository, see these articles:
- [Automate Microsoft Intune As-Built Documentation on GitHub](https://stealthpuppy.com/automate-intune-documentation-github/)
- [Automate Microsoft Intune As-Built Documentation on Azure DevOps](https://stealthpuppy.com/automate-intune-documentation-azure/)
## Example report
The generated as-built documentation will look something like:
![As-built documentation screenshot](.img/asbuilt-sample.png)
## GitHub
After creating a new repository in GitHub based on this template, you'll need to enable the Actions to run via the repository settings, and add the secrets required by the workflows.
This template repository includes the following workflows:
* [`intune-backup.yml`](.github/workflows/intune-backup.yml) - performs the export from the Intune tenant to create a backup, and generates a markdown version of the as-built document, and tags the release
* [`intune-release.yml`](.github/workflows/intune-release.yml) - generates PDF and HTML versions of the markdown document, creates a release, and adds the documents to the release as assets
* [`remove-releases.yml`](.github/workflows/remove-releases.yml) - prunes the release assets to keep the last 60 releases
## Azure DevOps
Clone this repository into GitHub or Azure DevOps, then import into a project and create a pipeline:
* [`intune-backup.yml`](.devops/intune-backup.yml) - performs the export from the Intune tenant to create a backup, and generates a markdown version of the as-built document, and tags the release, generates PDF and HTML versions of the markdown document, creates a release, and adds the documents to the release as assets

9
md2pdf/htmlconfig.json Normal file
View File

@@ -0,0 +1,9 @@
{
"stylesheet": [
"./md2pdf/htmlstyle.css"
],
"marked_options": {
"headerIds": false,
"smartypants": true
}
}

140
md2pdf/htmlstyle.css Normal file
View File

@@ -0,0 +1,140 @@
* {
box-sizing: border-box;
}
html {
font-size: 100%;
}
body {
font-family: 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
line-height: 1.6;
font-size: 0.6875em; /* 11 pt */
color: #111;
margin: 0;
}
body > :first-child {
padding-top: 0;
margin-top: 0;
}
body > :last-child {
margin-bottom: 0;
padding-bottom: 0;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0;
padding: 0.5em 0 0.25em;
text-transform: uppercase;
}
h5,
h6 {
padding: 0;
}
h5 {
font-size: 1em;
}
h6 {
font-size: 0.875em;
}
p {
margin: 0.25em 0 1em;
}
blockquote {
margin: 0.5em 0 1em;
padding-left: 0.5em;
padding-right: 1em;
border-left: 4px solid gainsboro;
font-style: italic;
}
ul,
ol {
margin: 0;
margin-left: 1em;
padding: 0 1.5em 0.5em;
}
pre {
white-space: pre-wrap;
}
h1 code,
h2 code,
h3 code,
h4 code,
h5 code,
h6 code,
p code,
li code,
pre code {
background-color: #f8f8f8;
padding: 0.1em 0.375em;
border: 1px solid #f8f8f8;
border-radius: 0.25em;
font-family: monospace;
font-size: 1.2em;
}
pre code {
display: block;
padding: 0.5em;
}
.page-break {
page-break-after: always;
}
img {
max-width: 100%;
margin: 1em 0;
}
table {
border-spacing: 0;
border-collapse: collapse;
margin: 0 0 1em;
display: block;
width: 100%;
overflow: auto;
table-layout: auto;
width: 100%;
}
table th,
table td {
padding: 0.5em 1em;
border: 1px solid gainsboro;
}
table th {
font-weight: 600;
text-transform: uppercase;
}
table tr {
background-color: white;
border-top: 1px solid gainsboro;
}
table tr:nth-child(2n) {
background-color: whitesmoke;
}
section {
margin: 0 auto;
font-family: 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif !important;
font-size: 9px;
}

17
md2pdf/pdfconfig.json Normal file
View File

@@ -0,0 +1,17 @@
{
"stylesheet": [
"./md2pdf/pdfstyle.css"
],
"marked_options": {
"headerIds": false,
"smartypants": true
},
"pdf_options": {
"format": "A4",
"margin": "15mm",
"printBackground": false,
"headerTemplate": "<style> section { margin: 0 auto; font-family: sans-serif !important; font-size: 9px; } </style><section><span>ASTRAL Documentation</span></section>",
"footerTemplate": "<style> section { margin: 0 auto; font-family: sans-serif !important; font-size: 9px; } </style><section><div>Page <span class='pageNumber'></span> of <span class='totalPages'></span></div></section>",
"displayHeaderFooter": true
}
}

179
md2pdf/pdfstyle.css Normal file
View File

@@ -0,0 +1,179 @@
* {
box-sizing: border-box;
}
@page {
margin: 18mm 14mm 18mm 14mm;
}
html {
font-size: 100%;
}
body {
font-family: 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
line-height: 1.6;
font-size: 0.6875em; /* 11 pt */
color: #111;
margin: 0;
orphans: 3;
widows: 3;
}
body > :first-child {
padding-top: 0;
margin-top: 0;
}
body > :last-child {
margin-bottom: 0;
padding-bottom: 0;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0;
padding: 0.5em 0 0.25em;
text-transform: uppercase;
page-break-after: avoid;
break-after: avoid-page;
page-break-inside: avoid;
break-inside: avoid-page;
}
h5,
h6 {
padding: 0;
}
h5 {
font-size: 1em;
}
h6 {
font-size: 0.875em;
}
p {
margin: 0.25em 0 1em;
}
blockquote {
margin: 0.5em 0 1em;
padding-left: 0.5em;
padding-right: 1em;
border-left: 4px solid gainsboro;
font-style: italic;
page-break-inside: avoid;
break-inside: avoid-page;
}
ul,
ol {
margin: 0;
margin-left: 1em;
padding: 0 1.5em 0.5em;
page-break-inside: avoid;
break-inside: avoid-page;
}
li {
page-break-inside: avoid;
break-inside: avoid-page;
}
pre {
white-space: pre-wrap;
page-break-inside: avoid;
break-inside: avoid-page;
}
h1 code,
h2 code,
h3 code,
h4 code,
h5 code,
h6 code,
p code,
li code,
pre code {
background-color: #f8f8f8;
padding: 0.1em 0.375em;
border: 1px solid #f8f8f8;
border-radius: 0.25em;
font-family: monospace;
font-size: 1.2em;
}
pre code {
display: block;
padding: 0.5em;
}
.page-break {
page-break-after: always;
}
img {
max-width: 100%;
margin: 0.5em 0 1em;
page-break-inside: avoid;
break-inside: avoid-page;
}
img[alt="ASTRAL logo"] {
max-width: 62%;
margin: 0 0 0.75em;
}
table {
border-spacing: 0;
border-collapse: collapse;
margin: 0 0 1em;
width: 100%;
overflow: auto;
table-layout: auto;
width: 100%;
page-break-inside: avoid;
break-inside: avoid-page;
}
table th,
table td {
padding: 0.5em 1em;
border: 1px solid gainsboro;
vertical-align: top;
}
table th {
font-weight: 600;
text-transform: uppercase;
}
table tr {
background-color: white;
border-top: 1px solid gainsboro;
page-break-inside: avoid;
break-inside: avoid-page;
}
table tr:nth-child(2n) {
background-color: whitesmoke;
}
hr,
svg,
figure {
page-break-inside: avoid;
break-inside: avoid-page;
}
section {
margin: 0 auto;
font-family: 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif !important;
font-size: 9px;
}