Skip to content

Commit

Permalink
Updating documentation with the note for changing the execution polic…
Browse files Browse the repository at this point in the history
…y if necessary
  • Loading branch information
Brunoga-MS committed Mar 14, 2024
1 parent bd2523a commit a273c04
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 16 deletions.
26 changes: 14 additions & 12 deletions docs/content/patterns/alz/Cleaning-up-a-Deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
10 changes: 6 additions & 4 deletions docs/content/patterns/alz/Moving-from-preview-to-GA.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
- To deploy with Azure PowerShell, please proceed with [Deploy with Azure PowerShell](../deploy/Deploy-with-Azure-PowerShell)
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 19 additions & 0 deletions docs/content/patterns/alz/deploy/PowerShell-ExecutionPolicy.md
Original file line number Diff line number Diff line change
@@ -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 >}}
3 changes: 3 additions & 0 deletions docs/content/patterns/alz/deploy/Remediate-Policies.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a273c04

Please sign in to comment.