Thanks for getting in touch! This is a great question, and I appreciate your suggestion. Unfortunately it isn’t possible to automatically delete any release/runbook snapshots that reference the account when deleting it in the UI. The easiest option currently might be to query the accounts/usages API, iterating through the snapshot IDs and deleting each of those returned via something similar to this sample script (though this would need to be tweaked to match your needs as this deletes all releases in a single project).
I’ve previously suggested an enhancement to have an “archive” option for accounts to prevent it from being selectable in new releases, like how we currently do for certificates, though there hasn’t yet been any movement on it. Would something like that be ideal for your case?
What would be ideal would be to be able to delete/archive the account and have it mark the associated Releases and Snapshots as “Information Only”. Meaning that they can no longer be deployed/run.
Basically, the system behind this account is no longer supported. The idea is that running it will fail anyway.
I would prefer to not have to delete all these releases and snapshots as they provide useful historical information (dates of deployment, Release creation time etc). But the current system requires it in order to delete the account. (I have to throw out 62 things, just to get rid of one thing.)
For now I have renamed the account to “To Delete” and the description explains how Octopus will not allow its deletion. I also changed it so it will not be used in any deployments.
Thanks for following up and for detailing your use case. I agree, I think these are completely valid points, and I’ll forward them to our feature team for consideration.
For the time being, I imagine what you have already done to make it clear the account is marked as to be deleted via a rename and preventing its use is the best option to ensure release and snapshot history is retained.
I greatly appreciate your suggestion on how we can improve Octopus, and please don’t hesitate to reach out with any other questions or concerns going forward.