I am trying to nuke an azure subscription and I found this
https://www.frankysnotes.com/2016/12/need-to-nuke-azure-subscription.html
As I run the final part I got an error of
"Find-AzureRmResource : The term ‘Find-AzureRmResource’ is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again."
Can someone help me how to fix this so I can nuke my Azure subscription?
2
Answers
Please use Get-AzureRmResource instead of Find-AzureRmResource.
Find-AzureRmResource is depreacted.
How to safely replace Find-AzureRmResource -ResourceType calls in Azure PowerShell 6.x+
Instead of using
AzureRM
module, useAz
module as the former is now deprecated. To learn more about it, please see https://learn.microsoft.com/en-us/powershell/azure/migrate-from-azurerm-to-az?view=azps-7.5.0.Simplest code to delete all resources from a subscription would be to list resource groups in that subscription and then delete them.
Your code would be something like: