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
CodePudding user response:
Please use Get-AzureRmResource instead of Find-AzureRmResource.
Find-AzureRmResource is depreacted.
Starting with version 6.0 of Azure PowerShell, Find-AzureRmResource have been removed and Get-AzureRmResource is supposed to be the workaround.
How to safely replace Find-AzureRmResource -ResourceType calls in Azure PowerShell 6.x
CodePudding user response:
Instead of using AzureRM
module, use Az
module as the former is now deprecated. To learn more about it, please see https://docs.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:
Get-AzResourceGroup | Remove-AzResourceGroup