Use feed views to share packages

Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019 | TFS 2018

Feed views are a way to enable users to share some packages while keeping other packages private. Views filter the feed to a subset of packages that meet a set of criteria defined by that view.

By default, Azure Artifacts comes with three views: @Local, @Prerelease, and @Release. @local is the default view that contains all the published packages as well as all the packages saved from an upstream source. All views support NuGet, npm, Maven, Python, and Universal packages.

Promote packages

With Azure Artifacts, you can promote packages to a specific to only share a subset of packages with your customers. Note that you cannot publish a package directly to a view. Instead, you should publish the package to your feed then promote it to a view as follows.

  1. Select Artifacts.

  2. Select your feed from the dropdown menu.

  3. Select the package you wish to promote.

  4. Select Promote.

    A screenshot showing how to promote a package to a view.

  5. Select a view from the dropdown menu, and then select Promote.

    Screenshot showing the promote package dialog box.

Note

Package demotion is not supported. If you want this feature to be added to a future release, please feel free to Suggest a feature on Azure DevOps Developer Community.

Promote packages using the REST API

In addition to using the Azure Artifacts user interface, you can also promote packages using the REST API. The URI varies based on the package type:

Use the actual user-facing name and version of the package for the {packageName} and {packageVersion} fields, respectively. If your feed is organization-scoped, omit the {project} field.

The body of the request is a JSON Patch document adding the view to the end of the views array.

  • NuGet:

    PATCH https://pkgs.dev.azure.com/{organization}/{project}/_apis/packaging/feeds/{feedId}/nuget/packages/{packageName}/versions/{packageVersion}?api-version=7.1-preview.1
    

    Use JsonPatchOperation to construct the body of your request. See NuGet - update package version for more details.

  • npm:

    PATCH https://pkgs.dev.azure.com/{organization}/{project}/_apis/packaging/feeds/{feedId}/npm/{packageName}/versions/{packageVersion}?api-version=7.1-preview.1
    

    Use JsonPatchOperation to construct the body of your request. See npm - update package version for more details.

  • Python:

    PATCH https://pkgs.dev.azure.com/{organization}/{project}/_apis/packaging/feeds/{feedId}/pypi/packages/{packageName}/versions/{packageVersion}?api-version=7.1-preview.1
    

    Use JsonPatchOperation to construct the body of your request. See Python - update package version for more details.

  • Maven:

    PATCH https://pkgs.dev.azure.com/{organization}/{project}/_apis/packaging/feeds/{feed}/maven/groups/{groupId}/artifacts/{artifactId}/versions/{version}?api-version=7.1-preview.1
    

    Use JsonPatchOperation to construct the body of your request. See Maven - update package version for more details.

  • Universal packages:

    PATCH https://pkgs.dev.azure.com/{organization}/{project}/_apis/packaging/feeds/{feedId}/upack/packages/{packageName}/versions/{packageVersion}?api-version=7.1-preview.1
    

    Use JsonPatchOperation to construct the body of your request. See Universal packages - update package version for more details.

  • Example:

PATCH https://pkgs.dev.azure.com/fabrikam-fiber-inc/litware/_apis/packaging/feeds/litware-tools/nuget/packages/LitWare.Common/versions/1.0.0?api-version=5.1-preview.1 HTTP/1.1
Content-Type: application/json-patch+json

{
  "views": {
    "op": "add",
    "path": "/views/-",
    "value": "Release"
  }
}

Tip

Check out the Get started with the REST API and the REST API samples to learn how to interact with Azure DevOps REST API.

Manage views

You can create your own views or rename and delete existing ones from your feed's settings.

Note

All feed views in a public project are accessible to everyone on the internet.

  1. Select Artifacts.

  2. Select your feed from the dropdown menu.

  3. Select the gear icon to access your feed's settings.

    Screenshot showing how to access the feed's settings.

  4. Select Views.

    A screenshot showing how to navigate to views.

  5. Select a view, and then select Edit to edit your view or select Add view if you want to add a new view.

  6. Select Save when you are done.

Important

For public feeds, if you change the access permissions of a certain view to Specific people your view will not be available as an upstream source.