Create Azure DevOps release without artifacts via Rest API

sukoneck

I am building a JSON body based on the documentation. It looks like this (copied from the documentation):

{
  "definitionId": 1,
  "description": "Creating Sample release",
  "artifacts": [
    {
      "alias": "Fabrikam.CI",
      "instanceReference": {
        "id": "2",
        "name": null
      }
    }
  ],
  "isDraft": false,
  "reason": "none",
  "manualEnvironments": null
}

However, there aren't any artifacts for this release. It's just stages that need to run. I have tried setting the "artifacts" value to null and false. I also tried removing the "artifacts" key altogether, like this:

{
  "definitionId": 1,
  "description": "Creating Sample release",
  "isDraft": false,
  "reason": "none",
  "manualEnvironments": null
}

Unfortunately, all of these guesses just throw one of these errors:

The artifact alias cannot be empty. Specify a valid artifact alias and try again.

or

Release pipeline name cannot be empty. Specify a name and try again.

How do I create a release that doesn't include artifacts using the REST API?

Lance Li-MSFT

How do I create a release that doesn't include artifacts using the REST API?

Just leave it blank and it will work. Use format like this:

{
  "definitionId": 1,
  "description": "Creating Sample release",
  "artifacts": [],
  "isDraft": false,
  "reason": "none",
  "manualEnvironments": null
}

If the response is 200 OK, it means you run the rest api successfully. (This api is used to create release instead of creating release pipeline, you should know that! )

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Azure DevOps REST API to create a release definition

Azure devops Rest API invoke release

Azure Devops REST API delete Release

Create Azure Devops/Pipeline release including all meta data like buildNumber via REST

Azure Devops: how to retrieve the release artifact's versions via the Rest API?

Error when trying to create a release pipeline using the Azure DevOps Rest API

Error while trying to create a release definition using Azure DevOps Rest API

How to find API end point for Release Notes field while creating bug via REST API for Azure DevOps Services

How to start a specific stage in a release using Azure DevOps Rest API

Set Azure devops Release pipeline variable using REST API

How to add task in Azure DevOps release pipeline using rest API

Azure DevOps rest api get release definition does not include variables

Error while creating azure devops release pipeline - POST rest api

Azure DevOps: how to update release scoped variables using REST API

Azure DevOps create build definition via REST API given existing YAML

Create Azure Devops (security) group like 'Contributors' with Permissions via Rest API or Client DLL

How to create a serviceEndpoint via Azure DevOps REST API with an approver or group of approvers?

Azure DevOps: Error importing Maven artifact from Azure Artifacts into Release

Azure DevOps REST API

VSTS - Azure DevOps: AppSettings transformations during the release, or multiple artifacts

How to post Subject Matter Expert to Azure DevOps via Rest API

Azure DevOps how to edit Wiki page via REST API

Azure DevOps get commits linked to a work item via the REST API

Trigger Azure Devops REST API via SP auth

Azure DevOps set permissions via Rest Api Access Control List

How to set DefaultIterationPath in the Team Settings of Azure Devops via REST API?

Invite Users to Azure DevOps Project via REST API (PowerShell)

Azure Devops rest API for create pipeline with source provider bitbucket not working

Azure DevOps Rest API - Unable To Create New Iteration