When we use TFS for a Git repository and I configure a webhook from the Azure UI using "Perform this action": "Trigger git build" and "Integration level":"Built-in Jenkins API" the hook received trigger the build but it doesn't use any of the additional behaviors defined like the exclude regions.
Using polling it works without any issue.
I have been reviewed deeply the issue and the hook received on the Jenkins side looks like that one:
Received notification from xx.xxx.xxx.xxx → xx.xx.x.xxx → xx.xxx.xxx.xxx ⇒ https://jenkins-url/git/notifyCommit for uri = https://dev.azure.com/repo/test/_git/test ; sha1 = 71c8xxxxxxx5xxx9x54fxxxxxx96cxb53x78 ; branches = [master]
If the git plugin receives a sha1 parameter it just launches the build related to that SHA1 without checking anything, so probably the error is on the webhook side that is sending an incorrect hook, though the git plugin should reasonably not be accepting a SHA1 argument without applying the usual checks to decide if that SHA1 should be built.