Want to delete unused Accounts

rjhansen's Avatar


01 Feb, 2018 01:08 AM

We're doing some cleanup and we're seeing some accounts in the accounts page (as in Azure Subscriptions, SSH Key Pairs, and Usernames/Passwords). We have some accounts showing up here of the Username/Passwords type that we want to delete. How do we verify that they're not being used anywhere? The accounts were added a long time ago and we now have LOTS of projects and environments. We don't think we're using them anywhere but we want to know for sure. I'm hoping you can provide us with a SQL query that can locate what Octopus item/feature is using the accounts. Thanks.

  1. Support Staff 1 Posted by Ben Pearce on 02 Feb, 2018 01:19 AM

    Ben Pearce's Avatar


    Thanks for getting in touch.

    First of all, you cannot delete an account if it is in use either within a projects deployment process, or the deployment process from a release of a project.

    It is currently possible to get this information using the API /api/accounts/{id}/usages. The Id is the one in the database, which you can also get from the URL when you navigate to that Account in the Web Portal. E.g /infrastructure/accounts/azureserviceprincipal-azure - the last part of the url is the Account Id.

    You can also access the API via the Swagger UI.

    Hope this helps you clean up your old accounts.


  2. 2 Posted by rjhansen on 02 Feb, 2018 06:44 PM

    rjhansen's Avatar

    That does help, thanks!

  3. Support Staff 3 Posted by Ben Pearce on 03 Feb, 2018 05:04 AM

    Ben Pearce's Avatar


    I forgot to mention that the Account Usages will be available on the Account page in a upcoming release shortly, most likely 2018.3.


Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac