How can I delete an account without a TON of work?

So, I am changing up how I do my deployments. I am collapsing from two accounts to just one. So I need to delete one of the accounts.

When I go to delete it, I cannot.

This is because past deployments have used the account:

The only way I know how to fix this is to go into each of these releases and runbook snapshots and delete them.

With a total of 62 releases/runbook snapshots, that takes a while. Additionally, this is not the only account I need to delete.

Please tell me there is a faster way to remove this account!

Hi @OctopusSchaff,

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?

Best regards,

Kenny

That would help.

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.

But it looks ugly.

Hi @OctopusSchaff,

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.

Best regards,

Kenny

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.