From a273c0456fe3cccfe750279078216a98dea34d9e Mon Sep 17 00:00:00 2001 From: Brunoga-MS Date: Thu, 14 Mar 2024 11:48:56 +0100 Subject: [PATCH] Updating documentation with the note for changing the execution policy if necessary --- .../patterns/alz/Cleaning-up-a-Deployment.md | 26 ++++++++++--------- .../patterns/alz/Moving-from-preview-to-GA.md | 10 ++++--- .../Update_from_release_2023-11-14.md | 2 ++ .../alz/deploy/PowerShell-ExecutionPolicy.md | 19 ++++++++++++++ .../patterns/alz/deploy/Remediate-Policies.md | 3 +++ 5 files changed, 44 insertions(+), 16 deletions(-) create mode 100644 docs/content/patterns/alz/deploy/PowerShell-ExecutionPolicy.md diff --git a/docs/content/patterns/alz/Cleaning-up-a-Deployment.md b/docs/content/patterns/alz/Cleaning-up-a-Deployment.md index 01d88d369..92085a939 100644 --- a/docs/content/patterns/alz/Cleaning-up-a-Deployment.md +++ b/docs/content/patterns/alz/Cleaning-up-a-Deployment.md @@ -46,20 +46,22 @@ Follow the instructions below to download the cleanup script file. Alternatively 5. Sign in to the Azure with the `Connect-AzAccount` command. The account you sign in as needs to have permissions to remove Policy Assignments, Policy Definitions, and resources at the desired Management Group scope. 6. Execute the script using one of the options below: -**Generate a list of the resource IDs which would be deleted by this script:** + {{% include "PowerShell-ExecutionPolicy.md" %}} - ```powershell - ./Start-AMBACleanup.ps1 -pseudoRootManagementGroup $pseudoRootManagementGroup -ReportOnly - ``` + **Generate a list of the resource IDs which would be deleted by this script:** -**Show output of what would happen if deletes executed:** + ```powershell + ./Start-AMBACleanup.ps1 -pseudoRootManagementGroup $pseudoRootManagementGroup -ReportOnly + ``` - ```powershell - ./Start-AMBACleanup.ps1 -pseudoRootManagementGroup $pseudoRootManagementGroup -WhatIf - ``` + **Show output of what would happen if deletes executed:** -**Delete all resources deployed by the ALZ-Monitor IaC without prompting for confirmation:** + ```powershell + ./Start-AMBACleanup.ps1 -pseudoRootManagementGroup $pseudoRootManagementGroup -WhatIf + ``` - ```powershell - ./Start-AMBACleanup.ps1 -pseudoRootManagementGroup $pseudoRootManagementGroup -Force - ``` + **Delete all resources deployed by the ALZ-Monitor IaC without prompting for confirmation:** + + ```powershell + ./Start-AMBACleanup.ps1 -pseudoRootManagementGroup $pseudoRootManagementGroup -Force + ``` diff --git a/docs/content/patterns/alz/Moving-from-preview-to-GA.md b/docs/content/patterns/alz/Moving-from-preview-to-GA.md index 0b2a8c1c3..5ba3ac794 100644 --- a/docs/content/patterns/alz/Moving-from-preview-to-GA.md +++ b/docs/content/patterns/alz/Moving-from-preview-to-GA.md @@ -40,19 +40,21 @@ Follow the instructions below to download the cleanup script file. Alternatively 4. Sign in to the Azure with the `Connect-AzAccount` command. The account you sign in as needs to have permissions to remove Policy Assignments, Policy Definitions, and resources at the desired Management Group scope. 5. Execute the script using the option below -**Generate a list of the resource IDs which would be deleted by this script:** + {{% include "PowerShell-ExecutionPolicy.md" %}} + + **Generate a list of the resource IDs which would be deleted by this script:** ```powershell ./Start-ALZMonitorCleanup.ps1 -ReportOnly ``` -**Show output of what would happen if deletes executed:** + **Show output of what would happen if deletes executed:** ```powershell ./Start-ALZMonitorCleanup.ps1 -WhatIf ``` -**Delete all resources deployed by the ALZ-Monitor IaC without prompting for confirmation:** + **Delete all resources deployed by the ALZ-Monitor IaC without prompting for confirmation:** ```powershell ./Start-ALZMonitorCleanup.ps1 -Force @@ -64,4 +66,4 @@ Follow the instructions below to download the cleanup script file. Alternatively - To deploy with GitHub Actions, please proceed with [Deploy with GitHub Actions](../deploy/Deploy-with-GitHub-Actions) - To deploy with Azure DevOps Pipelines, please proceed with [Deploy with Azure Pipelines](../deploy/Deploy-with-Azure-Pipelines) - To deploy with Azure CLI, please proceed with [Deploy with Azure CLI](../deploy/Deploy-with-Azure-CLI) -- To deploy with Azure PowerShell, please proceed with [Deploy with Azure PowerShell](../deploy/Deploy-with-Azure-PowerShell) \ No newline at end of file +- To deploy with Azure PowerShell, please proceed with [Deploy with Azure PowerShell](../deploy/Deploy-with-Azure-PowerShell) diff --git a/docs/content/patterns/alz/UpdateToNewReleases/Update_from_release_2023-11-14.md b/docs/content/patterns/alz/UpdateToNewReleases/Update_from_release_2023-11-14.md index 8a27e1ba8..2d129076d 100644 --- a/docs/content/patterns/alz/UpdateToNewReleases/Update_from_release_2023-11-14.md +++ b/docs/content/patterns/alz/UpdateToNewReleases/Update_from_release_2023-11-14.md @@ -23,6 +23,8 @@ Updating from release 2023-11-14 will require running a post update script to re 2. Execute the script using one of the options below: + {{% include "PowerShell-ExecutionPolicy.md" %}} + **Generate a list of the resource IDs which would be deleted by this script:** ```powershell diff --git a/docs/content/patterns/alz/deploy/PowerShell-ExecutionPolicy.md b/docs/content/patterns/alz/deploy/PowerShell-ExecutionPolicy.md new file mode 100644 index 000000000..b106cdc1e --- /dev/null +++ b/docs/content/patterns/alz/deploy/PowerShell-ExecutionPolicy.md @@ -0,0 +1,19 @@ +--- +--- + +{{< hint type=Important >}} +Since PowerShell scripts released as part of the ALZ pattern are not digitally signed they might require you to _**temporarily**_ change the execution policy if not already set to _**Unrestricted**_. Before running the script, check the execution policy settings using this command: + +```PowerShell +Get-ExecutionPolicy +``` + +If the result is everything but _**Unrestricted**_, run the following command to change it to **Unrestricted** + +```PowerShell +Set-ExecutionPolicy -ExecutionPolicy Unrestricted +``` + +At this point, you should be able to run your scripts with no issues. After you finished, you can set the execution policy back to what it was if you like to do so. + +{{< /hint >}} diff --git a/docs/content/patterns/alz/deploy/Remediate-Policies.md b/docs/content/patterns/alz/deploy/Remediate-Policies.md index b48a30a6e..9ccde9a35 100644 --- a/docs/content/patterns/alz/deploy/Remediate-Policies.md +++ b/docs/content/patterns/alz/deploy/Remediate-Policies.md @@ -20,6 +20,9 @@ To use the script, do the following: - Navigate to the root of the cloned repo - Set the variables - Run the remediation script + + {{% include "PowerShell-ExecutionPolicy.md" %}} + - For example, to remediate **Alerting-Management** initiative, assigned to the **alz-platform-management** Management Group run the following commands: ```powershell