How to delete orphaned webhook from an Azure automation account

SteveG 116 Reputation points
2021-02-23T12:51:33.88+00:00

Hi everyone, Simple question. How do I delete an orphaned webhook using the Azure portal? There doesn't seem to be a way to list all webhooks or delete them using the portal. I just deleted a PowerShell runbook that had a webhook attached to it. I expected that the webhook would be deleted automatically at the same time as the runbook, but when I try to create a new webhook in the automation account using the same webhook name it says that a webhook with that name already exists. Thanks for the help, Steve G

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,366 questions
0 comments No comments
{count} votes

Accepted answer
  1. SteveG 116 Reputation points
    2021-02-23T15:48:56.523+00:00

    Hi amon-2590,

    Thanks for the information about the Azure Resource Explorer. I had no idea that this thing existed. It may well prove useful in the future.

    However, there doesn't seem to be a facility to delete a webhook through the explorer. When I expand the webhooks node the Data (GET, PUT) tab on the right shows json script for the two existing webhooks, including for the runbook that I deleted. The Actions (POST,DELETE) tab only shows a single generateUri button with a POST which I presume returns the uri to call the webhook (see attached image). I note that this is a product in preview, so is it possible that functionality to delete a webhook hasn't been implemented yet?

    I have also explored the runbooks node, but the runbook that I previously deleted was not listed, not even just a place holder or other remnants.

    However, your post did give me another idea. I used the portal to re-create the runbook that I had previously deleted and magically the webhook re-attached itself. So I opened the blade for the webhook and successfully deleted via the Delete button.

    Thanks for the help,

    SteveG

    71242-azureresourceexplorer-webhooknode.png

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. amon 126 Reputation points Microsoft Employee
    2021-02-23T15:06:20.697+00:00

    You will be able to delete it via resources.azure.com
    Subscription Name -> Resource Group -> Providers -> Automation (see attached image)
    I suspect you will see the web hook here under the "web hook" category, but you will probably also see some remnants of the runbook under the "runbook" category.

    * PLEASE BE CAREFUL *
    Anything you delete here can have consequences...

    You can read more about the Azure resource manager in this really nice blog post

    71155-delete-web-hook.png

    0 comments No comments

  2. Larry Silverman 27 Reputation points
    2022-12-15T22:23:03.173+00:00

    I found today that you cannot delete WebHooks in the Azure Resource Explorer. There's no Edit button.

    The Remove-AzAutomationWebhook PowerShell command does work, however, for deleting orphaned webhooks.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.