Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

156
Views
How to trigger Azure Devops release pipeline using jquery

I am trying to trigger Azure DevOps release pipeline using jquery with ajax but I am getting Internal server error in console log.

Below is my code.

Thanks in advance

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Ajax Api call by jQuery</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script>
      $(document).ready(function() {
      var vstsAuthHeader = { "Authorization": "Basic " + btoa("" + ":" + "jmmkdq6p5bndf7jygkepdsh5zzpvzobhhsivvqf2fpafrgur5quq") }
 var password="jmmkdq6p5bndf7jygkepdsh5zzpvzobhhsivvqf2fpafrgur5quq"
        $.ajax({
          url: "https://vsrm.dev.azure.com/{OrganizationName}/{ProjectName}/_apis/release/releases?api-version=6.0-preview.8",
          headers: {
              "Authorization": vstsAuthHeader
            },
            data: { 
                "definition" : {
                      "id" : 13
                },
                "variables" : {
                "var1" : "contosonew",
                "rgname"   : "test",
                "location" : "eastus" 
                },
            },
          type: "POST",
          dataType: "json",
         
          
          success: function (data) {
               alert('Success !');
               console.log(data)                
            },
            async: false,
           error: function(data) {
                console.log(data);
            }
        });
      });
    </script>
  </head>
  <body></body>
</html>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

this works for me

THIS

var vstsAuthHeader = { "Authorization": "Basic " + btoa("" + ":" + "jmmkdq6p5bndf7jygkepdsh5zzpvzobhhsivvqf2fpafrgur5quq") } 

TO

var vstsAuthHeader =  "Basic " + btoa("" + ":" + "jmmkdq6p5bndf7jygkepdsh5zzpvzobhhsivvqf2fpafrgur5quq")

This

data: { 
"definition" : {
     "id" : 13
  }
...}

To

data: JSON.stringify({
  "definitionId": 13,...})
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!