2

I have created a new Team Project in Visual Team Services with Git as the repository. On this repository I have checked-in a Java project and implemented continuous integration and deployment using Jenkins.

The Jenkins instance is present on an Azure VM created using Azure RM. I have configured polling in the Jenkins build and the build is getting triggered whenever a code change happens to the Java project.

So now our requirement is to use VSTS service hooks instead of polling. So we have created a Jenkins service hook which is configured to call the Jenkins build whenever code gets pushed. Though the Jenkins connectivity is successful, it is not able to call the Jenkins jobs.

It is throwing an error saying "No valid crumb was included in the request (403)". The wizard doesn't allow you to customize the HTTP post request. Is this a product issue or do we need to make any configuration changes to Jenkins instance?

Image 1

Image 2

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131

1 Answers1

0

As answer in Jenkins REST API Create job suggests, the issue is probably caused by CSRF Protection which is enabled by default.

According to this blog article published on 18 Aug 2016 “Jenkins Queue Job” task handles this correctly. Try using that.

The “Jenkins Queue Job” task was initially introduced in July, 2016. The task now has support for parameterized Jenkins jobs and tracks full Jenkins pipelines. It also now supports self-signed server certificates and Jenkins crumb security for protection against cross-site request forgery (CSRF) exploits.

Community
  • 1
  • 1
Devstr
  • 4,431
  • 1
  • 18
  • 30
  • This is better covered in *[Trigger build via URL gives me no crumb included in request error](https://stackoverflow.com/questions/40884446/trigger-build-via-url-gives-me-no-crumb-included-in-request-error/45396361#45396361)*. – Peter Mortensen Jul 18 '18 at 14:21