Skip to content

Commit 7771407

Browse files
authored
feat: Provide documentation on various modes for injecting content into an ARM template (#269)
* added injection instruction documentation * added some more descriptive text * fix markdown * use chapters instead of bold text * added documentation update to previous versions as well Co-authored-by: Pim Simons <pim.simons@codit.eu>
1 parent da93499 commit 7771407

7 files changed

Lines changed: 145 additions & 19 deletions

File tree

  • docs
    • preview/02-Features/powershell
    • versioned_docs
      • version-v0.1.3/02-Features/powershell
      • version-v0.2/02-Features/powershell
      • version-v0.3/02-Features/powershell
      • version-v0.4.3/02-Features/powershell
      • version-v0.4/02-Features/powershell
      • version-v0.5/02-Features/powershell

docs/preview/02-Features/powershell/arm.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ By using this script, you can inject external files inside your ARM template.
2828
| --------- | --------- | ----------------------------------------------------------------------------------------------- |
2929
| `Path` | no | The file path to the ARM template to inject the external files into (default: `$PSScriptRoot`) |
3030

31-
**Usage**
31+
### Usage
3232
Annotating content to inject:
3333

3434
```json
@@ -54,5 +54,23 @@ Injecting the content:
5454
PS> Inject-ArmContent -Path deploy\arm-template.json
5555
```
5656

57-
**Recommendations**
57+
### Injection Instructions
58+
It is possible to supply injection instructions in the injection annotation, this allows you to add specific functionality to the injection. These are the available injection instructions:
59+
60+
| Injection Instruction | Description |
61+
| --------------------- | ----------------------------------------------------------------------------------------------------------- |
62+
| `EscapeJson` | Replace double quotes not preceded by a backslash with escaped quotes |
63+
| `ReplaceSpecialChars` | Replace newline characters with literal equivalents, tabs with spaces and `"` with `\"` |
64+
| `InjectAsJsonObject` | Tests if the content is valid JSON and makes sure the content is injected without surrounding double quotes |
65+
66+
Usage of multiple injection instructions is supported as well, for example if you need both the `EscapeJson` and `ReplaceSpecialChars` functionality.
67+
68+
Some examples are:
69+
```powershell
70+
${ FileToInject = ".\Parent Directory\file.xml" }
71+
${ FileToInject = ".\Parent Directory\file.xml", EscapeJson, ReplaceSpecialChars }
72+
${ FileToInject = '.\Parent Directory\file.json', InjectAsJsonObject }
73+
```
74+
75+
### Recommendations
5876
Always inject the content in your ARM template as soon as possible, preferably during release build that creates the artifact

docs/versioned_docs/version-v0.1.3/02-Features/powershell/arm.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: " ARM templates"
2+
title: "ARM templates"
33
layout: default
44
---
55

@@ -28,7 +28,7 @@ By using this script, you can inject external files inside your ARM template.
2828
| --------- | --------- | ----------------------------------------------------------------------------------------------- |
2929
| `Path` | no | The file path to the ARM template to inject the external files into (default: `$PSScriptRoot`) |
3030

31-
**Usage**
31+
### Usage
3232
Annotating content to inject:
3333

3434
```json
@@ -54,5 +54,23 @@ Injecting the content:
5454
PS> Inject-ArmContent -Path deploy\arm-template.json
5555
```
5656

57-
**Recommendations**
57+
### Injection Instructions
58+
It is possible to supply injection instructions in the injection annotation, this allows you to add specific functionality to the injection. These are the available injection instructions:
59+
60+
| Injection Instruction | Description |
61+
| --------------------- | ----------------------------------------------------------------------------------------------------------- |
62+
| `EscapeJson` | Replace double quotes not preceded by a backslash with escaped quotes |
63+
| `ReplaceSpecialChars` | Replace newline characters with literal equivalents, tabs with spaces and `"` with `\"` |
64+
| `InjectAsJsonObject` | Tests if the content is valid JSON and makes sure the content is injected without surrounding double quotes |
65+
66+
Usage of multiple injection instructions is supported as well, for example if you need both the `EscapeJson` and `ReplaceSpecialChars` functionality.
67+
68+
Some examples are:
69+
```powershell
70+
${ FileToInject = ".\Parent Directory\file.xml" }
71+
${ FileToInject = ".\Parent Directory\file.xml", EscapeJson, ReplaceSpecialChars }
72+
${ FileToInject = '.\Parent Directory\file.json', InjectAsJsonObject }
73+
```
74+
75+
### Recommendations
5876
Always inject the content in your ARM template as soon as possible, preferably during release build that creates the artifact

docs/versioned_docs/version-v0.2/02-Features/powershell/arm.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: " ARM templates"
2+
title: "ARM templates"
33
layout: default
44
---
55

@@ -28,7 +28,7 @@ By using this script, you can inject external files inside your ARM template.
2828
| --------- | --------- | ----------------------------------------------------------------------------------------------- |
2929
| `Path` | no | The file path to the ARM template to inject the external files into (default: `$PSScriptRoot`) |
3030

31-
**Usage**
31+
### Usage
3232
Annotating content to inject:
3333

3434
```json
@@ -54,5 +54,23 @@ Injecting the content:
5454
PS> Inject-ArmContent -Path deploy\arm-template.json
5555
```
5656

57-
**Recommendations**
57+
### Injection Instructions
58+
It is possible to supply injection instructions in the injection annotation, this allows you to add specific functionality to the injection. These are the available injection instructions:
59+
60+
| Injection Instruction | Description |
61+
| --------------------- | ----------------------------------------------------------------------------------------------------------- |
62+
| `EscapeJson` | Replace double quotes not preceded by a backslash with escaped quotes |
63+
| `ReplaceSpecialChars` | Replace newline characters with literal equivalents, tabs with spaces and `"` with `\"` |
64+
| `InjectAsJsonObject` | Tests if the content is valid JSON and makes sure the content is injected without surrounding double quotes |
65+
66+
Usage of multiple injection instructions is supported as well, for example if you need both the `EscapeJson` and `ReplaceSpecialChars` functionality.
67+
68+
Some examples are:
69+
```powershell
70+
${ FileToInject = ".\Parent Directory\file.xml" }
71+
${ FileToInject = ".\Parent Directory\file.xml", EscapeJson, ReplaceSpecialChars }
72+
${ FileToInject = '.\Parent Directory\file.json', InjectAsJsonObject }
73+
```
74+
75+
### Recommendations
5876
Always inject the content in your ARM template as soon as possible, preferably during release build that creates the artifact

docs/versioned_docs/version-v0.3/02-Features/powershell/arm.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: " ARM templates"
2+
title: "ARM templates"
33
layout: default
44
---
55

@@ -28,7 +28,7 @@ By using this script, you can inject external files inside your ARM template.
2828
| --------- | --------- | ----------------------------------------------------------------------------------------------- |
2929
| `Path` | no | The file path to the ARM template to inject the external files into (default: `$PSScriptRoot`) |
3030

31-
**Usage**
31+
### Usage
3232
Annotating content to inject:
3333

3434
```json
@@ -54,5 +54,23 @@ Injecting the content:
5454
PS> Inject-ArmContent -Path deploy\arm-template.json
5555
```
5656

57-
**Recommendations**
57+
### Injection Instructions
58+
It is possible to supply injection instructions in the injection annotation, this allows you to add specific functionality to the injection. These are the available injection instructions:
59+
60+
| Injection Instruction | Description |
61+
| --------------------- | ----------------------------------------------------------------------------------------------------------- |
62+
| `EscapeJson` | Replace double quotes not preceded by a backslash with escaped quotes |
63+
| `ReplaceSpecialChars` | Replace newline characters with literal equivalents, tabs with spaces and `"` with `\"` |
64+
| `InjectAsJsonObject` | Tests if the content is valid JSON and makes sure the content is injected without surrounding double quotes |
65+
66+
Usage of multiple injection instructions is supported as well, for example if you need both the `EscapeJson` and `ReplaceSpecialChars` functionality.
67+
68+
Some examples are:
69+
```powershell
70+
${ FileToInject = ".\Parent Directory\file.xml" }
71+
${ FileToInject = ".\Parent Directory\file.xml", EscapeJson, ReplaceSpecialChars }
72+
${ FileToInject = '.\Parent Directory\file.json', InjectAsJsonObject }
73+
```
74+
75+
### Recommendations
5876
Always inject the content in your ARM template as soon as possible, preferably during release build that creates the artifact

docs/versioned_docs/version-v0.4.3/02-Features/powershell/arm.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: " ARM templates"
2+
title: "ARM templates"
33
layout: default
44
---
55

@@ -28,7 +28,7 @@ By using this script, you can inject external files inside your ARM template.
2828
| --------- | --------- | ----------------------------------------------------------------------------------------------- |
2929
| `Path` | no | The file path to the ARM template to inject the external files into (default: `$PSScriptRoot`) |
3030

31-
**Usage**
31+
### Usage
3232
Annotating content to inject:
3333

3434
```json
@@ -54,5 +54,23 @@ Injecting the content:
5454
PS> Inject-ArmContent -Path deploy\arm-template.json
5555
```
5656

57-
**Recommendations**
57+
### Injection Instructions
58+
It is possible to supply injection instructions in the injection annotation, this allows you to add specific functionality to the injection. These are the available injection instructions:
59+
60+
| Injection Instruction | Description |
61+
| --------------------- | ----------------------------------------------------------------------------------------------------------- |
62+
| `EscapeJson` | Replace double quotes not preceded by a backslash with escaped quotes |
63+
| `ReplaceSpecialChars` | Replace newline characters with literal equivalents, tabs with spaces and `"` with `\"` |
64+
| `InjectAsJsonObject` | Tests if the content is valid JSON and makes sure the content is injected without surrounding double quotes |
65+
66+
Usage of multiple injection instructions is supported as well, for example if you need both the `EscapeJson` and `ReplaceSpecialChars` functionality.
67+
68+
Some examples are:
69+
```powershell
70+
${ FileToInject = ".\Parent Directory\file.xml" }
71+
${ FileToInject = ".\Parent Directory\file.xml", EscapeJson, ReplaceSpecialChars }
72+
${ FileToInject = '.\Parent Directory\file.json', InjectAsJsonObject }
73+
```
74+
75+
### Recommendations
5876
Always inject the content in your ARM template as soon as possible, preferably during release build that creates the artifact

docs/versioned_docs/version-v0.4/02-Features/powershell/arm.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: " ARM templates"
2+
title: "ARM templates"
33
layout: default
44
---
55

@@ -28,7 +28,7 @@ By using this script, you can inject external files inside your ARM template.
2828
| --------- | --------- | ----------------------------------------------------------------------------------------------- |
2929
| `Path` | no | The file path to the ARM template to inject the external files into (default: `$PSScriptRoot`) |
3030

31-
**Usage**
31+
### Usage
3232
Annotating content to inject:
3333

3434
```json
@@ -54,5 +54,23 @@ Injecting the content:
5454
PS> Inject-ArmContent -Path deploy\arm-template.json
5555
```
5656

57-
**Recommendations**
57+
### Injection Instructions
58+
It is possible to supply injection instructions in the injection annotation, this allows you to add specific functionality to the injection. These are the available injection instructions:
59+
60+
| Injection Instruction | Description |
61+
| --------------------- | ----------------------------------------------------------------------------------------------------------- |
62+
| `EscapeJson` | Replace double quotes not preceded by a backslash with escaped quotes |
63+
| `ReplaceSpecialChars` | Replace newline characters with literal equivalents, tabs with spaces and `"` with `\"` |
64+
| `InjectAsJsonObject` | Tests if the content is valid JSON and makes sure the content is injected without surrounding double quotes |
65+
66+
Usage of multiple injection instructions is supported as well, for example if you need both the `EscapeJson` and `ReplaceSpecialChars` functionality.
67+
68+
Some examples are:
69+
```powershell
70+
${ FileToInject = ".\Parent Directory\file.xml" }
71+
${ FileToInject = ".\Parent Directory\file.xml", EscapeJson, ReplaceSpecialChars }
72+
${ FileToInject = '.\Parent Directory\file.json', InjectAsJsonObject }
73+
```
74+
75+
### Recommendations
5876
Always inject the content in your ARM template as soon as possible, preferably during release build that creates the artifact

docs/versioned_docs/version-v0.5/02-Features/powershell/arm.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ By using this script, you can inject external files inside your ARM template.
2828
| --------- | --------- | ----------------------------------------------------------------------------------------------- |
2929
| `Path` | no | The file path to the ARM template to inject the external files into (default: `$PSScriptRoot`) |
3030

31-
**Usage**
31+
### Usage
3232
Annotating content to inject:
3333

3434
```json
@@ -54,5 +54,23 @@ Injecting the content:
5454
PS> Inject-ArmContent -Path deploy\arm-template.json
5555
```
5656

57-
**Recommendations**
57+
### Injection Instructions
58+
It is possible to supply injection instructions in the injection annotation, this allows you to add specific functionality to the injection. These are the available injection instructions:
59+
60+
| Injection Instruction | Description |
61+
| --------------------- | ----------------------------------------------------------------------------------------------------------- |
62+
| `EscapeJson` | Replace double quotes not preceded by a backslash with escaped quotes |
63+
| `ReplaceSpecialChars` | Replace newline characters with literal equivalents, tabs with spaces and `"` with `\"` |
64+
| `InjectAsJsonObject` | Tests if the content is valid JSON and makes sure the content is injected without surrounding double quotes |
65+
66+
Usage of multiple injection instructions is supported as well, for example if you need both the `EscapeJson` and `ReplaceSpecialChars` functionality.
67+
68+
Some examples are:
69+
```powershell
70+
${ FileToInject = ".\Parent Directory\file.xml" }
71+
${ FileToInject = ".\Parent Directory\file.xml", EscapeJson, ReplaceSpecialChars }
72+
${ FileToInject = '.\Parent Directory\file.json', InjectAsJsonObject }
73+
```
74+
75+
### Recommendations
5876
Always inject the content in your ARM template as soon as possible, preferably during release build that creates the artifact

0 commit comments

Comments
 (0)