Skip to content

Commit

Permalink
readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanSebranek committed Jun 11, 2024
1 parent 4aaec4b commit aa727a3
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 6 deletions.
Binary file added images/Definitions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Source.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 56 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@ Integrate this extension into your pipeline and let it take care of everything f

## How does it all work?

The logic of this extension is based on a predefined directory structure where you store individual items you want to synchronize with Azure Automation. To obtain this directory structure, a PowerShell script called InitializeRepository is used, which, among other things, creates an example in each directory of how the definition of each item to be synchronized should look. The only mandatory input for this script is the directory where the predefined structure should be created. This script creates a directory structure divided into Definitions and Source. Individual environments are defined in the Source directory (for example: UAT, Production,..Note: if you do not use an environment, use the Common directory). The definition is the same for all environments in the Source directory. Simply put, in Definitions we determine the definitions and bindings of individual objects, and in Source we store common objects that we want to synchronize with the storage account.
The logic of this extension is based on a predefined directory structure where you store individual items you want to synchronize with Azure Automation. To obtain this directory structure, a PowerShell script called InitializeRepository is used, which, among other things, creates an example in each directory of how the definition of each item to be synchronized should look. The only mandatory input for this script is the directory where the predefined structure should be created. This script creates a directory structure divided into Definitions and Source. Individual environments are defined in the Source directory (for example: UAT, Production,..Note: if you do not use an environment, use the Common directory). The definition is the same for all environments in the Source directory. Simply put, in Definitions you specify the definition and bindings of individual objects, and in Source you store common objects to be synchronized with the storage account.

For example, in the Definitions in directory Runbooks, a test.json file can be created with the following definitions:
Let's demonstrate this with the following example:

## Definitions

Following image demonstrates how the definition directory structure looks like:
![Definitions directory tree example](images/Definitions.png)

Example of runbook file named <strong>test.json</strong>

```json
{
Expand All @@ -24,9 +31,54 @@ For example, in the Definitions in directory Runbooks, a test.json file can be c
}
```

...this means that the Manage-AutomationAccount devOps task will look for a file called test.ps1 in the Source directory (according to the defined environment, note: Common is the default) and upload it to the appropriate storage account.
Example of schedule file named <strong>Minutes-15.json</strong>

```json
{
"Name": "Minutes-15",
"StartTime": "00:00:00",
"Interval": 15,
"Frequency": "Minute",
"MonthDays": [],
"WeekDays": [],
"Description": "Schedule starting every 15 minutes",
"Disabled": false
}
```

Example of jobSchedule file named <strong>test.json</strong>

```json
{
"RunbookName": "test",
"ScheduleName": "Minutes-15",
"Settings": "Default-Parameters.json"
}
```
Note: Setting refers to the detail (parameters) of schedules of a specific runbook. In this bow in Source in file Default-Parameters.json the parameters are defined.

## Source

Following image demonstrates how the source directory structure looks like:
![Source directory tree example](images/Source.png)

Example of runbook file named <strong>test.ps1</strong>

```powershell
Write-Host "This is production pwsh script..."
```

Example of jobSchedule file named <strong>Default-Parameters.json</strong>

```json
{
"RunOn": "azure",
"Parameters": {"parameterTest":"test2"}
}
```


The Manage-automationAccount DevOps extension consists of two main parts:
### The Manage-automationAccount DevOps extension consists of two main parts:
1. manage-automationAccount - With this part, you can synchronize items such as Runbooks, Variables, Configurations, Schedules, Modules, and Job Schedules.
2. manage-automationWebHooks - Use this part even if you use WebHooks to trigger some Runbooks.

Expand Down
4 changes: 2 additions & 2 deletions vss-extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"manifestVersion": 1,
"id": "Manage-AutomationAccount",
"name": "Manage-AutomationAccount",
"version": "1.9.113",
"version": "1.9.114",
"publisher": "GreyCorbelSolutions",
"targets": [
{
"id": "Microsoft.VisualStudio.Services"
}
],
"isDevelopment": "true",
"isDevelopment": "false",
"description": "Set of tasks that allows management of automation account (runbooks, modules, variables, schedules and their links to runbooks, webhooks for runbooks and Dsc configurations from Azure DevOps pipeline.",
"categories": [
"Azure Pipelines"
Expand Down

0 comments on commit aa727a3

Please sign in to comment.