- Remove the agent’s role assignments: in the Azure portal open the subscription or management group → Access control (IAM) → Role assignments, filter by the agent’s managed identity (
id-cloudlens-…) and remove its four reader roles. - Delete the resource group you created for the agent (for example
rg-cloudlens-agent). This removes the agent, its storage and history, and the AI model if you added one. - Delete the connection in CloudLens (Connections → the connection → Delete).
The key vault stays recoverable for 7 days (at no cost) before Azure removes it for good; to remove it at once, run az keyvault purge --name <vault name>. To close your CloudLens account entirely, an owner can delete the organization; everything CloudLens holds for it is removed.
Using Terraform? Run terraform destroy instead of steps 1 and 2.