Skip to content

Commit

Permalink
docs: publish v0.4.3 feature docs (#168)
Browse files Browse the repository at this point in the history
* Docs: prepare publish of v0.4.3 docs

* docs: correct small typo preventing proper visualisation of PowerShell-script

* docs: update v0.4.3 index to set correct version + link to powershell gallery
  • Loading branch information
mbraekman authored Apr 29, 2021
1 parent 31994af commit ac6a5b5
Show file tree
Hide file tree
Showing 16 changed files with 1,390 additions and 3 deletions.
19 changes: 19 additions & 0 deletions docs/features/powershell/azure-api-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This module provides the following capabilities:
- [Removing all Azure API Management defaults from the instance](#removing-all-azure-api-management-defaults-from-the-instance)
- [Restoring an API Management service](#restoring-an-api-management-service)
- [Setting authentication keys to an API in the Azure API Management instance](#setting-authentication-keys-to-an-api-in-the-azure-api-management-instance)
- [Uploading private certificates to the Azure API Management certificate store](#uploading-private-certificates-to-the-azure-api-management-certificate-store)

## Installation

Expand Down Expand Up @@ -201,3 +202,21 @@ Write-Host "Using API Management instance '$ServiceName' in resource group '$Res
Write-Host "Subscription key header 'my-api-key' was assigned"
Write-Host "Subscription key query parameter 'myApiKey' was assigned"
```

## Uploading private certificates to the Azure API Management certificate store
Uploads a private certificate to the Azure API Management certificate store, allowing authentication against backend services.

| Parameter | Mandatory | Description |
| --------------------- | --------- | --------------------------------------------------------------------------------------------- |
| `ResourceGroupName` | yes | The resource group containing the Azure API Management instance |
| `ServiceName` | yes | The name of the Azure API Management instance |
| `CertificateFilePath` | yes | The full file path to the location of the private certificate |
| `CertificatePassword` | yes | The password for the private certificate |

**Example**

```powershell
PS> Upload-AzApiManagementCertificate -ResourceGroupName "my-resource-group" -ServiceName "my-api-management-instance" -CertificateFilePath "c:\temp\certificate.pfx" -CertificatePassword "P@ssw0rd"
# Using API Management instance 'my-api-management-instance' in resource group 'my-resource-group'
# Uploaded private certificate at 'c:\temp\certificate.pfx'
```
6 changes: 3 additions & 3 deletions docs/features/powershell/azure-security.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ This function allows you to assign an Azure built-in role to a resource upon a r
**Usage**

```powershell
PS> New-AzResourceGroupRoleAssignment -TargetResourceGroupName "to-gain-access-resource-group" -ResourceGroupName "to-assign-role-resource-group" -ResourceName "to-assign-resource" -RoleDefinitionName "Contributer"
# Assigning Contributer-rights to the 'to-assign-role-resource' in the resource group 'to-assign-resource-group to gain access to the 'to-gain-access-resource-group'
# Contributer access granted!
PS> New-AzResourceGroupRoleAssignment -TargetResourceGroupName "to-gain-access-resource-group" -ResourceGroupName "to-assign-role-resource-group" -ResourceName "to-assign-resource" -RoleDefinitionName "Contributor"
# Assigning Contributor-rights to the 'to-assign-role-resource' in the resource group 'to-assign-resource-group' to gain access to the 'to-gain-access-resource-group'
# Contributor access granted!
```
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ For more granular packages we recommend reading the documentation.

# Older versions

- [v0.4](v0.4)
- [v0.3](v0.3)
- [v0.2](v0.2)
- [v0.1.3](v0.1.3)
Expand Down
58 changes: 58 additions & 0 deletions docs/v0.4.3/features/powershell/arm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: "Scripts related to ARM templates"
layout: default
---

# ARM

This module provides the following capabilities:
- [Injecting content into an ARM template](#injecting-content-into-an-arm-template)

## Installation

To have access to the following features, you have to import the module:

```powershell
PS> Install-Module -Name Arcus.Scripting.ARM
```

## Injecting content into an ARM template

In certain scenarios, you have to embed content into an ARM template to deploy it.

However, the downside of it is that it's buried inside the template and tooling around it might be less ideal - An example of this is OpenAPI specifications you'd want to deploy.

By using this script, you can inject external files inside your ARM template.

| Parameter | Mandatory | Description |
| --------- | --------- | ----------------------------------------------------------------------------------------------- |
| `Path` | no | The file path to the ARM template to inject the external files into (default: `$PSScriptRoot`) |

**Usage**
Annotating content to inject:

```json
{
"type": "Microsoft.ApiManagement/service/apis",
"name": "[concat(parameters('ApiManagement.Name'),'/', parameters('ApiManagement.Api.Name'))]",
"apiVersion": "2019-01-01",
"properties": {
"subscriptionRequired": true,
"path": "demo",
"value": "${ FileToInject='.\\..\\openapi\\api-sample.json', InjectAsJsonObject}$",
"format": "swagger-json"
},
"tags": "[variables('Tags')]",
"dependsOn": [
]
}
```

Injecting the content:

```powershell
PS> Inject-ArmContent -Path deploy\arm-template.json
```

**Recommendations**
Always inject the content in your ARM template as soon as possible, preferably during release build that creates the artifact
Loading

0 comments on commit ac6a5b5

Please sign in to comment.