Publishes the database project as a NuGet package to the NuGet repository.
The Publish task deploys the build artifact to a target environment.
1. Click Add a task to Agent job.

2. In the search box, enter the extension name, for example, dbforge.

3. Select dbForge DevOps Automation for SQL Server – Publish and click Add.
Note
The Publish will use the package file generated in the Package task as input.
The Package and Publish tasks have the same file name template.
4. Specify the URL or package source key.
In the example, the package is published to a local drive. To publish the package on a package server, such as NuGet (https://www.nuget.org), you must set the API key parameter. The value of this parameter should be the token issued by that server.
5. Configure all required settings.
Customization options
The table provides a list of customization options available for the Publish task.
| Name | Description |
|---|---|
| ID | Enter the output package file name. The format is as follows: {name}.{major}.{minor}.{build}. You can use the $(Build.BuildNumber) variable to customize it for a build pipeline or the $(Release.ReleaseId) variable to customize it for a release pipeline. |
| Package folder | Specify whether the NuGet package is located in the root directory of the repository or within the specified subfolder path. |
| URL or packages source key | Enter URL or package source key for the target NuGet feed. |
| API key | Enter the NuGet feed API key if your deployment target is the NuGet repository. |
Control options
The table provides a list of control options available for the Publish task.
| Name | Description |
|---|---|
| Enabled | Select to turn on the task in your pipeline. If the task is turned off, it will be skipped during the pipeline execution. |
| Continue on error | Select to continue the pipeline running even if this task fails. |
| Number of retries if task failed | Specify the number of retries for this task that will happen in case of task failure. Note: This requires agent version 2.194.0 or later. Not supported for agentless tasks. |
| Timeout | Specify the maximum time, in minutes, that a task is allowed to execute before being canceled by server. A zero value indicates an infinite timeout. |
| Run this task | Specify when this task should run. Select Custom conditions to specify more complex conditions. The available options are:
|
Output variables
The table provides output variables available for the Publish task.
| Name | Description |
|---|---|
| Reference name | Any changes to the reference name will require updates to downstream tasks that use this reference name, a valid reference name can only contain a-z, A-Z, 0-9 and _. |
6. To verify the settings, click Save & queue.
7. Open the pipeline execution log to verify the configuration.
