{"id":21501002,"url":"https://github.com/tksh164/aprl-helper-scripts","last_synced_at":"2025-03-17T13:26:13.086Z","repository":{"id":211819669,"uuid":"729532396","full_name":"tksh164/aprl-helper-scripts","owner":"tksh164","description":"The helper scripts to utilize the Azure Proactive Resiliency Library (APRL). The scripts allow batch execution of the APRL's queries.","archived":false,"fork":false,"pushed_at":"2024-01-13T12:29:59.000Z","size":1295,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-23T23:13:51.139Z","etag":null,"topics":["aprl","azure","powershell","resiliency","scripts","tools"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tksh164.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-09T14:28:09.000Z","updated_at":"2024-01-20T19:35:58.000Z","dependencies_parsed_at":"2024-01-12T18:24:39.180Z","dependency_job_id":null,"html_url":"https://github.com/tksh164/aprl-helper-scripts","commit_stats":null,"previous_names":["tksh164/aprl-helper-scripts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tksh164%2Faprl-helper-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tksh164%2Faprl-helper-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tksh164%2Faprl-helper-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tksh164%2Faprl-helper-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tksh164","download_url":"https://codeload.github.com/tksh164/aprl-helper-scripts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244039727,"owners_count":20387938,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aprl","azure","powershell","resiliency","scripts","tools"],"created_at":"2024-11-23T17:48:46.692Z","updated_at":"2025-03-17T13:26:13.062Z","avatar_url":"https://github.com/tksh164.png","language":"PowerShell","readme":"# APRL helper scripts\n\nThe helper scripts to utilize the [Azure Proactive Resiliency Library (APRL)](https://github.com/Azure/Azure-Proactive-Resiliency-Library). The scripts allow batch execution of the APRL's queries and PowerShell scripts.\n\n## Helper scripts\n\nThree helper scripts have different purposes.\n\n- **getaprl.ps1**: Downloads the APRL contents from the [APRL GitHub repository](https://github.com/Azure/Azure-Proactive-Resiliency-Library). After downloading, this script extracts Azure Resource Graph (ARG) queries and PowerShell scripts, also stores it into the `queries` folder in the current directory. The `queries` folder will be created if it does not exist.\n\n- **runaprl.ps1**: Executes the downloaded ARG queries and PowerShell scripts in the `queries` folder against your Azure subscription.\n\n    - You must have completed [Connect-AzAccount](https://learn.microsoft.com/en-us/powershell/module/az.accounts/connect-azaccount) and [Set-AzContext](https://learn.microsoft.com/en-us/powershell/module/az.accounts/set-azcontext) correctly before run this script.\n    \n    - This script requires [Az.ResourceGraph](https://www.powershellgallery.com/packages/Az.ResourceGraph), [Az.Accounts](https://www.powershellgallery.com/packages/Az.Accounts) and [Az.Resources](https://www.powershellgallery.com/packages/Az.Resources) modules. You can install those modules by the following command if you have not installed these modules.\n\n        ```powershell\n        Install-Module -Name 'Az.ResourceGraph', 'Az.Accounts', 'Az.Resources' -Repository 'PSGallery' -Scope AllUsers -Force\n        ```\n\n- **saveascsv.ps1**: Saves the outputs from `runaprl.ps1` as a CSV file. This is a script for convenience to save the output into a CSV file. The default output file path is `./results.csv`.\n\n## Prerequisites\n\n- One of the following PowerShell.\n    - [Latest PowerShell](https://github.com/PowerShell/PowerShell) (Recommended)\n    - Windows PowerShell 5.1\n- The scripts tested on Windows, but the scripts may be run on other platforms as well. Feedback is welcome.\n\n## Quick start\n\n1. Download the APRL's contents onto your local filesystem. After running the following command, the APRL's ARG queries \u0026 PowerShell scripts are stored in the `queries` folder in the current directory.\n\n    ```powershell\n    PS C:\\aprl\u003e .\\getaprl.ps1\n    ```\n\n2. Execute the APRL's ARG queries \u0026 PowerShell scripts in the `queries` folder, and save the result to the `./results.csv` file.\n\n    ```powershell\n    PS C:\\aprl\u003e .\\runaprl.ps1 | .\\saveascsv.ps1\n    ```\n\n## Usage examples\n\n### getaprl.ps1\n\n- **Example 1:** Download the APRL's contents onto your local filesystem.\n\n    ```powershell\n    PS C:\\aprl\u003e .\\getaprl.ps1\n    ```\n\n### runaprl.ps1 and saveascsv.ps1\n\n- **Example 1:** Execute the APRL's ARG queries and PowerShell scripts without saving the result to a file.\n\n    ```powershell\n    PS C:\\aprl\u003e .\\runaprl.ps1\n    ```\n\n- **Example 2:** Execute the APRL's ARG queries and PowerShell scripts, then save the result to a CSV file using the standard PowerShell cmdlets.\n\n    ```powershell\n    PS C:\\aprl\u003e .\\runaprl.ps1 | ConvertTo-Csv -NoTypeInformation | Out-File -LiteralPath './results.csv' -Encoding utf8 -Force\n    ```\n\n- **Example 3:** Execute the APRL's ARG queries and PowerShell scripts, then save the result to a CSV file using the `saveascsv.ps1` script. The `saveascsv.ps1` script is convenient (less typing) than use standard PowerShell cmdlets. \n\n    ```powershell\n    PS C:\\aprl\u003e .\\runaprl.ps1 | .\\saveascsv.ps1\n    ```\n\n- **Example 4:** Execute the APRL's ARG queries and PowerShell scripts, then showing the result in a grid view. This is convenient for interacting with the results using UI, or copy and paste to Excel, etc.\n\n    ```powershell\n    PS C:\\aprl\u003e .\\runaprl.ps1 | Out-GridView\n    ```\n\n    ![](docs/media/runaprl-gridview.gif)\n\n    **NOTE:** The [Out-GridView](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/out-gridview) cmdlet available on Windows Desktop only. A similar cmdlet for cross-platform version is provided by the [ConsoleGuiTools](https://www.powershellgallery.com/packages/Microsoft.PowerShell.ConsoleGuiTools) module in the PowerShell Gallery.\n\n## License\n\nCopyright (c) 2023-present Takeshi Katano. All rights reserved. This software is released under the [MIT License](https://github.com/tksh164/aprl-helper-scripts/blob/main/LICENSE).\n\nDisclaimer: The codes stored herein are my own personal codes and do not related my employer's any way.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftksh164%2Faprl-helper-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftksh164%2Faprl-helper-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftksh164%2Faprl-helper-scripts/lists"}