Script to clean up ARM deployment logs
Перейти к файлу
Brian Moore 909011221f
Update README.md
2021-04-13 16:23:22 -05:00
LICENSE Initial LICENSE commit 2021-03-03 09:47:53 -08:00
README.md Update README.md 2021-04-13 16:23:22 -05:00
Remove-DebugDeployments.ps1 whatIf enabled by default 2021-03-06 10:46:24 +05:30
SECURITY.md Initial SECURITY.md commit 2021-03-03 09:47:56 -08:00
SUPPORT.md Update SUPPORT.md 2021-03-03 23:21:04 +05:30

README.md

ARM debug deployment clean up script

This script will iterate though all ARM deployments and will clean up those deployments where debugSetting is enabled. It will scan deployments at following scopes:

  • Management groups
  • Subscriptions
  • Resource groups

Note: The user running the script must have permission to delete deployments at each scope. If the user does not have permission to read deployments none will be returned or deleted.

Pre-requisites

Windows Users -

Linux Users -

Usage

Use Connect-AzConnect on powershell to connect to your respective tenant/cloud first (https://docs.microsoft.com/en-us/azure/azure-government/documentation-government-get-started-connect-with-ps). Then run this script via powershell. Note: The script will not delete the deployments unless -ForceDelete switch is passed.

Windows users:

  • Open powershell,
  • Connect to azure with Connect-AzConnect,
  • Execute this script PS C:\> ./Remove-DebugDeployments.ps1 (deployments with debug logs will be displayed but not deleted).
  • Execute with the switch PS C:\> ./Remove-DebugDeployments.ps1 -ForceDelete (deployments with debug logs will be deleted).

Linux users:

  • Open powershell with pwsh command on Terminal,
  • Connect to azure with Connect-AzConnect,
  • Execute this script PS ./Remove-DebugDeployments.ps1 (deployments with debug logs will be displayed but not deleted).
  • Execute with the switch PS ./Remove-DebugDeployments.ps1 -ForceDelete (deployments with debug logs will be deleted).