Bagikan melalui


Promote packages and manage feed views in Azure Artifacts

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 and all the packages saved from upstream sources. All views support NuGet, npm, Maven, Python, and Universal packages.

Note

Azure Artifacts only supports publishing and restoring packages from and to the default view - @Local.

Promote packages

  1. Sign in to your Azure DevOps organization, and then navigate to your project.

  2. Select Artifacts, and then select your feed from the dropdown menu.

  3. Select the package you wish to promote, and then select Promote.

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

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

    A screenshot showing the available feed views.

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. See Get started with the REST API and the REST API samples for more information on how to interact with Azure DevOps REST API.

  • Organization scoped feed:

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

    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.

  • 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"
  }
}

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're 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.