Azure-Functions icon indicating copy to clipboard operation
Azure-Functions copied to clipboard

Continuous integration - webhooks dissapear

Open frli opened this issue 9 years ago • 10 comments

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 👍

frli avatar Sep 07 '17 07:09 frli

@davidebbo any ideas on this? What flows can result in deleted webhooks on the github side?

paulbatum avatar Sep 07 '17 16:09 paulbatum

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 avatar Sep 07 '17 16:09 davidebbo

@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 avatar Sep 07 '17 17:09 frli

@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 avatar Sep 07 '17 19:09 davidebbo

@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

frli avatar Sep 07 '17 20:09 frli

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

davidebbo avatar Sep 07 '17 20:09 davidebbo

Yes, that is the root clause. The fix should be rolled out completely by the end of the month (9/30/2017).

suwatch avatar Sep 07 '17 22:09 suwatch

Sweet, thanks! 👍👏👌

frli avatar Sep 08 '17 06:09 frli

Hi again, was this issue resolved as planned at the end of september? Asking before diving back into the settings 😄

frli avatar Oct 16 '17 20:10 frli

Yes. If this happens again please reopen and let us know.

paulbatum avatar Oct 16 '17 23:10 paulbatum