Continuous integration - webhooks dissapear
I'm not sure if this is the right place to file this issue. Apologies if this is the wrong place.
Background
We have two azure functions (dev and prod, built with Visual Studio 2017 tooling) configured to build from the same Github repo.
One function is configured to pull from the dev branch and the other from the masterbranch.
Inspecting https://github.com/[YOUR-ORG]/[YOUR-REPO]/settings/hooks shows two outgoing webhooks pointing at https://your-function-dev.scm.azurewebsites.net/deploy (push) and https://your-function-prod.scm.azurewebsites.net/deploy (push).
Problem One or both outgoing webhook from Github dissapear resulting in no builds occurring and nothing being deployed.
Inspecting the Github organisations audit log at https://github.com/organizations/[YOUR-ORG]/settings/audit-log shows my name for a hook.destroy operation although this is not something I have done manually (knowingly) either trough portal.azure.com nor github.com.
The first time this happened I assumed that I had made mistake but we've run into this issue 4 or 5 times now. There's still a chance that I'm somehow making the same mistake over and over but I have a hard time seeing it. I'm not purposely pressing the disconnect button 😄 .
Workaround
Disconnect and reconnect with Github under Deployment options on the Function blade in portal.azure.com.
Warning: This action appears to also clear outgoing webhooks from KUDU which in our case triggers API testing via Runscope post deploy. Not sure why these are cleared and it would be great if they weren't.
Don't forget Azure functions are awesome 👍
@davidebbo any ideas on this? What flows can result in deleted webhooks on the github side?
That is puzzling. @frli If you share the Function App Name (can be done indirectly if you like) and the UTC time where GitHub says the hook removal happened, we can take a look on our end.
@davidebbo
hook.destroy @ 2017-09-07T08:46:21Z
Function app names: bygma-api-function-prod and bygma-api-function-dev
Thanks for looking into this! 😄
@frli I'm not seeing any signs of API calls that would cause this. The closest thing is that at 2017-09-07 08:38:42, bygma-api-function-prod was restarted. But that was 8 minutes before, and a restart should be harmless.
What does the GitHub audit log show about the identity that called hook.delete?
And you've seen that happen multiple times? It would be interesting to try to correlate it with certain actions happening at that time. Right now this is a mystery to me.
@davidebbo The audit log shows my identity as the actor for the hook.destroy operation.
Other occurrences: 2017-09-01T17:12:34Z 2017-09-01T12:48:26Z 2017-09-01T03:46:59Z (pretty sure I was in bed for this one) 2017-08-24T14:25:20Z 2017-08-21T10:20:24Z
Ok, looking at this deeper, we think we may know what's going on, and it is our bug. It relates to Function Apps with lots of traffic scaling out to multiple scale units and then scaling back down, and there is some incorrect logic here.
/cc @suwatch
Yes, that is the root clause. The fix should be rolled out completely by the end of the month (9/30/2017).
Sweet, thanks! 👍👏👌
Hi again, was this issue resolved as planned at the end of september? Asking before diving back into the settings 😄
Yes. If this happens again please reopen and let us know.